public static void DbCreate(BusPar entity) { var dbe = new Model1(); dbe.BusPars.Add(entity); dbe.SaveChanges(); }
public static void BusParDelete(BusPar entity) { using (var dbe = new Model1()) { dbe.BusPars.Attach(entity); dbe.BusPars.Remove(entity); dbe.SaveChanges(); } }
public static void BusParUpdate(BusPar entity) { using (var dbe = new Model1()) { dbe.BusPars.Attach(entity); dbe.Entry(entity).State = EntityState.Modified; dbe.SaveChanges(); } }
public static DAL.BusPar ConvertToBusPar(BusParViewModel bus) { DAL.BusPar b = new DAL.BusPar { ID = bus.ID, Code = bus.Code, Name = bus.Name, Comment = bus.Comment, ValueType = bus.ValueType }; return(b); }