public HomeLayoutDTO GetLayoutData() { HomeLayoutDTO dto = new HomeLayoutDTO(); dto.Categories = categoryDAO.GetCategoryList(); List <SocialMediaDTO> socialList = new List <SocialMediaDTO>(); socialList = socialDAO.GetSocialMediaData(); dto.Facebook = socialList.First(x => x.Link.Contains("facebook")); dto.Twitter = socialList.First(x => x.Link.Contains("twitter")); dto.Instagram = socialList.First(x => x.Link.Contains("instagram")); dto.YouTube = socialList.First(x => x.Link.Contains("youtube")); dto.LinkedIn = socialList.First(x => x.Link.Contains("linkedin")); FavDTO favDTO = new FavDTO(); dto.Fav = favDAO.GetFav(); List <MetaDTO> metaList = new List <MetaDTO>(); dto.MetaList = metaDAO.GetMetaData(); List <AddressDTO> addressList = addressDAO.GetAddresses(); dto.Address = addressList.First(); dto.hotNews = postDAO.GetHotNews(); return(dto); }
public ActionResult ContactUs(GeneralDTO model) { if (model.Name != null && model.Subject != null && model.Email != null && model.Message != null) { if (contactbll.AddContact(model)) { ViewData["CommentState"] = "Success"; } else { ViewData["CommentState"] = "Error"; } } else { ViewData["CommentState"] = "Error"; } HomeLayoutDTO layoutdto = new HomeLayoutDTO(); layoutdto = layoutbll.GetLayoutData(); ViewData["LayoutDTO"] = layoutdto; GeneralDTO dto = new GeneralDTO(); dto = bll.GetContactPageItems(); return(View(dto)); }
public ActionResult PostDetail(GeneralDTO model) { if (model.Name != null && model.Email != null && model.Message != null) { if (postbll.AddComment(model)) { ViewData["CommentState"] = "Success"; ModelState.Clear(); } else { ViewData["CommentState"] = "Error"; } } else { ViewData["CommentState"] = "Error"; } HomeLayoutDTO layoutdto = new HomeLayoutDTO(); layoutdto = layoutbll.GetLayoutData(); ViewData["LayoutDTO"] = layoutdto; GeneralDTO dto = new GeneralDTO(); model = bll.GetPostDetailPageItemsWithID(model.PostID); return(View(model)); }
public ActionResult ContactUs() { HomeLayoutDTO layoutdto = new HomeLayoutDTO(); layoutdto = layoutbll.GetLayoutData(); ViewData["LayoutDTO"] = layoutdto; GeneralDTO dto = new GeneralDTO(); dto = bll.GetContactPageItems(); return(View(dto)); }
public ActionResult PostDetail(int ID) { HomeLayoutDTO layoutdto = new HomeLayoutDTO(); layoutdto = layoutbll.GetLayoutData(); ViewData["LayoutDTO"] = layoutdto; GeneralDTO dto = new GeneralDTO(); dto = bll.GetPostDetailPageItemsWithID(ID); return(View(dto)); }
public ActionResult CategoryPostList(string CategoryName) { HomeLayoutDTO layoutdto = new HomeLayoutDTO(); layoutdto = layoutbll.GetLayoutData(); ViewData["LayoutDTO"] = layoutdto; GeneralDTO dto = new GeneralDTO(); dto = bll.GetCategoryPostList(CategoryName); return(View(dto)); }
public ActionResult Index() { HomeLayoutDTO layoutdto = new HomeLayoutDTO(); layoutdto = layoutbll.GetLayoutData(); ViewData["LayoutDTO"] = layoutdto; GeneralDTO dto = new GeneralDTO(); dto = bll.GetAllPosts(); return(View(dto)); }
public ActionResult Search(GeneralDTO model) { HomeLayoutDTO layoutdto = new HomeLayoutDTO(); layoutdto = layoutbll.GetLayoutData(); ViewData["LayoutDTO"] = layoutdto; GeneralDTO dto = new GeneralDTO(); dto = bll.GetSearchPosts(model.SearchText); return(View(dto)); }
public ActionResult PostDetail(int ID) { HomeLayoutDTO layoutDTO = new HomeLayoutDTO(); layoutDTO = layoutBLL.GetLayoutData(); ViewData["LayoutDTO"] = layoutDTO; GeneralDTO generalDTO = new GeneralDTO(); generalDTO = generalBLL.GetPostDetailPageItemsWithID(ID); return(View(generalDTO)); }
// GET: Home public ActionResult Index() { HomeLayoutDTO layoutDTO = new HomeLayoutDTO(); layoutDTO = layoutBLL.GetLayoutData(); ViewData["LayoutDTO"] = layoutDTO; GeneralDTO generalDTO = new GeneralDTO(); generalDTO = generalBLL.GetAllPosts(); return(View(generalDTO)); }
public ActionResult CategoryPostList(string categoryName) { HomeLayoutDTO layoutDTO = new HomeLayoutDTO(); layoutDTO = layoutBLL.GetLayoutData(); ViewData["LayoutDTO"] = layoutDTO; GeneralDTO dto = new GeneralDTO(); dto = generalBLL.GetCategoryPostList(categoryName); return(View(dto)); }
public HomeLayoutDTO GetLayoutData() { HomeLayoutDTO dto = new HomeLayoutDTO(); dto.Categories = categorydao.GetCategories(); List <SocialMediaDTO> socialmedialist = new List <SocialMediaDTO>(); socialmedialist = socialdao.GetSocialMedias(); dto.Facebook = socialmedialist.First(x => x.Link.Contains("facebook")); dto.Twitter = socialmedialist.First(x => x.Link.Contains("twitter")); dto.Instagram = socialmedialist.First(x => x.Link.Contains("instagram")); dto.Youtube = socialmedialist.First(x => x.Link.Contains("youtube")); dto.Linkedin = socialmedialist.First(x => x.Link.Contains("linkedin")); dto.FavDTO = favdao.GetFav(); dto.Metalist = metadao.GetMetaData(); List <AddressDTO> addresslist = addressdao.GetAddresses(); dto.Address = addresslist.First(); dto.HotNews = postdao.GetHotNews(); return(dto); }