public ActionResult DeleteConfirmed(int id) { ShipAccount shipAccount = db.ShipAccounts.Find(id); db.ShipAccounts.Remove(shipAccount); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ShipAccountId,AccountNumber,AccountBalance")] ShipAccount shipAccount) { if (ModelState.IsValid) { db.Entry(shipAccount).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(shipAccount)); }
public ActionResult Create([Bind(Include = "ShipAccountId,AccountNumber,AccountBalance")] ShipAccount shipAccount) { if (ModelState.IsValid) { db.ShipAccounts.Add(shipAccount); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(shipAccount)); }
public ActionResult EmployeeSalary(int ShipAccountId, int AccountBalance) { if (ModelState.IsValid) { ShipAccount ship = db.ShipAccounts.Find(ShipAccountId); ship.AccountBalance -= AccountBalance; db.Entry(ship).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(AccountBalance)); }
public ActionResult TicketPrice(int ShipAccountId, int AccountBalance) { if (ModelState.IsValid) { ShipAccount ship = db.ShipAccounts.Find(ShipAccountId); CargoBooking cg = db.CargoBookings.Find(AccountBalance); ship.AccountBalance += (decimal)cg.ShippingCost; db.Entry(ship).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(AccountBalance)); }
// GET: ShipAccounts/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ShipAccount shipAccount = db.ShipAccounts.Find(id); if (shipAccount == null) { return(HttpNotFound()); } return(View(shipAccount)); }
public ActionResult EmployeeSalary(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ShipAccount ship = db.ShipAccounts.Find(id); if (ship == null) { return(HttpNotFound()); } return(View(ship)); }