internal async Task <OperationStatus> AddUpdatePageAction(PageAction pageAction, string userName) { List <SQLParam> sQLParam = new List <SQLParam> { new SQLParam("@PageActionID", pageAction.PageActionID), new SQLParam("@AreaName", pageAction.AreaName), new SQLParam("@PageName", pageAction.PageName), new SQLParam("@ActionName", pageAction.ActionName), new SQLParam("@DisplayName", pageAction.DisplayName), new SQLParam("@Description", pageAction.Description), new SQLParam("@ActionGroupID", pageAction.ActionGroupID), new SQLParam("@UserName", userName) }; try { SQLExecuteNonQueryAsync handler = new SQLExecuteNonQueryAsync(); int result = await handler.ExecuteNonQueryAsync("[usp_PageAction_AddUpdatePageAction]", sQLParam, "@Status"); if (result == 1) { return(new OperationStatus { Message = "Page Controller added successfully.", StatusCode = StatusCode.Created, Result = result }); } else if (result == 2) { return(new OperationStatus { Message = "Page Controller updated successfully.", StatusCode = StatusCode.Updated, Result = result }); } return(new OperationStatus { Message = "Something went wrong while saving Page Controller data.", StatusCode = StatusCode.ServerError, Result = result }); } catch (Exception ex) { throw ex; } }
public async Task <OperationStatus> AddUpdatePageAction(PageAction pageAction, string userName) { PageActionDataProvider provider = new PageActionDataProvider(); return(await provider.AddUpdatePageAction(pageAction, userName)); }