Beispiel #1
0
        public ActionResult Edit(Ruanal.WebDomain.Model.Manager model, string AllowLogin = "")
        {
            try
            {
                if (model == null)
                {
                    throw new Exception("无效参数!");
                }
                model.AllowLogin = (AllowLogin ?? "").ToLower() == "on" ? 1 : 0;
                if (model.ManagerId > 0)
                {
                    managerbll.UpdateManager(model);

                    ViewBag.msg = "修改成功";
                }
                else
                {
                    model       = managerbll.AddManager(model);
                    ViewBag.msg = "新增成功";
                }
                model = managerbll.GetManagerDetail(model.ManagerId);

                return(View(model));
            }
            catch (Exception ex)
            {
                ViewBag.msg = ex.Message;
                return(View(model));
            }
        }
Beispiel #2
0
 public ActionResult Edit(int managerid = 0)
 {
     if (managerid > 0)
     {
         var model = managerbll.GetManagerDetail(managerid);
         return(View(model));
     }
     else
     {
         var model = new Ruanal.WebDomain.Model.Manager();
         ViewBag.branchname = null;
         return(View(model));
     }
 }