public UpdatePermissionOut Update(UpdatePermissionIn input) { var output = new UpdatePermissionOut() { result = Entities.Common.Result.Error }; var request = new Business.Permission.Permission(); var updatePermissiontOut = request.UpdatePermission(new MethodParameters.Permission.UpdatePermissionIn() { permission = new Entities.Database.Permission() { pm_code = input.pm_code, pm_name = input.pm_name, pm_modificationUser = input.pm_modificationUser, pm_status = input.pm_status } }); if (updatePermissiontOut.result == Entities.Common.Result.Success) { output.pmID = updatePermissiontOut.pmID; output.result = Entities.Common.Result.Success; } return(output); }
//[CustomAuthorizationFilterAttribute] public IHttpActionResult UpdatePermission(UpdatePermissionIn input) { if (ModelState.IsValid) { var permission = new SystemManagement.Business.Controllers.Permission(); var updatePermissionOut = permission.Update(input); return(ResponseMessage(Request.CreateResponse(System.Net.HttpStatusCode.OK, updatePermissionOut))); } else { var output = new UpdatePermissionOut(); output.result = SystemManagement.Entities.Common.Result.Error; output.message = DetailErrorBadRequest(ModelState); return(ResponseMessage(Request.CreateResponse(System.Net.HttpStatusCode.BadRequest, output))); } }
public UpdatePermissionOut UpdatePermission(UpdatePermissionIn input) { UpdatePermissionOut output = new UpdatePermissionOut() { result = Entities.Common.Result.Error }; using (var dataContext = DataContextHelper.GetDataContext <PermissionDataContext>()) { var linqResult = dataContext.spr_updatePermission(input.permission.pm_code , input.permission.pm_name , input.permission.pm_description , input.permission.pm_modificationUser , input.permission.pm_status ); if (linqResult == 1) { output.pmID = linqResult; output.result = Entities.Common.Result.Success; } } return(output); }
public UpdatePermissionOut UpdatePermission(UpdatePermissionIn input) { var permission = new SystemManagement.DataAccess.Permission.Permission(); return(permission.UpdatePermission(input)); }