Пример #1
0
        public ActionResult SaveSysEmailUpdate(Dictionary <string, string> queryvalues)
        {
            string checkbox = queryvalues.ContainsKey("checkbox") ? queryvalues["checkbox"] : "";
            string numLimit = queryvalues.ContainsKey("faqtitle") ? queryvalues["faqtitle"] : "";
            string id       = queryvalues.ContainsKey("Id") ? queryvalues["Id"] : "";

            //   1,2,4,5
            //   1,2,,1,
            numLimit += ',';
            string[] checkboxS = checkbox.Split(',');
            string[] numLimits = numLimit.Split(',');
            string   saveStr   = "";

            if (checkbox != "")
            {
                for (int i = 0; i < checkboxS.Length; i++)
                {
                    saveStr += checkboxS[i] + ":" + numLimits[Convert.ToInt32(checkboxS[i]) - 1] + ",";
                }
            }

            saveStr = saveStr.Trim(',');

            bool res = SUBLL.AddUserLimit(id, saveStr, 1);



            return(Redirect("/SU/SetSysEmailLimit"));
        }
Пример #2
0
        public ActionResult SaveGlobalEmailLimit(Dictionary <string, string> queryvalues)
        {
            string gold  = queryvalues.ContainsKey("gold") ? queryvalues["gold"] : "";
            string wubi  = queryvalues.ContainsKey("wubi") ? queryvalues["wubi"] : "";
            string jifen = queryvalues.ContainsKey("jifen") ? queryvalues["jifen"] : "";
            //   1,2,4,5
            //   1,2,,1,
            string saveStr = "";

            try
            {
                if (!string.IsNullOrEmpty(gold))
                {
                    Convert.ToInt32(gold);
                    saveStr += (gold + ",");
                }
                else
                {
                    saveStr += (20000 + ",");
                }
                if (!string.IsNullOrEmpty(wubi))
                {
                    Convert.ToInt32(wubi);
                    saveStr += (wubi + ",");
                }
                else
                {
                    saveStr += (20 + ",");
                }
                if (!string.IsNullOrEmpty(jifen))
                {
                    Convert.ToInt32(jifen);
                    saveStr += (jifen + ",");
                }
                else
                {
                    saveStr += (20000 + ",");
                }
            }
            catch {
                return(Content("-1"));
            }

            saveStr = saveStr.Trim(',');

            bool res = SUBLL.AddUserLimit("0", saveStr, 3);

            if (res)
            {
                return(Content("1"));
            }
            else
            {
                return(Content("0"));
            }
        }