当前位置: 首页>>代码示例>>C#>>正文


C# UserRepository.UserCountByMonth方法代码示例

本文整理汇总了C#中SocioBoard.Model.UserRepository.UserCountByMonth方法的典型用法代码示例。如果您正苦于以下问题:C# UserRepository.UserCountByMonth方法的具体用法?C# UserRepository.UserCountByMonth怎么用?C# UserRepository.UserCountByMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SocioBoard.Model.UserRepository的用法示例。


在下文中一共展示了UserRepository.UserCountByMonth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                #region User Count By Month
                try
                {
                    UserRepository objUserRepo = new UserRepository();
                    ArrayList lstUser = objUserRepo.UserCountByMonth();

                    foreach (var item in lstUser)
                    {
                        Array temp = (Array)item;
                        strUser = strUser + temp.GetValue(1).ToString() + ",";
                        if (temp.GetValue(0).ToString() == "1")
                            strMonth = strMonth + "'Jan',";
                        else if (temp.GetValue(0).ToString() == "2")
                            strMonth = strMonth + "'Feb',";
                        else if (temp.GetValue(0).ToString() == "3")
                            strMonth = strMonth + "'March',";
                        else if (temp.GetValue(0).ToString() == "4")
                            strMonth = strMonth + "'April',";
                        else if (temp.GetValue(0).ToString() == "5")
                            strMonth = strMonth + "'May',";
                        else if (temp.GetValue(0).ToString() == "6")
                            strMonth = strMonth + "'June',";
                        else if (temp.GetValue(0).ToString() == "7")
                            strMonth = strMonth + "'July',";
                        else if (temp.GetValue(0).ToString() == "8")
                            strMonth = strMonth + "'Aug',";
                        else if (temp.GetValue(0).ToString() == "9")
                            strMonth = strMonth + "'Sep',";
                        else if (temp.GetValue(0).ToString() == "10")
                            strMonth = strMonth + "'Oct',";
                        else if (temp.GetValue(0).ToString() == "11")
                            strMonth = strMonth + "'Nov',";
                        else if (temp.GetValue(0).ToString() == "12")
                            strMonth = strMonth + "'Dec'";
                    }
                    strMonth = strMonth.Substring(0, strMonth.Length - 1);
                    strUser = strUser.Substring(0, strUser.Length - 1);
                }
                catch (Exception Err)
                {
                    logger.Error(Err.Message);
                    Console.Write(Err.StackTrace);
                }
                #endregion

                #region User Count By Month & Account Type
                try
                {
                    UserRepository objUserRepo = new UserRepository();
                    ArrayList lstUser = objUserRepo.UserCountByAccTypeMonth();

                    foreach (var item in lstUser)
                    {
                        Array temp = (Array)item;
                        if (temp.GetValue(0).ToString() == "1")
                            strAccMonth = strAccMonth + "'Jan',";
                        else if (temp.GetValue(0).ToString() == "2")
                            strAccMonth = strAccMonth + "'Feb',";
                        else if (temp.GetValue(0).ToString() == "3")
                            strAccMonth = strAccMonth + "'March',";
                        else if (temp.GetValue(0).ToString() == "4")
                            strAccMonth = strAccMonth + "'April',";
                        else if (temp.GetValue(0).ToString() == "5")
                            strAccMonth = strAccMonth + "'May',";
                        else if (temp.GetValue(0).ToString() == "6")
                            strAccMonth = strAccMonth + "'June',";
                        else if (temp.GetValue(0).ToString() == "7")
                            strAccMonth = strAccMonth + "'July',";
                        else if (temp.GetValue(0).ToString() == "8")
                            strAccMonth = strAccMonth + "'Aug',";
                        else if (temp.GetValue(0).ToString() == "9")
                            strAccMonth = strAccMonth + "'Sep',";
                        else if (temp.GetValue(0).ToString() == "10")
                            strAccMonth = strAccMonth + "'Oct',";
                        else if (temp.GetValue(0).ToString() == "11")
                            strAccMonth = strAccMonth + "'Nov',";
                        else if (temp.GetValue(0).ToString() == "12")
                            strAccMonth = strAccMonth + "'Dec'";
                        if (temp.GetValue(3) != null)
                        {
                            if (temp.GetValue(3).ToString() == "Standard")
                                strStandard = strStandard + temp.GetValue(1).ToString() + ",";
                            else if (temp.GetValue(3).ToString() == "deluxe")
                                strDelux = strDelux + temp.GetValue(1).ToString() + ",";
                            else if (temp.GetValue(3).ToString() == "premium")
                                strPremium = strPremium + temp.GetValue(1).ToString() + ",";
                        }
                    }
                    strAccMonth = strAccMonth.Substring(0, strAccMonth.Length - 1);
                    strStandard = strStandard.Substring(0, strStandard.Length - 1);
                    strDelux = strDelux.Substring(0, strDelux.Length - 1);
                    strPremium = strPremium.Substring(0, strPremium.Length - 1);
                }
                catch (Exception Err)
                {
                    logger.Error(Err.Message);
//.........这里部分代码省略.........
开发者ID:utkarshx,项目名称:socioboard,代码行数:101,代码来源:Dashboard.aspx.cs

示例2: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                if (Session["AdminProfile"] == null)
                {
                    Response.Redirect("Default.aspx");
                }

                #region User Count By Month
                try
                {
                    UserRepository objUserRepo = new UserRepository();
                    ArrayList lstUser = objUserRepo.UserCountByMonth();

                    foreach (var item in lstUser)
                    {
                        Array temp = (Array)item;
                        strUser = strUser + temp.GetValue(1).ToString() + ",";
                        if (temp.GetValue(0).ToString() == "1")
                            strMonth = strMonth + "'Jan',";
                        else if (temp.GetValue(0).ToString() == "2")
                            strMonth = strMonth + "'Feb',";
                        else if (temp.GetValue(0).ToString() == "3")
                            strMonth = strMonth + "'March',";
                        else if (temp.GetValue(0).ToString() == "4")
                            strMonth = strMonth + "'April',";
                        else if (temp.GetValue(0).ToString() == "5")
                            strMonth = strMonth + "'May',";
                        else if (temp.GetValue(0).ToString() == "6")
                            strMonth = strMonth + "'June',";
                        else if (temp.GetValue(0).ToString() == "7")
                            strMonth = strMonth + "'July',";
                        else if (temp.GetValue(0).ToString() == "8")
                            strMonth = strMonth + "'Aug',";
                        else if (temp.GetValue(0).ToString() == "9")
                            strMonth = strMonth + "'Sep',";
                        else if (temp.GetValue(0).ToString() == "10")
                            strMonth = strMonth + "'Oct',";
                        else if (temp.GetValue(0).ToString() == "11")
                            strMonth = strMonth + "'Nov',";
                        else if (temp.GetValue(0).ToString() == "12")
                            strMonth = strMonth + "'Dec'";
                    }

                    if (strMonth[strMonth.Length - 1] == ',')
                    {
                        strMonth = strMonth.Substring(0, strMonth.Length - 1);
                    }


                    strUser = strUser.Substring(0, strUser.Length - 1);
                }
                catch (Exception Err)
                {
                    logger.Error(Err.Message);
                    Console.Write(Err.StackTrace);
                }
                #endregion

                #region User Count By Month & Account Type
                try
                {
                    UserRepository objUserRepo = new UserRepository();
                    ArrayList lstUser = objUserRepo.UserCountByAccTypeMonth();

                    foreach (var item in lstUser)
                    {
                        Array temp = (Array)item;
                        if (temp.GetValue(0).ToString() == "1")
                            strAccMonth = strAccMonth + "'Jan',";
                        else if (temp.GetValue(0).ToString() == "2")
                            strAccMonth = strAccMonth + "'Feb',";
                        else if (temp.GetValue(0).ToString() == "3")
                            strAccMonth = strAccMonth + "'March',";
                        else if (temp.GetValue(0).ToString() == "4")
                            strAccMonth = strAccMonth + "'April',";
                        else if (temp.GetValue(0).ToString() == "5")
                            strAccMonth = strAccMonth + "'May',";
                        else if (temp.GetValue(0).ToString() == "6")
                            strAccMonth = strAccMonth + "'June',";
                        else if (temp.GetValue(0).ToString() == "7")
                            strAccMonth = strAccMonth + "'July',";
                        else if (temp.GetValue(0).ToString() == "8")
                            strAccMonth = strAccMonth + "'Aug',";
                        else if (temp.GetValue(0).ToString() == "9")
                            strAccMonth = strAccMonth + "'Sep',";
                        else if (temp.GetValue(0).ToString() == "10")
                            strAccMonth = strAccMonth + "'Oct',";
                        else if (temp.GetValue(0).ToString() == "11")
                            strAccMonth = strAccMonth + "'Nov',";
                        else if (temp.GetValue(0).ToString() == "12")
                            strAccMonth = strAccMonth + "'Dec'";
                        if (temp.GetValue(3) != null)
                        {
                            if (temp.GetValue(3).ToString() == "INDIVIDUAL")
                                strStandard = strStandard + temp.GetValue(1).ToString() + ",";
                            else if (temp.GetValue(3).ToString() == "SMALL BUSINESS")
                                strDelux = strDelux + temp.GetValue(1).ToString() + ",";
//.........这里部分代码省略.........
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:101,代码来源:Dashboard.aspx.cs


注:本文中的SocioBoard.Model.UserRepository.UserCountByMonth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。