Ejemplo n.º 1
0
 public ActionResult Create([Bind(Exclude = "Id")] AcadList alist)
 {
     if (daoacadlist.AddAcadList(alist))
     {
         return(RedirectToAction("Index", "DAOPattern"));
     }
     else
     {
         return(View("Create"));
     }
 }
Ejemplo n.º 2
0
 public ActionResult Edit(int id, AcadList al)
 {
     if ((id > 0) && (al != null) && (ModelState.IsValid))
     {
         daoacadlist.UpdateAcadList(al);
         return(RedirectToAction("ProffIndex", "DAOPattern"));
     }
     else
     {
         return(View("Edit"));
     }
 }
Ejemplo n.º 3
0
 public bool AddAcadList(AcadList aclist)
 {
     try
     {
         entities.AcadList.Add(aclist);
         entities.SaveChanges();
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 4
0
        public bool UpdateAcadList(AcadList aclist)
        {
            try
            {
                var Entity = entities.AcadList.FirstOrDefault(x => x.Id == aclist.Id);

                Entity.Counter = aclist.Counter;
                entities.SaveChanges();
            }
            catch
            {
                return(false);
            }
            return(true);
        }