Ejemplo n.º 1
0
 public JsonResult Delete(string storeId)
 {
     try
     {
         string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.公司管理.网点管理.除);
         if (!IsPermission(funcId))
         {
             return(Error("您没有操作权限,请联系系统管理员!"));
         }
         var entity = StoreService.GetStorePro(SystemID, CompanyID, storeId);
         var result = StoreService.DeleteStorePro(SystemID, CompanyID, storeId);
         TableOperationManager.Delete(entity, result);
         if (result)
         {
             return(Success("ok"));
         }
         else
         {
             return(Error("fail"));
         }
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
 public IActionResult Delete(long id)
 {
     try
     {
         string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.系统管理.系统日志.除);
         if (!IsPermission(funcId))
         {
             return(Error("您没有操作权限,请联系系统管理员!"));
         }
         long operationId = 0;
         var  entity      = LoginRecordService.GetLoginRecord(id);
         if (entity == null)
         {
             return(Error("id not exists!"));
         }
         TableOperationManager.Delete(entity, out operationId);
         bool result = LoginRecordService.DeleteLoginRecord(SystemID, CompanyID, id);
         TableOperationManager.SetState(operationId, result);
         if (result)
         {
             return(Success("成功!"));
         }
         else
         {
             return(Error("失败!"));
         }
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
        public JsonResult Delete(string departmentId)
        {
            try
            {
                string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.公司管理.部门管理.除);
                if (!IsPermission(funcId))
                {
                    return(Error("您没有操作权限,请联系系统管理员!"));
                }
                if (string.IsNullOrEmpty(departmentId))
                {
                    return(Error("department id not empty"));
                }

                var entity = DepartmentService.GetDepartmentPro(SystemID, CompanyID, departmentId);
                var result = DepartmentService.DeleteDepartmentPro(SystemID, CompanyID, departmentId);
                TableOperationManager.Delete(entity, result);
                if (result)
                {
                    return(Success("ok"));
                }
                else
                {
                    return(Error("fail"));
                }
            }
            catch (Exception ex)
            {
                return(Error(ex.Message));
            }
        }
Ejemplo n.º 4
0
        public JsonResult Delete(string memberId, string delete)
        {
            try
            {
                string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.会员管理.除的会员.除);
                if (!IsPermission(funcId))
                {
                    return(Error("您没有操作权限,请联系系统管理员!"));
                }

                bool isDel  = true;
                bool result = false;
                if (delete.ToBool())
                {
                    var entity = AccountService.GetAccountPro(SystemID, CompanyID, memberId);
                    result = AccountService.DeleteAccountPro(SystemID, CompanyID, memberId);
                    TableOperationManager.Delete(entity, result);
                }
                else
                {
                    var entity = AccountService.GetAccountPro(SystemID, CompanyID, memberId);
                    result = AccountService.UpdateAccountDeletePro(SystemID, CompanyID, memberId, isDel);
                    string newEntityJson = GetNewEntityJsonByDelete(entity, isDel);
                    TableOperationManager.Update(entity, newEntityJson, result);
                }
                if (result)
                {
                    return(Success("ok"));
                }
                else
                {
                    return(Error("fail"));
                }
            }
            catch (Exception ex)
            {
                return(Error(ex.Message));
            }
        }