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

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

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

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