Esempio n. 1
0
        public ActionResult Edit([Bind(Include = "BoatID, BoatTypeID,Name,Hours,ModelYear,PurchaseDate,BoatStatusID,DockSlipID,Color,Active")] Boat newBoat)
        {
            if (ModelState.IsValid)
            {
                var oldBoat = _boatManager.RetrieveActiveBoats().Find(b => b.BoatID == newBoat.BoatID);
                try
                {
                    if (_boatManager.UpdateBoat(oldBoat, newBoat))
                    {
                        return(RedirectToAction("Index"));
                    }
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
            }

            return(View(newBoat));
        }
Esempio n. 2
0
 public string UpdateBoat(int ID, string RegistrationNumber, string Manufacturer, int ModelYear, int Length)
 {
     return(BoatManager.UpdateBoat(ID, RegistrationNumber, Manufacturer, ModelYear, Length));
 }