public ActionResult DeleteConfirmed(int id)
        {
            IncidentalContractItem incidentalContractItem = db.IncidentalContractItems.Find(id);

            db.IncidentalContractItems.Remove(incidentalContractItem);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "IncidentalContractItemId,IncidentalContractItemDescription,IncidentalContractItemValue,IncidentalContractItemQuantity,IncidentalContractItemVat,ProductIncomeCode,ProductIncomeCodeId,ProductExpenseCode,ProductExpenseCodeId,BudgetCodeId,OwnerBudgetId,IncidentalContractId")] IncidentalContractItem incidentalContractItem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(incidentalContractItem).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IncidentalContractId = new SelectList(db.IncidentalContracts, "IncidentalContractId", "ContractTitle", incidentalContractItem.IncidentalContractId);
     ViewBag.OwnerBudgetId        = new SelectList(db.Budgets, "BudgetId", "BudgetName", incidentalContractItem.OwnerBudgetId);
     ViewBag.ProductExpenseCodeId = new SelectList(db.ProductCodes, "ProductCodeId", "ProductCodeNumber", incidentalContractItem.ProductExpenseCodeId);
     ViewBag.ProductIncomeCodeId  = new SelectList(db.ProductCodes, "ProductCodeId", "ProductCodeNumber", incidentalContractItem.ProductIncomeCodeId);
     return(View(incidentalContractItem));
 }
        // GET: IncidentalContractItems/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IncidentalContractItem incidentalContractItem = db.IncidentalContractItems.Find(id);

            if (incidentalContractItem == null)
            {
                return(HttpNotFound());
            }
            return(View(incidentalContractItem));
        }
        // GET: IncidentalContractItems/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IncidentalContractItem incidentalContractItem = db.IncidentalContractItems.Find(id);

            if (incidentalContractItem == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IncidentalContractId = new SelectList(db.IncidentalContracts, "IncidentalContractId", "ContractTitle", incidentalContractItem.IncidentalContractId);
            ViewBag.OwnerBudgetId        = new SelectList(db.Budgets, "BudgetId", "BudgetName", incidentalContractItem.OwnerBudgetId);
            ViewBag.ProductExpenseCodeId = new SelectList(db.ProductCodes, "ProductCodeId", "ProductCodeNumber", incidentalContractItem.ProductExpenseCodeId);
            ViewBag.ProductIncomeCodeId  = new SelectList(db.ProductCodes, "ProductCodeId", "ProductCodeNumber", incidentalContractItem.ProductIncomeCodeId);
            return(View(incidentalContractItem));
        }