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

                dbCtx.tbl_employee.Remove(record);
                dbCtx.SaveChanges();
            }
        }
Exemplo n.º 3
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();
            }
        }