public ActionResult DeleteConfirmed(int id)
        {
            OrderInModel orderInModel = db.OrderInModels.Find(id);

            db.OrderInModels.Remove(orderInModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,GoodId,DateOpen,ConterpartyId,Prise,Count,Summ")] OrderInModel orderInModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(orderInModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ConterpartyId = new SelectList(db.Conterparties, "Id", "Name", orderInModel.ConterpartyId);
     ViewBag.GoodId        = new SelectList(db.GoodModels, "Id", "Name", orderInModel.GoodId);
     return(View(orderInModel));
 }
        // GET: OrderIn/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OrderInModel orderInModel = db.OrderInModels.Find(id);

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

            if (orderInModel == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ConterpartyId = new SelectList(db.Conterparties, "Id", "Name", orderInModel.ConterpartyId);
            ViewBag.GoodId        = new SelectList(db.GoodModels, "Id", "Name", orderInModel.GoodId);
            return(View(orderInModel));
        }