Beispiel #1
0
 public void AddEmployee(tbl_employee emp)
 {
     using (var dbCtx = new ValtechDBEntities())
     {
         dbCtx.tbl_employee.Add(emp);
         dbCtx.SaveChanges();
     }
 }
Beispiel #2
0
 public void UpdateEmp(tbl_employee emp)
 {
     using (var dbCtx = new ValtechDBEntities())
     {
         var record = dbCtx.tbl_employee
                      .Where(o => o.Ecode == emp.Ecode)
                      .SingleOrDefault();
         //delete record
         record.salary = emp.salary;
         dbCtx.SaveChanges();
     }
 }