コード例 #1
0
 public static bool Modificar(Trips vi)
 {
     try
     {
         using (EgeoEntities db = new EgeoEntities())
         {
             db.Entry(vi).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
コード例 #2
0
 public static bool DeleteByID(int Vid)
 {
     try
     {
         using (EgeoEntities db = new EgeoEntities())
         {
             Trips borrar = db.Trips.Where(v => v.id == Vid).Single();
             db.Trips.Remove(borrar);
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
コード例 #3
0
        public static bool Nuevo(Trips vi)
        {
            try
            {
                using (EgeoEntities db = new EgeoEntities())
                {
                    db.Trips.Add(vi);
                    db.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }