public HttpResponseMessage EditFunnalPage(HttpRequestMessage request, RequestFunnalPageDTO obj)
        {
            return(CreateHttpResponse(request, () =>
            {
                HttpResponseMessage response;

                ResultDTO result = _service.EditFunnalPage(obj);
                response = request.CreateResponse(HttpStatusCode.OK, result);
                return response;
            }));
        }
Exemplo n.º 2
0
        public ResultDTO EditFunnalPage(RequestFunnalPageDTO obj)
        {
            ResultDTO accInfo = null;

            try
            {
                accInfo = _repository.EditFunnalPage(obj);
            }
            catch (Exception ex)
            {
                Utilities.AppLog.WriteLog("EditFunnalPage", ActionType.Update, ex.Message.ToString(), obj.SessionKey);
                accInfo.StatusCode = Utilities.Common.ConvertErrorCodeToInt(RetCode.ECS9999);
                accInfo.StatusMsg  = ex.Message.ToString();
            }
            return(accInfo);
        }
        public static ResultDTO EditFunnalPage(this IEntityBaseRepository <LandingPage> repository, RequestFunnalPageDTO obj)
        {
            var result    = new ResultDTO();
            var dbContext = new ApplicationContext();

            var errorCode = new SqlParameter("ErrorCode", System.Data.SqlDbType.Int)
            {
                Direction = System.Data.ParameterDirection.Output
            };

            result.Details = dbContext.Database.SqlQuery <ResponeDTO>("EXEC [dbo].[sp_EditFunnalPage] @ID,@Title,@SubTitle,@PageName,@Link,@Status,@StepList,@SoloIDList,@UserName,@SessionKey,@errorCode out",
                                                                      new SqlParameter("ID", obj.ID),
                                                                      new SqlParameter("Title", DB.SafeSQL(obj.Title)),
                                                                      new SqlParameter("SubTitle", DB.SafeSQL(obj.SubTitle)),
                                                                      new SqlParameter("PageName", DB.SafeSQL(obj.PageName)),
                                                                      new SqlParameter("Link", DB.SafeSQL(obj.Link)),
                                                                      new SqlParameter("Status", obj.Status),
                                                                      new SqlParameter("StepList", DB.SafeSQL(obj.StepList)),
                                                                      new SqlParameter("SoloIDList", DB.SafeSQL(obj.SoloIDList)),
                                                                      new SqlParameter("UserName", DB.SafeSQL(obj.UserName)),
                                                                      new SqlParameter("SessionKey", DB.SafeSQL(obj.SessionKey)),
                                                                      errorCode).FirstOrDefault <ResponeDTO>();
            result.StatusCode = int.Parse(errorCode.Value.ToString(), 0);
            result.SetContentMsg();
            return(result);
        }