Esempio n. 1
0
 public void AddEmployee(tbl_employee emp)
 {
     using (var dbCtx = new DXCDBEntities())
     {
         dbCtx.tbl_employee.Add(emp);
         dbCtx.SaveChanges();
     }
 }
Esempio n. 2
0
        public void UpdateEmp(tbl_employee emp)
        {
            using (var dbCtx = new  DXCDBEntities())
            {
                var record = dbCtx.tbl_employee
                             .Where(o => o.ecode == emp.ecode)
                             .SingleOrDefault();

                record.ename  = emp.ename;
                record.salary = emp.salary;
                record.deptid = emp.deptid;

                dbCtx.SaveChanges();
            }
        }