public ActionResult Edit(DataPrivilegeVM vm) { if (!ModelState.IsValid) { return(PartialView(vm)); } else { vm.DoEdit(); return(FFResult().CloseDialog().RefreshGrid()); } }
public DataPrivilegeVM Get(string TableName, string TargetId, DpTypeEnum DpType) { DataPrivilegeVM vm = null; if (DpType == DpTypeEnum.User) { vm = Wtm.CreateVM<DataPrivilegeVM>(values: x => x.Entity.TableName == TableName && x.Entity.UserCode == TargetId && x.DpType == DpType); } else { vm = Wtm.CreateVM<DataPrivilegeVM>(values: x => x.Entity.TableName == TableName && x.Entity.GroupCode == TargetId && x.DpType == DpType); } return vm; }
public async Task <ActionResult> Edit(DataPrivilegeVM vm) { if (!ModelState.IsValid) { return(PartialView(vm)); } else { await vm.DoEditAsync(); return(FFResult().CloseDialog().RefreshGrid()); } }
public async Task<ActionResult> Delete(SimpleDpModel dp) { DataPrivilegeVM vm = null; if (dp.Type == DpTypeEnum.User) { vm = Wtm.CreateVM<DataPrivilegeVM>(values: x => x.Entity.TableName == dp.ModelName && x.Entity.UserCode == dp.Id && x.DpType == dp.Type); } else { vm = Wtm.CreateVM<DataPrivilegeVM>(values: x => x.Entity.TableName == dp.ModelName && x.Entity.GroupCode == dp.Id && x.DpType == dp.Type); } await vm.DoDeleteAsync(); return Ok(1); }
public ActionResult Edit(string ModelName, string Id, DpTypeEnum Type) { DataPrivilegeVM vm = null; if (Type == DpTypeEnum.User) { vm = Wtm.CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == ModelName && x.Entity.UserCode == Id && x.DpType == Type); } else { vm = Wtm.CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == ModelName && x.Entity.GroupCode == Id && x.DpType == Type); } return(PartialView(vm)); }
public ActionResult Delete(string ModelName, Guid Id, DpTypeEnum Type) { DataPrivilegeVM vm = null; if (Type == DpTypeEnum.User) { vm = CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == ModelName && x.Entity.UserId == Id && x.DpType == Type); } else { vm = CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == ModelName && x.Entity.GroupId == Id && x.DpType == Type); } vm.DoDelete(); return(FFResult().RefreshGrid()); }
public ActionResult Edit(string ModelName, Guid Id, DpTypeEnum Type) { DataPrivilegeVM vm = null; if (Type == DpTypeEnum.User) { vm = CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == ModelName && x.Entity.UserId == Id && x.DpType == Type); vm.UserItCode = DC.Set <FrameworkUserBase>().Where(x => x.ID == Id).Select(x => x.ITCode).FirstOrDefault(); } else { vm = CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == ModelName && x.Entity.GroupId == Id && x.DpType == Type); } return(PartialView(vm)); }
public DataPrivilegeVM Get(string TableName, Guid TargetId, DpTypeEnum DpType) { DataPrivilegeVM vm = null; if (DpType == DpTypeEnum.User) { vm = CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == TableName && x.Entity.UserId == TargetId && x.DpType == DpType); vm.UserItCode = DC.Set <FrameworkUserBase>().Where(x => x.ID == TargetId).Select(x => x.ITCode).FirstOrDefault(); } else { vm = CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == TableName && x.Entity.GroupId == TargetId && x.DpType == DpType); } return(vm); }
public async Task <ActionResult> Delete(string ModelName, string Id, DpTypeEnum Type) { DataPrivilegeVM vm = null; if (Type == DpTypeEnum.User) { vm = Wtm.CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == ModelName && x.Entity.UserCode == Id && x.DpType == Type); } else { vm = Wtm.CreateVM <DataPrivilegeVM>(values: x => x.Entity.TableName == ModelName && x.Entity.GroupCode == Id && x.DpType == Type); } await vm.DoDeleteAsync(); return(FFResult().RefreshGrid()); }
public IActionResult Edit(DataPrivilegeVM vm) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorJson())); } else { vm.DoEdit(false); if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorJson())); } else { return(Ok(vm.Entity)); } } }
public async Task<IActionResult> Edit(DataPrivilegeVM vm) { if (!ModelState.IsValid) { return BadRequest(ModelState.GetErrorJson()); } else { await vm.DoEditAsync(false); if (!ModelState.IsValid) { return BadRequest(ModelState.GetErrorJson()); } else { return Ok(vm.Entity); } } }
public async Task <IActionResult> Add(DataPrivilegeVM vm) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorJson())); } else { await vm.DoAddAsync(); if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorJson())); } else { return(Ok(vm.Entity)); } } }