Пример #1
0
        public ActionResult Create()
        {
            var model = new DeliveryModel();

            model.Markets   = MarketContainer.GetMarkets();
            model.Suppliers = SupplierContainer.GetSuppliers();

            return(View(model));
        }
Пример #2
0
        public ActionResult Index()
        {
            var markets   = MarketContainer.GetMarkets();
            var suppliers = SupplierContainer.GetSuppliers();
            var delivery  = DeliveryContainer.GetDeliveries();

            foreach (var del in delivery)
            {
                del.SupplierName = suppliers.FirstOrDefault(x => x.ID == del.FurnizorID).Nume;
                del.MarketName   = markets.FirstOrDefault(x => x.ID == del.MagazinID).Denumire;
            }

            return(View(delivery));
        }
Пример #3
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var model = new DeliveryModel();

            model.Delivery  = DeliveryContainer.getDeliveryById((int)id);
            model.Markets   = MarketContainer.GetMarkets();
            model.Suppliers = SupplierContainer.GetSuppliers();

            return(View(model));
        }
Пример #4
0
        public ActionResult Edit(Delivery delivery)
        {
            if (ModelState.IsValid && DeliveriesController.validateStatus((int)Session["role"], delivery.Status))
            {
                DeliveryContainer.SaveDelivery(delivery);
                return(RedirectToAction("Index"));
            }

            var model = new DeliveryModel();

            model.Delivery  = delivery;
            model.Suppliers = SupplierContainer.GetSuppliers();
            model.Markets   = MarketContainer.GetMarkets();
            return(View(model));
        }
Пример #5
0
        public ActionResult Create(Delivery delivery)
        {
            if (ModelState.IsValid)
            {
                delivery.Status         = delivery.Status != null ? delivery.Status : "Initiata";
                delivery.DataSolicitare = DateTime.Now;
                DeliveryContainer.SaveDelivery(delivery);
                return(RedirectToAction("Index"));
            }
            var model = new DeliveryModel();

            model.Delivery  = delivery;
            model.Suppliers = SupplierContainer.GetSuppliers();
            model.Markets   = MarketContainer.GetMarkets();
            return(View(model));
        }
Пример #6
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var model = new DeliveryModel();

            model.Delivery = DeliveryContainer.getDeliveryById((int)id);
            if ((int)Session["role"] != 3)
            {
                model.Statuses.Remove("Refuzata");
            }
            model.Markets   = MarketContainer.GetMarkets();
            model.Suppliers = SupplierContainer.GetSuppliers();

            return(View(model));
        }
Пример #7
0
        // GET: Suppliers
        public ActionResult Index()
        {
            var suppliers = SupplierContainer.GetSuppliers();

            return(View(suppliers));
        }