Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SellingsModel sellingsModel = db.Sellings.Find(id);

            db.Sellings.Remove(sellingsModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,StoreId,SellTime,ConterpatryId,Cash,NonCash,Summ,CurrencyId,Comments")] SellingsModel sellingsModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sellingsModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CurrencyId = new SelectList(db.Currency, "Id", "Name", sellingsModel.CurrencyId);
     return(View(sellingsModel));
 }
Пример #3
0
        // GET: Sellings/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SellingsModel sellingsModel = db.Sellings.Find(id);

            if (sellingsModel == null)
            {
                return(HttpNotFound());
            }
            return(View(sellingsModel));
        }
Пример #4
0
        // GET: Sellings/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SellingsModel sellingsModel = db.Sellings.Find(id);

            if (sellingsModel == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CurrencyId = new SelectList(db.Currency, "Id", "Name", sellingsModel.CurrencyId);
            return(View(sellingsModel));
        }