예제 #1
0
        public int DeleteEmp(int empid)
        {
            EmployeeEntities1 empdb  = new EmployeeEntities1();
            EmployeeDetail    empdtl = new EmployeeDetail();

            empdtl.EmpId = empid;
            empdb.Entry(empdtl).State = System.Data.Entity.EntityState.Deleted;
            int r = empdb.SaveChanges();

            return(r);
        }
예제 #2
0
        public int UpdateEmp(Employee e)
        {
            EmployeeEntities1 empdb  = new EmployeeEntities1();
            EmployeeDetail    empdtl = new EmployeeDetail();

            empdtl.EmpId              = e.empId;
            empdtl.EmpName            = e.empName;
            empdtl.EmpMail            = e.empMail;
            empdtl.EmpPhone           = e.empPhone;
            empdb.Entry(empdtl).State = System.Data.Entity.EntityState.Modified;
            int r = empdb.SaveChanges();

            return(r);
        }