public void Delete(Employee data) { EmployeeDAO.Delete(data); }
private void btnAdd_Click(object sender, EventArgs e) { FormToModel(); EmployeeEventArgs eventArgs = new EmployeeEventArgs(); EmployeeInfo employeeInfo = new EmployeeInfo(); Employee employee = new Employee(); employee.Department = SalePointController.DepartmentModel; //employee.DepartmentId = SalePointController.DepartmentModel.DepartmentId; employee.EmployeeInfo = employeeInfo; employeeInfo.Employee = employee; //employeeInfo.DepartmentId = (int)SalePointController.DepartmentModel.DepartmentId; EmployeePK employeePK = new EmployeePK(); employeePK.DepartmentId = SalePointController.DepartmentModel.DepartmentId; employeeInfo.EmployeePK = employeePK; employee.EmployeePK = employeePK; eventArgs.EmployeeInfo = employeeInfo; eventArgs.SelectedEmployee = -1; this.Enabled = false; EventUtility.fireEvent(AddEmployeeEvent,this,eventArgs); if(eventArgs.AddedEmployee!=null) { bdsEmployeeSource.Add(eventArgs.AddedEmployee); bdsEmployeeSource.EndEdit(); dgvEmployees.Refresh(); dgvEmployees.Invalidate(); } this.Enabled = true; employeeController.EmployeeInfoModel = null; }
public Employee Add(Employee data) { EmployeeDAO.Add(data); return data; }
public void Update(Employee data) { EmployeeDAO.Update(data); }
/// <summary> /// Delete Employee from database. /// </summary> /// <param name="data"></param> /// <returns></returns> public void Delete(Employee data) { HibernateTemplate.Delete(data); }
/// <summary> /// Add Employee to database. /// </summary> /// <param name="data"></param> /// <returns></returns> public Employee Add(Employee data) { HibernateTemplate.Save(data); return data; }
/// <summary> /// Update Employee to database. /// </summary> /// <param name="data"></param> /// <returns></returns> public void Update(Employee data) { HibernateTemplate.Execute( delegate(ISession session) { session.Replicate(data, ReplicationMode.Overwrite); return data; } ); //HibernateTemplate.Update(data); }