Exemplo n.º 1
0
 public SiteConfigDTO()
 {
     AppConfig   = new BasicSiteConfigDTO();
     LandingPage = new LandingPageWithItemsDTO();
     AboutPage   = new AboutPageDTO();
     ContactPage = new ContactPageDTO();
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 3
0
 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)); }
 }
Exemplo n.º 5
0
 public ContactPageDTO UpdateContactPage(ContactPageDTO newPage)
 {
     return(_contentService.UpdateContactPage(newPage));
 }