Beispiel #1
0
 public void Update(it_log obj)
 {
     using (ittransactionlogEntities db = new ittransactionlogEntities())
     {
         db.it_log.Attach(obj);
         db.Entry(obj).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Beispiel #2
0
 public it_log Insert(it_log obj)
 {
     using (ittransactionlogEntities db = new ittransactionlogEntities())
     {
         db.it_log.Add(obj);
         db.SaveChanges();
         return(obj);
     }
 }
Beispiel #3
0
        public void Delete(int id)
        {
            using (ittransactionlogEntities db = new ittransactionlogEntities())
            {
                //using (dbemployeeEntities db = new dbemployeeEntities())
                //{
                //    db.Database.ExecuteSqlCommand("UPDATE employee_info SET lastname = 'SQLTEST' WHERE empID = 19");
                //}

                var delete = (from l in db.it_log
                              where l.it_log_id.Equals(id)
                              select l).FirstOrDefault();

                db.it_log.Attach(delete);
                db.it_log.Remove(delete);
                db.SaveChanges();
            }
        }