public void AddEmployee(Employee emp)
 {
     using (var context = new SampleDB1Entities())
     {
         context.Employees.Add(emp);
         context.SaveChanges();
     }
 }
 public void UpdateEmpolyee(Employee emp)
 {
     using (var context = new SampleDB1Entities())
     {
         var employee = context.Employees.FirstOrDefault(x => x.Id == emp.Id);
         employee.Name = emp.Name;
         employee.Salary = emp.Salary;
         employee.Location = emp.Location;
         employee.MobileNo = emp.MobileNo;
         employee.DepartId = emp.DepartId;
         context.SaveChanges();
     }
 }