예제 #1
0
        internal async Task <OperationStatus> AutomateActions(ControllerActions controllerAction, string userName)
        {
            List <SQLParam> sQLParam = new List <SQLParam>
            {
                new SQLParam("@AreaName", controllerAction.Area),
                new SQLParam("@PageName", controllerAction.Controller),
                new SQLParam("@ActionName", controllerAction.Action),
                new SQLParam("@UserName", userName)
            };

            try
            {
                SQLExecuteNonQueryAsync handler = new SQLExecuteNonQueryAsync();
                int result = await handler.ExecuteNonQueryAsync("[usp_PageAction_AutomateActions]", 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;
            }
        }
예제 #2
0
        public async Task <OperationStatus> AutomateActions(ControllerActions controllerAction, string userName)
        {
            PageActionDataProvider provider = new PageActionDataProvider();

            return(await provider.AutomateActions(controllerAction, userName));
        }