public SiteConfigDTO()
 {
     AppConfig   = new BasicSiteConfigDTO();
     LandingPage = new LandingPageWithItemsDTO();
     AboutPage   = new AboutPageDTO();
     ContactPage = new ContactPageDTO();
 }
Beispiel #2
0
        public ContactPageDTO UpdateContactPage(ContactPageDTO newPage)
        {
            try
            {
                string query = @"
                UPDATE p
                SET p.PageTitle = @PageTitle
                ,p.PageDescription = @PageDescription
                ,p.PageRoute = @PageRoute 
                ,p.IsHTML = @IsHTML
                FROM PageInfo p
                INNER JOIN PageTypes pt on pt.PageTypeID = p.PageTypeID
                WHERE pt.PageType = 'Contact'";

                var queryParameters = new DynamicParameters();
                queryParameters.Add("@PageTitle", newPage.PageTitle);
                queryParameters.Add("@PageDescription", newPage.PageDescription);
                queryParameters.Add("@PageRoute", newPage.PageRoute);
                queryParameters.Add("@IsHTML", newPage.IsHTML);

                return((Connection.Execute(query, queryParameters, CurrentTrans) > 0) ? GetContactPage() : throw noRecordEX);
            }
            catch (Exception ex)
            {
                throw SqlExceptionHandler.HandleSqlException(ex) ?? ex;
            }
        }
 public ContactPageDTO UpdateContactPage(ContactPageDTO newPage)
 {
     try
     {
         var returnModel = UOW.ContentRepo.UpdateContactPage(newPage);
         UOW.SaveChanges();
         return(returnModel);
     }
     catch (Exception ex)
     {
         UOW.RollbackChanges();
         throw ex;
     }
 }
 public ActionResult <ContactPageDTO> UpdateContactPage([FromBody] ContactPageDTO newPage)
 {
     try { return(_contentManager.UpdateContactPage(newPage)); }
     catch (BaseCustomException ex) { return(BadRequest(ex.Message)); }
 }
Beispiel #5
0
 public ContactPageDTO UpdateContactPage(ContactPageDTO newPage)
 {
     return(_contentService.UpdateContactPage(newPage));
 }