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