Beispiel #1
0
 public async Task <ActionResult> Create(ShipView vShip)
 {
     if (ModelState.IsValid)
     {
         VShipRepository repo = new VShipRepository();
         return(RedirectToAction("Index"));
     }
     return(View(vShip));
 }
Beispiel #2
0
        public ActionResult Create()
        {
            VShipRepository repo = new VShipRepository();

            ViewBag.cust = Menu.Cust;
            ShipView vShip = repo.GetCreate(Menu.CustId);

            return(View(vShip));
        }
Beispiel #3
0
        public async Task <ActionResult> Edit(int id)
        {
            VShipRepository repo  = new VShipRepository();
            ShipView        vShip = repo.GetChange(id);

            Session["Detal"] = vShip.Detal;
            if (vShip == null)
            {
                return(HttpNotFound());
            }
            return(View(vShip));
        }
Beispiel #4
0
        public ActionResult Good(ShipOrderDetailView svd)
        {
            svd.ShipOrderDetailViewId = (int)Session["id"];
            List <ShipOrderDetailView> detal = (List <ShipOrderDetailView>)Session["Detal"];
            int ShipOrderId = 0;

            foreach (var o in detal)
            {
                ShipOrderId = o.ShipOrderId;
            }
            VShipRepository repo = new VShipRepository();

            repo.SaveDetail(ShipOrderId, svd);
            //db.SaveChanges();
            return(RedirectToAction("Edit", "VShips", new { id = ShipOrderId }));
        }
Beispiel #5
0
        public async Task <ActionResult> Edit(ShipView vShip, string Adres, string Person)
        {
            List <ShipOrderDetailView> detal = (List <ShipOrderDetailView>)Session["Detal"];
            VShipRepository            repo  = new VShipRepository();

            Session["Order"] = vShip;
            repo.Save(vShip, detal);
            if (Adres == "Новый")
            {
                return(RedirectToAction("NewAdres"));
            }
            if (Person == "Новый")
            {
                return(RedirectToAction("NewPerson"));
            }

            return(RedirectToAction("Index"));
        }