public ActionResult SaveDeals(SA_Deals UserDeals) { 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); UserDeals.DealsImg = fileName; } } UserDeals.CreatedTime = DateTime.Now; DealsDataStore Obj = new DealsDataStore(); if (UserDeals.id == 0) { Obj.AddDeals(UserDeals); } else { Obj.EditDeals(UserDeals); } return(RedirectToAction("Deals")); }
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 JsonResult DealsList() { DealsDataStore Obj = new DealsDataStore(); List <SA_Deals> DealsList = Obj.GetDealsListAdmin(); return(Json(new { data = DealsList }, JsonRequestBehavior.AllowGet)); }
public ActionResult Deals() { DealsDataStore Obj = new DealsDataStore(); //List<SA_Deals> DealsList = Obj.GetDealsList(); return(View("Deals")); }
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 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 ActionResult UpdateDealStatus(int dealId) { DealsDataStore Obj = new DealsDataStore(); Obj.UpdateDealStatus(dealId); return(RedirectToAction("GetDealsList")); }
public ActionResult SaveDeals(SA_Deals UserDeals) { 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); UserDeals.DealsImg = fileName; } } UserDeals.status = 1; UserDeals.CreatedBy = Session["User"].ToString(); UserDeals.CreatedTime = UserDeals.CreatedTime != null? UserDeals.CreatedTime.Value: DateTime.Now; DealsDataStore Obj = new DealsDataStore(); if (UserDeals.id == 0) { Obj.AddDeals(UserDeals); string np = Request.Form["allProduct"].ToString(); foreach (string s in np.Split(',')) { if (s != "") { Obj.AddDealsProduct(new SA_DealsAndProductRelation { SA_DealID = UserDeals.id, SA_ProductId = Convert.ToInt16(s) }); } } } else { Obj.EditDeals(UserDeals); string np = Request.Form["allProduct"].ToString(); Obj.DeleteDealsProduct(UserDeals.id); foreach (string s in np.Split(',')) { if (s != "") { Obj.AddDealsProduct(new SA_DealsAndProductRelation { SA_DealID = UserDeals.id, SA_ProductId = Convert.ToInt16(s) }); } } } return(RedirectToAction("Deals")); }
public ActionResult AddDeals() { DealsDataStore ObjDal = new DealsDataStore(); SA_DealsViewModel objCatViewModel = new SA_DealsViewModel(); objCatViewModel.ProductList = ObjDal.GetProductList(); return(View("add-Deals", objCatViewModel)); }
public ActionResult AddDeals() { ViewBag.DealProducts = new List <SA_DealsAndProductRelation>(); DealsDataStore ObjDal = new DealsDataStore(); SA_DealsViewModel objCatViewModel = new SA_DealsViewModel(); objCatViewModel.ProductList = ObjDal.GetProductList(); return(View("add-Deals", 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 DeleteDeals(int id) { DealsDataStore Obj = new DealsDataStore(); if (Obj.DeleteDeals(id) == true) { return(RedirectToAction("Deals")); } else { return(View("ErrorEventArgs")); } }
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 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 EditDeals(int id) { DealsDataStore Obj = new DealsDataStore(); SA_Deals obj = Obj.GetDealsByid(id); List <SelectListItem> productList = Obj.GetProductList(); SA_DealsViewModel objSaCatV = new SA_DealsViewModel(); objSaCatV.id = obj.id; objSaCatV.DealsName = obj.DealsName; objSaCatV.DealsDiscription = obj.DealsDiscription; objSaCatV.URL = obj.URL; objSaCatV.MetaDiscription = obj.MetaDiscription; objSaCatV.Keywords = obj.Keywords; objSaCatV.ProductList = productList; objSaCatV.Product = obj.Product.ToString(); return(View("add-Deals", 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)); }