Example #1
0
        public ActionResult Create(PARENTESCO Parentesco)
        {
            if (ModelState.IsValid)
            {
                ParentescoLogic.Create(Parentesco);
                return(RedirectToAction("Index"));
            }

            return(View(Parentesco));
        }
Example #2
0
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            PARENTESCO Parentesco = ParentescoLogic.FindParentesco(id);

            if (Parentesco == null)
            {
                return(HttpNotFound());
            }
            return(View(Parentesco));
        }
 public static void EditParentesco(PARENTESCO Parentesco)
 {
     try
     {
         using (FidelEntities db = new FidelEntities())
         {
             db.Entry(Parentesco).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static bool Create(PARENTESCO Parentesco)
 {
     try
     {
         using (FidelEntities db = new FidelEntities())
         {
             db.PARENTESCO.Add(Parentesco);
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public static void DeleteParentesco(long?id)
 {
     try
     {
         using (FidelEntities db = new FidelEntities())
         {
             PARENTESCO Parentesco = FindParentesco(id);
             if (Parentesco != null)
             {
                 db.PARENTESCO.Remove(Parentesco);
                 db.SaveChanges();
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }