Exemplo n.º 1
0
        // POST: SupplierPoDtls/Remove/SupPOItemId=1
        public ActionResult Remove(int SupPOItemId)
        {
            SupplierPoItem supPOItem = db.SupplierPoItems.Find(SupPOItemId);

            db.SupplierPoItems.Remove(supPOItem);
            db.SaveChanges();

            var sup = db.SupplierPoDtls.Find(supPOItem.SupplierPoDtlId);

            return(RedirectToAction("Index", "SupplierPoDtls", new { hdrId = sup.SupplierPoHdrId }));
        }
Exemplo n.º 2
0
        public ActionResult AddVehicle([Bind(Include = "Id,SupplierPoDtlId,InvItemId")] SupplierPoItem supplieritem)
        {
            if (ModelState.IsValid)
            {
                db.SupplierPoItems.Add(supplieritem);
                db.SaveChanges();

                var sup = db.SupplierPoDtls.Find(supplieritem.SupplierPoDtlId);
                return(RedirectToAction("Index", "SupplierPoDtls", new { hdrId = sup.SupplierPoHdrId }));
            }

            ViewBag.SupplierPoDtlId = new SelectList(db.SupplierPoDtls, "Id", "Id", supplieritem.SupplierPoDtlId);
            ViewBag.InvItemId       = new SelectList(db.InvItems, "Id", "Description", supplieritem.InvItemId);

            return(View(supplieritem));
        }