示例#1
0
        public ActionResult EditDateSale()
        {
            if (Login.loggedinUser.Admin == "niet")
            {
                return(RedirectToAction("SpecialeActie"));
            }
            string date  = DataProduct.GetDate();
            Datum  datum = new Datum(date);

            return(View("EditDateSale", datum));
        }
示例#2
0
        public ActionResult Bestellen()
        {
            if (Login.loggedinUser.winkelwagenlist == null)
            {
                return(RedirectToAction("Winkelwagen"));
            }
            else
            {
                Bestelling     b;
                int            productcount = 0;
                bool           countis3     = false;
                List <Product> plist        = DataProduct.SpecialeActie(DataProduct.GetDate());
                foreach (Product p in plist)
                {
                    for (int i = 0; i < Login.loggedinUser.winkelwagenlist.Count; i++)
                    {
                        if (p.ProductID == Login.loggedinUser.winkelwagenlist[i].ProductID)
                        {
                            productcount += 1;
                            if (productcount == 3)
                            {
                                countis3 = true;
                            }
                        }
                        else
                        {
                            countis3 = false;
                        }
                    }
                }

                if (countis3)
                {
                    b = new Bestelling(DataBestelling.GetLatestBestelnummer() + 1, Login.loggedinUser.KlantID, 10, 10, "1", DateTime.Now);
                }
                else
                {
                    b = new Bestelling(DataBestelling.GetLatestBestelnummer() + 1, Login.loggedinUser.KlantID, 10, 0, "1", DateTime.Now);
                }

                if (DataBestelling.SetBestellingWithProcedure(Login.loggedinUser.winkelwagenlist, b))
                {
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    return(RedirectToAction("Winkelwagen"));
                }
            }
        }
示例#3
0
        public ActionResult SpecialeActie()
        {
            List <Product> specialactieproductlist = DataProduct.SpecialeActie(DataProduct.GetDate());

            return(View(specialactieproductlist));
        }