Exemplo n.º 1
0
        public ActionResult Delete(int id, GeckoBLL collection)
        {
            try
            {
                using (ContextBLL ctx = new ContextBLL())
                {
                    ctx.DeleteGecko(id);

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                return(View("Error", ex));
            }
        }
Exemplo n.º 2
0
        public ActionResult Edit(int id, GeckoBLL collection)
        {
            try
            {
                using (ContextBLL ctx = new ContextBLL())
                {
                    ctx.JustUpdateGecko(id, collection.Sex, collection.Weight, collection.BreedEligability, collection.Age, collection.OwnerID);

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                return(View("Error", ex));
            }
        }
Exemplo n.º 3
0
        public ActionResult Create(GeckoBLL g)
        {
            try
            {
                using (ContextBLL ctx = new ContextBLL())
                {
                    string  id = HttpContext.User.Identity.Name;
                    UserBLL G  = ctx.FindUserByEmail(id);
                    ctx.CreateGecko(g.Sex, g.Weight, g.BreedEligability, g.Age, G.UserID);

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                return(View("Error", ex));
            }
        }
Exemplo n.º 4
0
 // GET: Gecko/Details/5
 public ActionResult Details(int id)
 {
     try
     {
         using (ContextBLL ctx = new ContextBLL())
         {
             GeckoBLL g = ctx.FindGeckoByID(id);
             if (g == null)
             {
                 return(View("ItemNotFound"));
             }
             else
             {
                 return(View(g));
             }
         }
     }
     catch (Exception ex)
     {
         return(View("Error", ex));
     }
 }
Exemplo n.º 5
0
 // GET: Gecko/Edit/5
 public ActionResult Edit(int id)
 {
     try
     {
         using (BusinessLogicLayer.ContextBLL ctx = new BusinessLogicLayer.ContextBLL())
         {
             GeckoBLL g = ctx.FindGeckoByID(id);
             {
                 if (g == null)
                 {
                     return(View("ItemNotFound"));
                 }
                 else
                 {
                     return(View(g));
                 }
             }
         }
     }
     catch (Exception ex)
     {
         return(View("Error", ex));
     }
 }