當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。