public Page <Sys_UserGroup> FindPage(UserGroupVM form) { Expression <Func <Sys_UserGroup, bool> > predicate = Ext.True <Sys_UserGroup>(); OrderModelField idOrder = new OrderModelField { PropertyName = "Id", IsDESC = false }; OrderModelField[] orderByExpression = new OrderModelField[] { idOrder }; Page <Sys_UserGroup> page = this._userGroupRepository.FindPage(ContextDB.managerDBContext, predicate, orderByExpression, form.page, form.rows); return(page); }
public ActionResult <UserGroup> GetUserGroup(Guid ID) { try { var rs = _userGroupService.GetByID(ID); if (rs == null) { return(NotFound("ID not found")); } UserGroupVM result = _mapper.Map <UserGroupVM>(rs); return(Ok(result)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public string UserGroupEdit(UserGroupVM form, int type = 0) { try { this._userGroupService.Update(form); return(ResponseJson.Success()); } catch (BaseException ex) { _logger.Info(ex.GetMessage()); return(ResponseJson.Error(ex.GetExceptionFlag(), ex.GetMessage())); } catch (Exception ex) { _logger.Info(ex.Message); return(ResponseJson.Error(ex.Message)); } }
public ActionResult Edit(int id = 0) { var userGroup = _userGroupService.GetUserGroup(c => c.Id == id); if (userGroup == null) { return(PartialView("Create", new UserGroupVM())); } var model = new UserGroupVM() { Id = userGroup.Id, GroupName = userGroup.GroupName, Description = userGroup.Description, OrderSort = userGroup.OrderSort, Enabled = userGroup.Enabled, }; return(PartialView("Create", model)); }
public bool Delete(UserGroupVM entity) { UserGroup uGroup = new UserGroup() { ID = entity.ID, Code = entity.Code, ARName = entity.ARName, LatName = entity.LatName, Notes = entity.Notes, AddedBy = entity.AddedBy, AddedOn = entity.AddedOn, Disable = entity.Disable, UpdatedBy = entity.UpdatedBy, updatedOn = entity.updatedOn }; userGroupRepo.Delete(uGroup, entity.ID); return(true); }
public Task <bool> DeleteAsync(UserGroupVM entity) { return(Task.Run <bool>(() => { UserGroup uGroup = new UserGroup() { ID = entity.ID, Code = entity.Code, ARName = entity.ARName, LatName = entity.LatName, Notes = entity.Notes, AddedBy = entity.AddedBy, AddedOn = entity.AddedOn, Disable = entity.Disable, UpdatedBy = entity.UpdatedBy, updatedOn = entity.updatedOn }; userGroupRepo.Delete(uGroup, entity.ID); return true; })); }
public Task <int> InsertAsync(UserGroupVM entity) { return(Task.Run <int>(() => { UserGroup uGroup = new UserGroup() { ID = entity.ID, Code = entity.Code, ARName = entity.ARName, LatName = entity.LatName, Notes = entity.Notes, AddedBy = entity.AddedBy, AddedOn = entity.AddedOn, Disable = entity.Disable, UpdatedBy = entity.UpdatedBy, updatedOn = entity.updatedOn }; userGroupRepo.Add(uGroup); return uGroup.ID; })); }
public Sys_UserGroup GetUserGroup(UserGroupVM form) { return(this._userGroupRepository.Entity(ContextDB.managerDBContext, t => t.Id == form.Id)); }
public int Delete(UserGroupVM form) { return(this._userGroupRepository.Delete(ContextDB.managerDBContext, t => t.Id == form.Id)); }
public ActionResult Create() { var model = new UserGroupVM(); return(PartialView(model)); }
public async Task <ActionResult> DeleteUserGroup(UserGroupVM Model) { await db.DeleteUserGroup(Model.Id); return(null); }
public async Task <ActionResult> CancelUserGroup(UserGroupVM Model) { await Model.Update(); return(PartialView("Partial/_UserGroupRow", Model)); }
public override BussinessCustomResponse <UserGroupVM> Update(UserGroupVM entityToUpdateVM) { return(base.Update(entityToUpdateVM)); }
public UserGroupView(UserGroupVM vm) { InitializeComponent(); ViewModel = vm; }