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); }
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); }