Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        public async Task <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);
            }
            await vm.DoDeleteAsync();

            return(FFResult().RefreshGrid());
        }