private void FillRoleCmb()
        {
            _roleBLL = new RoleBusiness(_user);

            cmbRoleID.DataSource    = null;
            cmbRoleID.DataSource    = _roleBLL.GetAll();
            cmbRoleID.DisplayMember = "Name";
            cmbRoleID.ValueMember   = "ID";

            if (_selectedId > 0)
            {
                int  roleInt = Convert.ToInt32(_emp.RoleID);
                Role empRole = _roleBLL.Get(roleInt);
                cmbRoleID.SelectedItem = empRole;
            }
        }
Beispiel #2
0
 public ActionResult Edit(long id)
 {
     try
     {
         var model = _business.Get(id);
         ViewBag.ActionList = _actionBusiness.GetList();
         return(View(model));
     }
     catch (AppException ex)
     {
         ViewBag.ErrorMessage = ex.Message;
         return(View());
     }
     catch (Exception ex)
     {
         ViewBag.ErrorMessage = "未知错误,请联系管理人员";
         return(View());
     }
 }
Beispiel #3
0
        public OutPutDTO GetObject(int id)
        {
            Role obj = roleBusiness.Get <Role>(id);

            return(new OutPutDTO(true, Constants.STATUS_CODE.SUCCESS, Constants.STATUS_MESSAGE.SUCCESS, obj));
        }