示例#1
0
        internal async Task <OperationStatus> AddUpdatePageArea(PageArea pageArea, string userName)
        {
            List <SQLParam> sQLParam = new List <SQLParam>
            {
                new SQLParam("@AreaID", pageArea.AreaID),
                new SQLParam("@Name", pageArea.AreaName),
                new SQLParam("@DisplayName", pageArea.DisplayName),
                new SQLParam("@Description", pageArea.Description),
                new SQLParam("@UserName", userName)
            };

            try
            {
                SQLExecuteNonQueryAsync handler = new SQLExecuteNonQueryAsync();
                int result = await handler.ExecuteNonQueryAsync("[usp_PageAction_AddUpdatePageArea]", 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
            {
                throw;
            }
        }
示例#2
0
        public async Task <OperationStatus> AddUpdatePageArea(PageArea pageArea, string userName)
        {
            PageActionDataProvider provider = new PageActionDataProvider();

            return(await provider.AddUpdatePageArea(pageArea, userName));
        }