// GET: Breed/Create public ActionResult Create() { try { BreedBLL data = new BreedBLL(); return(View(data)); }catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }
public ActionResult Edit(int id, BreedBLL edit) { try { using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL()) ctx.BreedUpdateJust(id, edit.BreedName); // TODO: Add update logic here return(RedirectToAction("Index")); } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }
// GET: Breed/Details/5 public ActionResult Details(int id) { try { BreedBLL it = null; using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL()) { it = ctx.BreedFindByID(id); } return(View(it)); }catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }
public ActionResult Create(BreedBLL breed) { try { // TODO: Add insert logic here using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL()) { ctx.BreedCreate(breed.BreedName); } return(RedirectToAction("Index")); } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }
public ActionResult Delete(int id, BreedBLL delete) { try { // TODO: Add delete logic here using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL()) { ctx.BreedDelete(id); } return(RedirectToAction("Index")); } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error")); } }