Exemple #1
0
        public ActionResult UpdateBasicInfo(int id, SysAdminUpdateBasicInfoInput model)
        {
            if (Request["Enable"] != null && Request["Enable"].ToString() == "on")
            {
                model.Enable = true;
            }

            _sysManagerService.UpdateBasicInfo(id, model);

            return(RedirectToAction("Detail", new { id = id }));
        }
        public void UpdateBasicInfo(int id, SysAdminUpdateBasicInfoInput model)
        {
            if (model == null)
            {
                throw new JIFException("信息不能为空");
            }

            var entity = _sysAdminRepository.Get(id);

            if (entity == null)
            {
                throw new JIFException("用户不存在");
            }

            entity.Email     = model.Email;
            entity.CellPhone = model.CellPhone;
            entity.Enable    = model.Enable;

            _sysAdminRepository.Update(entity);
        }