Esempio n. 1
0
 // GET: Breed/Create
 public ActionResult Create()
 {
     try
     {
         BreedBLL data = new BreedBLL();
         return(View(data));
     }catch (Exception ex)
     {
         Logger.Logger.Log(ex);
         return(View("Error"));
     }
 }
Esempio n. 2
0
        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"));
            }
        }
Esempio n. 3
0
 // 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"));
     }
 }
Esempio n. 4
0
 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"));
     }
 }
Esempio n. 5
0
        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"));
            }
        }