private void CreateSickness() { string name = emp.LastName + " " + cbxVacationTypes.Text + " " + dtpStartVacation.Value.ToShortDateString() + "-" + dtpEndVacation.Value.ToShortDateString(); _vacation = new SicknessVacation(name, emp, dtpStartVacation.Value, dtpEndVacation.Value, txtComment.Text, txtLinkSickList.Text); VacationRepository.Add(_vacation); MessageBox.Show("Выплата за этот отпуск составит:" + _vacation.GetMoneyVacation().ToString("###,##")); }
private void btnGetAllVacations_Click(object sender, EventArgs e) { try { int ID = Convert.ToInt32(cbxSurnamesForSearch.SelectedValue); lbxListVacations.DataSource = VacationRepository.GetListVacations(ID); } catch { } }
private void lbxListVacations_DoubleClick(object sender, EventArgs e) { try { string name = lbxListVacations.SelectedValue.ToString(); Vacation vacation = VacationRepository.GetVacation(name); dtpStartDateForThisEmployee.Value = vacation.DateStartVacation; dtpEndDateForThisEmployee.Value = vacation.DateEndVacation; txtCommentForThisEmployee.Text = vacation.Description; } catch { } }
public MainForm() { InitializeComponent(); CreateVacations(); cbxEmployeesSurname.DisplayMember = "LastName"; cbxEmployeesSurname.ValueMember = "ID"; cbxEmployeesSurname.DataSource = EmployeeRepository.GetAllEmployee(); cbxSurnamesForSearch.DisplayMember = "LastName"; cbxSurnamesForSearch.ValueMember = "ID"; cbxSurnamesForSearch.DataSource = EmployeeRepository.GetAllEmployee(); lbxListVacations.DisplayMember = "Name"; lbxListVacations.ValueMember = "Name"; lbxListVacations.DataSource = VacationRepository.GetAllVacations(); }
private void CreateWithoutPayment() { string name = ""; if (ckbxConfirm.Checked) { name = emp.LastName + " " + cbxVacationTypes.Text + " " + dtpStartVacation.Value.ToShortDateString() + "-" + dtpEndVacation.Value.ToShortDateString() + " Статус=Потвержден"; } else { name = emp.LastName + " " + cbxVacationTypes.Text + " " + dtpStartVacation.Value.ToShortDateString() + "-" + dtpEndVacation.Value.ToShortDateString() + " Статус=Не потвержден"; } _vacation = new WithoutPaymentVacation(name, emp, dtpStartVacation.Value, dtpEndVacation.Value, txtComment.Text, ckbxConfirm.Checked); VacationRepository.Add(_vacation); MessageBox.Show("Выплата за этот отпуск составит:" + _vacation.GetMoneyVacation().ToString("###,##")); }