Exemplo n.º 1
0
        public ActionResult Edit(int mallAGid = -1)
        {
            if (mallAGid < 3)
                return PromptView("内置商城管理员组不能修改");

            MallAdminGroupInfo mallAdminGroupInfo = MallAdminGroups.GetMallAdminGroupById(mallAGid);
            if (mallAdminGroupInfo == null)
                return PromptView("商城管理员组不存在");

            MallAdminGroupModel model = new MallAdminGroupModel();
            model.AdminGroupTitle = mallAdminGroupInfo.Title;
            model.ActionList = StringHelper.SplitString(mallAdminGroupInfo.ActionList);

            Load();
            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Add(MallAdminGroupModel model)
        {
            if (MallAdminGroups.GetMallAdminGroupIdByTitle(model.AdminGroupTitle) > 0)
                ModelState.AddModelError("AdminGroupTitle", "名称已经存在");

            if (ModelState.IsValid)
            {
                MallAdminGroupInfo mallAdminGroupInfo = new MallAdminGroupInfo()
                {
                    Title = model.AdminGroupTitle,
                    ActionList = CommonHelper.StringArrayToString(model.ActionList).ToLower()
                };

                MallAdminGroups.CreateMallAdminGroup(mallAdminGroupInfo);
                AddMallAdminLog("添加商城管理员组", "添加商城管理员组,商城管理员组为:" + model.AdminGroupTitle);
                return PromptView("商城管理员组添加成功");
            }
            Load();
            return View(model);
        }
Exemplo n.º 3
0
        public ActionResult Edit(MallAdminGroupModel model, int mallAGid = -1)
        {
            if (mallAGid < 3)
                return PromptView("内置商城管理员组不能修改");

            MallAdminGroupInfo mallAdminGroupInfo = MallAdminGroups.GetMallAdminGroupById(mallAGid);
            if (mallAdminGroupInfo == null)
                return PromptView("商城管理员组不存在");

            int mallAGid2 = MallAdminGroups.GetMallAdminGroupIdByTitle(model.AdminGroupTitle);
            if (mallAGid2 > 0 && mallAGid2 != mallAGid)
                ModelState.AddModelError("AdminGroupTitle", "名称已经存在");

            if (ModelState.IsValid)
            {
                mallAdminGroupInfo.Title = model.AdminGroupTitle;
                mallAdminGroupInfo.ActionList = CommonHelper.StringArrayToString(model.ActionList).ToLower();

                MallAdminGroups.UpdateMallAdminGroup(mallAdminGroupInfo);
                AddMallAdminLog("修改商城管理员组", "修改商城管理员组,商城管理员组ID为:" + mallAGid);
                return PromptView("商城管理员组修改成功");
            }

            Load();
            return View(model);
        }
Exemplo n.º 4
0
 public ActionResult Add()
 {
     MallAdminGroupModel model = new MallAdminGroupModel();
     Load();
     return View(model);
 }