public ActionResult DeleteConfirmed(int id) { StandartExpense standartExpense = db.StandartExpense.Find(id); db.StandartExpense.Remove(standartExpense); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ExpenseID,QuarterlyNormEnergyUnit,ProductionID,Year,Quarter,OrganizationID")] StandartExpense standartExpense) { if (ModelState.IsValid) { db.Entry(standartExpense).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OrganizationID = new SelectList(db.Organization, "OrganizationID", "OrganizationName", standartExpense.OrganizationID); ViewBag.ProductionID = new SelectList(db.TypesProduction, "ProductionID", "ProductionName", standartExpense.ProductionID); return(View(standartExpense)); }
// GET: StandartExpenses/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StandartExpense standartExpense = db.StandartExpense.Find(id); if (standartExpense == null) { return(HttpNotFound()); } return(View(standartExpense)); }
// GET: StandartExpenses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StandartExpense standartExpense = db.StandartExpense.Find(id); if (standartExpense == null) { return(HttpNotFound()); } ViewBag.OrganizationID = new SelectList(db.Organization, "OrganizationID", "OrganizationName", standartExpense.OrganizationID); ViewBag.ProductionID = new SelectList(db.TypesProduction, "ProductionID", "ProductionName", standartExpense.ProductionID); return(View(standartExpense)); }