public ActionResult add2Test(int?id) { count += 1; ViewBag.ID = id; Assays assays = db.Assays.Find(id); Work_Order_Assays theTest = new Work_Order_Assays(); theTest.Work_Order_ID = workOrderId; theTest.Assay_ID = assays.Assay_ID; theTest.Assay_Cost = assays.Base_Price + assays.Employee_Cost * assays.Assay_Duration; db.Work_Order_Assays.Add(theTest); db.SaveChanges(); SortingworkOrders sortDB = new SortingworkOrders(); sortDB.Assay_Cost = theTest.Assay_Cost; sortDB.Assay_ID = theTest.Assay_ID; sortDB.Work_Order_ID = workOrderId; sortDB.Date_Due = Convert.ToDateTime("01/01/1901"); // get from query from thingy sortDB.order = count; sortDB.Work_Order_Assay_ID = theTest.Work_Order_Assay_ID; db.SortingWorkOrders.Add(sortDB); db.SaveChanges(); return(RedirectToAction("Index", new { id = workOrderId })); }
public ActionResult DeleteConfirmed(int id) { SortingworkOrders sortingworkOrders = db.SortingWorkOrders.Find(id); db.SortingWorkOrders.Remove(sortingworkOrders); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Database_Number,order,Work_Order_Assay_ID,Work_Order_ID,Assay_Cost,Assay_ID,Date_Due")] SortingworkOrders sortingworkOrders) { if (ModelState.IsValid) { db.Entry(sortingworkOrders).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sortingworkOrders)); }
public ActionResult Create([Bind(Include = "Database_Number,order,Work_Order_Assay_ID,Work_Order_ID,Assay_Cost,Assay_ID,Date_Due")] SortingworkOrders sortingworkOrders) { if (ModelState.IsValid) { db.SortingWorkOrders.Add(sortingworkOrders); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sortingworkOrders)); }
// GET: SortingworkOrders/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SortingworkOrders sortingworkOrders = db.SortingWorkOrders.Find(id); if (sortingworkOrders == null) { return(HttpNotFound()); } return(View(sortingworkOrders)); }