Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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)));
        }
Пример #4
0
        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(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 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)));
        }
Пример #7
0
        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.f        = n.GetFirstProduct();
            ViewBag.category = p.ProductList();
            return(View(model));
        }