Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            StandartExpense standartExpense = db.StandartExpense.Find(id);

            db.StandartExpense.Remove(standartExpense);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        // 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));
        }
Exemple #4
0
        // 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));
        }