Example #1
0
 public static string ConvertCreditAndAmountToWord(int credit, int amount)
 {
     if (credit < 1 || credit > 8)
     {
         return("0");
     }
     string[] validScoreName = Scoresets.GetValidScoreName();
     string[] validScoreUnit = Scoresets.GetValidScoreUnit();
     return(string.Format("{0}:{1}{2}", validScoreName[credit], amount, validScoreUnit[credit]));
 }
Example #2
0
        public static User[][] GetExtsRankUserArray()
        {
            List <User[]> list = new List <User[]>();

            string[] validScoreName = Scoresets.GetValidScoreName();
            for (int i = 1; i < 9; i++)
            {
                if (validScoreName[i] == string.Empty)
                {
                    list.Add(new User[0]);
                }
                else
                {
                    list.Add(Stats.GetUserArray("extcredits" + i.ToString()));
                }
            }
            return(list.ToArray());
        }
Example #3
0
        public static void WriteUserCreditsCookie(IUser userInfo, string groupTitle)
        {
            if (userInfo == null)
            {
                return;
            }
            string[] validScoreName = Scoresets.GetValidScoreName();
            string[] validScoreUnit = Scoresets.GetValidScoreUnit();
            string   text           = "积分:" + userInfo.Credits + ",";

            text = text + "用户组:" + groupTitle + ",";
            for (int i = 0; i < validScoreName.Length; i++)
            {
                string key;
                if (!Utils.StrIsNullOrEmpty(validScoreName[i]) && (key = "Extcredits" + i) != null)
                {
                    switch (key)
                    {
                    case "Extcredits1":
                    {
                        object obj = text;
                        text = obj + validScoreName[i] + ": " + userInfo.ExtCredits1 + validScoreUnit[1] + ",";
                        break;
                    }

                    case "Extcredits2":
                    {
                        object obj2 = text;
                        text = obj2 + validScoreName[i] + ": " + userInfo.ExtCredits2 + validScoreUnit[2] + ",";
                        break;
                    }

                    case "Extcredits3":
                    {
                        object obj3 = text;
                        text = obj3 + validScoreName[i] + ": " + userInfo.ExtCredits3 + validScoreUnit[3] + ",";
                        break;
                    }

                    case "Extcredits4":
                    {
                        object obj4 = text;
                        text = obj4 + validScoreName[i] + ": " + userInfo.ExtCredits4 + validScoreUnit[4] + ",";
                        break;
                    }

                    case "Extcredits5":
                    {
                        object obj5 = text;
                        text = obj5 + validScoreName[i] + ": " + userInfo.ExtCredits5 + validScoreUnit[5] + ",";
                        break;
                    }

                    case "Extcredits6":
                    {
                        object obj6 = text;
                        text = obj6 + validScoreName[i] + ": " + userInfo.ExtCredits6 + validScoreUnit[6] + ",";
                        break;
                    }

                    case "Extcredits7":
                    {
                        object obj7 = text;
                        text = obj7 + validScoreName[i] + ": " + userInfo.ExtCredits7 + validScoreUnit[7] + ",";
                        break;
                    }

                    case "Extcredits8":
                    {
                        object obj8 = text;
                        text = obj8 + validScoreName[i] + ": " + userInfo.ExtCredits8 + validScoreUnit[8] + ",";
                        break;
                    }
                    }
                }
            }
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies["dntusertips"];

            if (httpCookie == null)
            {
                httpCookie = new HttpCookie("dntusertips");
            }
            httpCookie.Values["userinfotips"] = Utils.UrlEncode(text.TrimEnd(','));
            httpCookie.Expires = DateTime.Now.AddMinutes(5.0);
            HttpContext.Current.Response.AppendCookie(httpCookie);
        }