public ActionResult ProductList(string id, string search) { NewsDataStore Obj = new NewsDataStore(); DealsDataStore d = new DealsDataStore(); ProductListViewModel model = new ProductListViewModel(); List <SA_News> NewsList = Obj.GetNewsList(); model.NewsList = NewsList; List <SA_Deals> DealList = d.GetDealsList(); model.DealsList = DealList; ProductDataStore p = new ProductDataStore(); IQueryable <SA_Product> ProductList = p.GetProductListBySearch(id, search); model.ProductList = ProductList; CategoryDataStore c = new CategoryDataStore(); if (id != "") { var categoryName = c.GetCategoryByid(Convert.ToInt32(id)); ViewBag.CategoryName = categoryName.CategoryName; } else { ViewBag.CategoryName = ""; } ViewBag.category = c.CategoryList(); return(View("~/Views/ChemAnalyst/products.cshtml", model)); }
public ActionResult SaveNews(SA_News UserNews) { for (int i = 0; i < Request.Files.Count; i++) { var file = Request.Files[i]; if (file != null && file.ContentLength > 0) { var fileName = Path.GetFileName(file.FileName); var path = Path.Combine(Server.MapPath("~/ProductImages"), fileName); file.SaveAs(path); UserNews.NewsImg = fileName; } } UserNews.CreatedTime = DateTime.Now; NewsDataStore Obj = new NewsDataStore(); if (UserNews.id == 0) { Obj.AddNews(UserNews); } else { Obj.EditNews(UserNews); } return(RedirectToAction("News")); }
public ActionResult DealsHome(int?page) { //int pageSize = 6; //DealsDataStore d = new DealsDataStore(); //var model= d.GetDealsList().ToPagedList(page ?? 1, pageSize); //return View(model); NewsDataStore nc = new NewsDataStore(); ViewBag.f = nc.GetFirstProduct(); int pageSize = 6; DealsDataStore n = new DealsDataStore(); ProductDataStore p = new ProductDataStore(); DealsHomeViewModel model = new DealsHomeViewModel(); if (Session["UserRole"] != null && Session["UserRole"].ToString().ToUpper() == "CUSTOMER") { model.DealsList = n.GetCustDealsList(Convert.ToInt32(Session["LoginUser"])).ToPagedList(page ?? 1, pageSize); } else { model.DealsList = n.GetDealsList().ToPagedList(page ?? 1, pageSize); } ViewBag.f = n.GetFirstProduct(); ViewBag.category = p.ProductList(); return(View(model)); }
public JsonResult NewsList() { NewsDataStore Obj = new NewsDataStore(); List <SA_News> NewsList = Obj.GetNewsListAdmin(); return(Json(new { data = NewsList }, JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateStatus(int newsId) { NewsDataStore Obj = new NewsDataStore(); Obj.UpdateNewsStatus(newsId); return(RedirectToAction("GetNewsList")); }
// GET: NewsAndDeals public ActionResult News() { NewsDataStore Obj = new NewsDataStore(); //List<SA_News> NewsList = Obj.GetNewsList(); return(View("News")); }
public ActionResult DealsHome(int?page, string id, DateTime?search, DateTime?searchto, string keyword) { ViewBag.formdate = search != null?Convert.ToDateTime(search).ToString("MM/dd/yyyy") : ""; ViewBag.todate = searchto != null?Convert.ToDateTime(searchto).ToString("MM/dd/yyyy") : ""; int pageSize = 6; NewsDataStore nc = new NewsDataStore(); ViewBag.f = nc.GetFirstProduct(); DealsDataStore n = new DealsDataStore(); ProductDataStore p = new ProductDataStore(); DealsHomeViewModel model = new DealsHomeViewModel(); if (Session["UserRole"] != null && Session["UserRole"].ToString().ToUpper() == "CUSTOMER") { model.DealsList = n.GetDealsBySearch(id, search, searchto, keyword).OrderByDescending(x => x.CreatedTime).ToPagedList(page ?? 1, pageSize); //model.DealsList = n.GetCustDealsList(Convert.ToInt32(Session["LoginUser"])).ToPagedList(page ?? 1, pageSize); } else { model.DealsList = n.GetDealsBySearch(id, search, searchto, keyword).OrderByDescending(x => x.CreatedTime).ToPagedList(page ?? 1, pageSize); } ViewBag.category = p.ProductList(); return(View(model)); }
public NewsViewModel(INavigation navigation, NewsDataStore newsService) { _newsDataStore = newsService; _news = new ObservableCollection <News>(); _navigation = navigation; Title = Properties.Strings.Marketnews; }
public ActionResult AddNews() { NewsDataStore ObjDal = new NewsDataStore(); SA_NewsViewModel objCatViewModel = new SA_NewsViewModel(); objCatViewModel.ProductList = ObjDal.GetProductList(); return(View("add-News", objCatViewModel)); }
public ActionResult SaveNews(SA_News UserNews) { for (int i = 0; i < Request.Files.Count; i++) { var file = Request.Files[i]; if (file != null && file.ContentLength > 0) { var fileName = Path.GetFileName(file.FileName); var path = Path.Combine(Server.MapPath("~/ProductImages"), fileName); file.SaveAs(path); UserNews.NewsImg = fileName; } } UserNews.status = 1; UserNews.CreatedBy = Session["User"].ToString(); UserNews.CreatedTime = UserNews.CreatedTime != null? UserNews.CreatedTime: DateTime.Now; NewsDataStore Obj = new NewsDataStore(); if (UserNews.id == 0) { Obj.AddNews(UserNews); string np = Request.Form["allProduct"].ToString(); foreach (string s in np.Split(',')) { if (s != "") { Obj.AddNewsProduct(new SA_NewsAndProductRelation { SA_NewsId = UserNews.id, SA_ProductId = Convert.ToInt16(s) }); } } } else { Obj.EditNews(UserNews); string np = Request.Form["allProduct"].ToString(); Obj.DeleteNewsProduct(UserNews.id); foreach (string s in np.Split(',')) { if (s != "") { Obj.AddNewsProduct(new SA_NewsAndProductRelation { SA_NewsId = UserNews.id, SA_ProductId = Convert.ToInt16(s) }); } } } return(RedirectToAction("News")); }
public ActionResult AddNews() { ViewBag.NewsProducts = new List <SA_NewsAndProductRelation>(); NewsDataStore ObjDal = new NewsDataStore(); SA_NewsViewModel objCatViewModel = new SA_NewsViewModel(); objCatViewModel.ProductList = ObjDal.GetProductList(); return(View("add-News", objCatViewModel)); }
public ActionResult DealsDetails(int id) { NewsDataStore Obj2 = new NewsDataStore(); DealsDataStore Obj = new DealsDataStore(); DealsDetailsViewModel d = new DealsDetailsViewModel(); d.Deals = Obj.GetDealsByid(id); d.NewsList = Obj2.GetNewsList(); d.DealList = Obj.GetDealsList(); return(View(d)); }
public ActionResult FreeTrail() { NewsDataStore Obj = new NewsDataStore(); DealsDataStore d = new DealsDataStore(); IndustryViewModel model = new IndustryViewModel(); List <SA_News> NewsList = Obj.GetNewsList(); model.NewsList = NewsList; List <SA_Deals> DealList = d.GetDealsList(); model.DealsList = DealList; return(View("FreeTrial", model)); }
public ActionResult DeleteNews(int id) { NewsDataStore Obj = new NewsDataStore(); if (Obj.DeleteNews(id) == true) { return(RedirectToAction("News")); } else { return(View("ErrorEventArgs")); } }
public ActionResult CompanyProfile(string category, string products, string revsize, string empsize) { CompanyDataStore Obj = new CompanyDataStore(); NewsDataStore n = new NewsDataStore(); ViewBag.f = n.GetFirstProduct(); ViewBag.Cat = category; ViewBag.Prod = products; ViewBag.RevS = revsize; ViewBag.EmpSiz = empsize; ViewBag.Product = Obj.GetCompanyProducts(); ViewBag.Category = Obj.GetUniqueCategory(); return(View("CustCompanies", Obj.GetCompanyList(category, products, revsize, empsize, DateTime.Now.Year.ToString()).OrderBy(x => x.CreatedTime))); }
public ActionResult CustCompaniesList() { CompanyDataStore Obj = new CompanyDataStore(); ViewBag.Product = Obj.GetCompanyProducts(); ViewBag.Category = Obj.GetUniqueCategory(); ViewBag.Cat = ""; ViewBag.Prod = ""; ViewBag.RevS = ""; ViewBag.EmpSiz = ""; NewsDataStore n = new NewsDataStore(); ViewBag.f = n.GetFirstProduct(); return(View("CustCompanies", Obj.GetCompanyList().OrderBy(x => x.CreatedTime))); // return View("CustCompanies"); }
public ActionResult CompanyProfile() { ViewBag.Product = Obj.GetCompanyProducts(); ViewBag.Category = Obj.GetUniqueCategory(); ViewBag.Fyear = Obj.GetUniqueFyear(); ViewBag.Cat = ""; ViewBag.Prod = ""; ViewBag.RevS = ""; ViewBag.EmpSiz = ""; ViewBag.CName = ""; ViewBag.Fy = DateTime.Now.Year; NewsDataStore n = new NewsDataStore(); ViewBag.f = n.GetFirstProduct(); return(View(Obj.GetCompanyList().OrderBy(x => x.Name))); }
public ActionResult IndustryReport(int id) { NewsDataStore n = new NewsDataStore(); DealsDataStore d = new DealsDataStore(); IndustryViewModel model = new IndustryViewModel(); List <SA_Industry> IndustryList = Obj.GetIndustryList().Where(w => w.id == id).OrderBy(w => w.id).ToList();; model.Industry = IndustryList; List <SA_News> NewsList = n.GetNewsList(); model.NewsList = NewsList; List <SA_Deals> DealList = d.GetDealsList(); model.DealsList = DealList; return(View(model)); }
public ActionResult CompanyProfile(string category, string products, string revsize, string empsize, string fyear, string companyname) { NewsDataStore n = new NewsDataStore(); ViewBag.f = n.GetFirstProduct(); ViewBag.Cat = category; ViewBag.Prod = products; ViewBag.RevS = revsize; ViewBag.EmpSiz = empsize; ViewBag.Fy = fyear; ViewBag.CName = companyname; ViewBag.Fyear = Obj.GetUniqueFyear(); ViewBag.Product = Obj.GetCompanyProducts(); ViewBag.Category = Obj.GetUniqueCategory(); return(View(Obj.GetCompaniesList(category, products, revsize, empsize, fyear, companyname).OrderBy(x => x.CreatedTime))); }
public ActionResult IndustryReports(int id) { NewsDataStore n = new NewsDataStore(); DealsDataStore d = new DealsDataStore(); IndustryViewModel model = new IndustryViewModel(); //List<SA_Industry> IndustryList = Obj.GetIndustryList(); List <SA_Industry> IndustryList = Obj.GetCustIndustryList(id); model.Industry = IndustryList; List <SA_News> NewsList = n.GetNewsList(); model.NewsList = NewsList; List <SA_Deals> DealList = d.GetDealsList(); model.DealsList = DealList; return(View(model)); }
public ActionResult NewsList() { NewsDataStore Obj = new NewsDataStore(); List <SA_News> NewsList = Obj.GetNewsList(); DealsDataStore ObjDeal = new DealsDataStore(); List <SA_Deals> DealList = ObjDeal.GetDealsList(); var news = NewsList.OrderByDescending(w => w.id).Take(3).ToList(); var deal = DealList.OrderByDescending(w => w.id).Take(3).ToList(); NewDealVM NewsDeal = new NewDealVM(); NewsDeal.lstNews = news; NewsDeal.lstDeals = deal; return(PartialView("~/Views/PartialView/NewPartialView.cshtml", NewsDeal)); }
public ActionResult EditNews(int id) { NewsDataStore Obj = new NewsDataStore(); SA_News obj = Obj.GetNewsByid(id); List <SelectListItem> productList = Obj.GetProductList(); SA_NewsViewModel objSaCatV = new SA_NewsViewModel(); objSaCatV.id = obj.id; objSaCatV.NewsName = obj.NewsName; objSaCatV.NewsDiscription = obj.NewsDiscription; objSaCatV.URL = obj.URL; objSaCatV.MetaDiscription = obj.MetaDiscription; objSaCatV.Keywords = obj.Keywords; objSaCatV.ProductList = productList; objSaCatV.Product = obj.Product.ToString(); return(View("add-News", objSaCatV)); }
public ActionResult ProductList() { NewsDataStore Obj = new NewsDataStore(); DealsDataStore d = new DealsDataStore(); ProductListViewModel model = new ProductListViewModel(); List <SA_News> NewsList = Obj.GetNewsList(); model.NewsList = NewsList; List <SA_Deals> DealList = d.GetDealsList(); model.DealsList = DealList; ProductDataStore p = new ProductDataStore(); List <SA_Product> ProductList = p.GetProductList(); model.ProductList = ProductList; CategoryDataStore c = new CategoryDataStore(); ViewBag.category = c.CategoryList(); return(View("~/Views/ChemAnalyst/products.cshtml", model)); }
public ActionResult NewsHome(int?page) { int pageSize = 6; NewsDataStore n = new NewsDataStore(); ProductDataStore p = new ProductDataStore(); NewsHomeViewModel model = new NewsHomeViewModel(); //ViewBag.formdate = new DateTime(DateTime.Now.Year,DateTime.Now.Month,01).ToString("MM/dd/yyyy"); //ViewBag.todate = DateTime.Now.ToString("MM/dd/yyyy"); if (Session["UserRole"] != null && Session["UserRole"].ToString().ToUpper() == "CUSTOMER") { model.NewsList = n.GetCustNewsList(Convert.ToInt32(Session["LoginUser"])).ToPagedList(page ?? 1, pageSize); } else { model.NewsList = n.GetNewsList().ToPagedList(page ?? 1, pageSize); } ViewBag.category = p.ProductList(); return(View(model)); }