private void Window_Loaded(object sender, RoutedEventArgs e) { IList <DealDto> deal = ProcessFactory.GetDealProcess().GetList(); datePicker1.Text = deal[0].DateOfDeal.ToString(); datePicker2.Text = deal[deal.Count - 1].DateOfDeal.ToString(); btnAccept_Click(sender, e); }
private void btnDeleteDeal_Click(object sender, RoutedEventArgs e) { DealDto item = dgDeal.SelectedItem as DealDto; if (item == null) { MessageBox.Show("Выберите запись для удаления", "Удаление сделок"); } MessageBoxResult result = MessageBox.Show("Удалить сделку №" + item.DealID + "?", "Удаление сделок", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result != MessageBoxResult.Yes) { return; } ProcessFactory.GetDealProcess().Delete(item.DealID); btnRefresh_Click(sender, e); }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (cbSeeker.SelectedItem == null) { MessageBox.Show("Выберите соискателя", "Проверка"); return; } if (cbPosition.SelectedItem == null) { MessageBox.Show("Выберите вакансию", "Проверка"); return; } if (dpDateOfDeal.DisplayDate == null) { MessageBoxResult result = MessageBox.Show("При указании пустой даты будет указана сегодняшняя дата: " + DateTime.Today.ToShortDateString() + "\nВы уверены?", "Проверка", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result != MessageBoxResult.Yes) { return; } } decimal commission; decimal.TryParse(tbCommissions.Text, out commission); DealDto deal = new DealDto(); deal.DateOfDeal = dpDateOfDeal.SelectedDate.Value.Date; deal.Commission = commission; deal.Position = cbPosition.SelectedItem as PositionDto; deal.Seeker = cbSeeker.SelectedItem as JobSeekerDto; IDealProcess dealProcess = ProcessFactory.GetDealProcess(); if (_dealID == 0) { dealProcess.Add(deal); } else { deal.DealID = _dealID; dealProcess.Update(deal); } Close(); }
private void BtnSearchDeal_Click(object sender, RoutedEventArgs e) { this.FoundDeals = ProcessFactory.GetDealProcess().SearchDeal(this.cbJobSeeker.Text, this.cbPosition.Text, this.Commission.Text); this.exec = true; this.Close(); }
private void btnRefreshDeal_Click(object sender, RoutedEventArgs e) { dgDeal.ItemsSource = ProcessFactory.GetDealProcess().GetList(); }