Пример #1
0
        public ActionResult SetGlobalEmailLimit()
        {
            UserLimit limit = SUBLL.GetLimitModel(new UserLimit {
                Category = 3, UserId = "0"
            });

            if (limit == null)
            {
                limit = new UserLimit()
                {
                    AccessNo = "20000,20,20000"
                };
            }

            return(View(limit));
        }
Пример #2
0
        public ActionResult SetSysEmailLimitForUpdate(string id)
        {
            ViewData["id"] = id;
            UserLimit limit = SUBLL.GetLimitModel(new UserLimit {
                Category = 1, UserId = id
            });
            Dictionary <int, string> dic = new Dictionary <int, string>();

            if (limit == null || string.IsNullOrEmpty(limit.AccessNo))
            {
                limit          = new UserLimit();
                limit.AccessNo = ",";
                dic.Add(1, "");
                dic.Add(2, "");
                dic.Add(3, "");
                dic.Add(4, "");
                dic.Add(5, "");
                dic.Add(6, "");
            }
            else
            {
                string lim = limit.AccessNo;

                // 1:1,2:22,3:,4:
                string[] strs = lim.Split(',');

                for (int i = 0; i < strs.Length; i++)
                {
                    string[] s = strs[i].Split(':');
                    dic.Add(Convert.ToInt32(s[0]), s[1]);
                }



                limit.AccessNo = "," + limit.AccessNo.Trim(',');
            }

            ViewData["dic"] = dic;

            return(View(limit));
        }