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();
     }
 }
示例#4
0
 public AddForm(ContectTable obj)
 {
     InitializeComponent();
     if (obj == null)
     {
         contectTableBindingSource.DataSource = new ContectTable();
         IsNew = true;
     }
     else
     {
         contectTableBindingSource.DataSource = obj;
         IsNew = false;
     }
 }
示例#5
0
 public static void Delete(ContectTable obj)
 {
     repository.Delete(obj);
 }
示例#6
0
 public static void Update(ContectTable obj)
 {
     repository.Update(obj);
 }
示例#7
0
 public static ContectTable Insert(ContectTable obj)
 {
     return(repository.Insert(obj));
 }