Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ShipAccount shipAccount = db.ShipAccounts.Find(id);

            db.ShipAccounts.Remove(shipAccount);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 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));
 }
Example #3
0
        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));
        }
Example #4
0
 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));
 }
Example #5
0
 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));
 }
Example #6
0
        // 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));
        }
Example #7
0
        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));
        }