public void Update(ContectTable obj) { using (ContectEntities db = new ContectEntities()) { db.ContectTables.Attach(obj); db.Entry(obj).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public ContectTable Insert(ContectTable obj) { using (ContectEntities db = new ContectEntities()) { db.ContectTables.Add(obj); db.SaveChanges(); return(obj); } }
public void Delete(ContectTable obj) { using (ContectEntities db = new ContectEntities()) { db.ContectTables.Attach(obj); db.ContectTables.Remove(obj); db.SaveChanges(); } }
public AddForm(ContectTable obj) { InitializeComponent(); if (obj == null) { contectTableBindingSource.DataSource = new ContectTable(); IsNew = true; } else { contectTableBindingSource.DataSource = obj; IsNew = false; } }
public static void Delete(ContectTable obj) { repository.Delete(obj); }
public static void Update(ContectTable obj) { repository.Update(obj); }
public static ContectTable Insert(ContectTable obj) { return(repository.Insert(obj)); }