// GET: Dogs/Create public ActionResult Create() { try { DogBLL data = new DogBLL(); return(View(data)); } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }
public ActionResult Edit(int id, DogBLL edit) { try { // TODO: Add update logic here using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL()) ctx.DogUpdateJust(id, edit.Name, edit.IsSmallBreed, edit.IsDogHairless, edit.Medical, edit.AdoptDate, edit.SurrenderDate); return(RedirectToAction("Index")); } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }
public ActionResult Create(DogBLL dog) { try { // TODO: Add insert logic here using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL()) { ctx.DogCreate(dog.Name, dog.BreedID, dog.IsSmallBreed, dog.IsDogHairless, dog.Medical, dog.AdoptDate, dog.SurrenderDate); } return(RedirectToAction("Index")); } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error", ex)); } }
// GET: Dogs/Details/5 public ActionResult Details(int id) { try { DogBLL it = null; using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL()) { it = ctx.DogFindByID(id); } return(View(it)); } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }
public ActionResult Delete(int id, DogBLL delete) { try { // TODO: Add delete logic here using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL()) ctx.DogDelete(id); return(RedirectToAction("Index")); } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }