public ActionResult DeleteConfirmed(int id) { tbProfit tbProfit = db.tbProfit.Find(id); db.tbProfit.Remove(tbProfit); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
// 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)); }
// 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)); }