Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbProfit tbProfit = db.tbProfit.Find(id);

            db.tbProfit.Remove(tbProfit);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "ProfitId,UserId,MethodId,Amount,Date,CurrencyId")] tbProfit tbProfit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbProfit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.tbUsers, "UserId", "FirstName", tbProfit.UserId);
     return(View(tbProfit));
 }
Esempio n. 3
0
        // GET: tbProfits/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbProfit tbProfit = db.tbProfit.Find(id);

            if (tbProfit == null)
            {
                return(HttpNotFound());
            }
            return(View(tbProfit));
        }
Esempio n. 4
0
        // GET: tbProfits/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbProfit tbProfit = db.tbProfit.Find(id);

            if (tbProfit == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserId = new SelectList(db.tbUsers, "UserId", "FirstName", tbProfit.UserId);
            return(View(tbProfit));
        }