public Employee AddEmployee(Employee EmpOB) { EmpOB.Id = Guid.NewGuid(); _employeeDataContext.employeeDB.Add(EmpOB); _employeeDataContext.SaveChanges(); return(EmpOB); }
public long Add(Employee employee) { _employeeDataContext.Employees.Add(employee); _employeeDataContext.SaveChanges(); return(employee.EmployeeId); }
public void AddRecord(int employeeId, List <int> selectedSkills) { foreach (var item in selectedSkills) { _employeeDataContext.EmployeeSkills.Add(new EmployeeSkill() { EmployeeId = employeeId, SkillId = item }); } _employeeDataContext.SaveChanges(); }
public int AddEmpolyee(CreateEditViewModel createEditViewModel) { createEditViewModel.Employee.FullName = createEditViewModel.Employee.FirstName + " " + createEditViewModel.Employee.MiddleName + " " + createEditViewModel.Employee.LastName; _employeeDataContext.Employees.Add(createEditViewModel.Employee); _employeeDataContext.SaveChanges(); int id = createEditViewModel.Employee.Id; return(id); }
public int Create([FromBody] Employee employee) { try { _context.Employee.Add(employee); _context.SaveChanges(); return(1); } catch { throw; } }
public ActionResult AddEmployee(Employee model) { mydbcontext = new EmployeeDataContext(); mydbcontext.Employee.Add(model); mydbcontext.SaveChanges(); return(View()); }
public ActionResult Delete(EmployeeModel EmployeeObject) { using (var EmpContext = new EmployeeDataContext()) { EmpContext.EmployeesDetails.Remove(EmployeeObject); EmpContext.SaveChanges(); } return(Ok("Query processed")); }
public ActionResult Put([FromBody] EmployeeModel EmployeeObject) { using (var EmpContext = new EmployeeDataContext()) { EmpContext.EmployeesDetails.Update(EmployeeObject); EmpContext.SaveChanges(); } return(Ok("Query processed")); }
public IActionResult AddEmployee([FromBody] Employee obj) { _context.Employee.Add(obj); _context.SaveChanges(); return(new ObjectResult("Employee added successfully!")); }
public void Add(Faculty fac) { fac.DateCreated = DateTime.Now; _context.Add(fac); _context.SaveChanges(); }
public void Add(Grade g) { g.DateCreated = DateTime.Now; _context.Add(g); _context.SaveChanges(); }
public virtual T Add(T t) { context.Set <T>().Add(t); context.SaveChanges(); return(t); }
public void Add(Department dept) { dept.DateCreated = DateTime.Now; _context.Add(dept); _context.SaveChanges(); }
public void Add(User u) { u.DateCreated = DateTime.Now; _context.Add(u); _context.SaveChanges(); }
public void Add(Salary s) { // s.DateCreated = DateTime.Now; _context.Add(s); _context.SaveChanges(); }