public ActionResult Create([Bind(Include = "Created_By,Date,CustomerName,Date,NetWt,TotalRolls,PLNo,DCNO,InvoiceNo")] JobWork jobWork) { if (ModelState.IsValid) { db.JobWorks.Add(jobWork); var customers = TempData["PakingList"]; ProductionCard productionCard = new ProductionCard(); productionCard.Created_By = jobWork.Created_By; // productionCard.BagSize = jobWork.PackingList.BagSize; //productionCard.Colour = jobWork.Colour; productionCard.Date = jobWork.Date; productionCard.DCNO = jobWork.DCNO; //productionCard.Gsm = jobWork.Gsm; // productionCard.Kgs = jobWork.NetWt; productionCard.partyName = jobWork.CustomerName; productionCard.PLNo = jobWork.PLNo; //productionCard.Remarks = jobWork.Remarks; // productionCard.Rsize = jobWork.Rsize; // productionCard.status = jobWork.RollStatus; // productionCard.Type = jobWork.Type; productionCard.JobWorkId = jobWork.JobWorkId; db.ProductionCards.Add(productionCard); List <PackingList> x = customers as List <PackingList>; foreach (var z in x) { z.JobWorkId = jobWork.JobWorkId; db.PackingLists.Add(z); } db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobWork)); }
public ActionResult Create([Bind(Include = "deliveryId,partyName,productionId,deliveryStatus")] Delivery delivery) { if (ModelState.IsValid) { db.Deliveries.Add(delivery); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.productionId = new SelectList(db.ProductionCards, "productionId", "Rsize", delivery.productionId); return(View(delivery)); }
public ActionResult Edit(ProductionCard production, int id) { try { // TODO: Add update logic here if (ModelState.IsValid) { db.Entry(production).State = System.Data.Entity.EntityState.Modified; //db.ProductionCards.Add(productionCard); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(production)); } catch (Exception ex) { return(View()); } }
public ActionResult Create([Bind(Include = "Id,S_No,Item,Roll_No,Colour,Gsm,Width,Output,NetWt,Remarks")] PackingList packingList) { if (ModelState.IsValid) { db.PackingLists.Add(packingList); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(packingList)); }