749 lines
28 KiB
C#
749 lines
28 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
|
|
using BeWo.Controls;
|
|
using BeWo.Core;
|
|
using BeWo.ServiceProxy;
|
|
using BeWo.ViewModel;
|
|
|
|
using BS.Shared;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
using BS.Shared.Extensions;
|
|
using BS.Shared.Translation;
|
|
using DevExpress.Xpf.Core;
|
|
using DevExpress.Xpf.Editors;
|
|
using DevExpress.Xpf.Printing;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace BeWo.View.Detail.Report
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for ServicesReportViewAlt.xaml
|
|
/// </summary>
|
|
public partial class ServicesReportViewAlt : BeWoView
|
|
{
|
|
private CompactCustomerDC _Customer;
|
|
|
|
private CompactTeamDC _Team;
|
|
|
|
private CompactEmployeeDC _Employee;
|
|
|
|
private CompactOrganisationDC _Organisation;
|
|
|
|
public CompactCustomerDC Customer { get { return _Customer; } set { _Customer = value; } }
|
|
|
|
public CompactTeamDC Team { get { return _Team; } set { _Team = value; } }
|
|
|
|
public CompactEmployeeDC Employee { get { return _Employee; } set { _Employee = value; } }
|
|
|
|
public CompactOrganisationDC Organisation { get { return _Organisation; } set { _Organisation = value; } }
|
|
|
|
//private List<QuittierungsCheckView> _quittierungsCheck = new List<QuittierungsCheckView>();
|
|
|
|
private Dictionary<string, DateTime> Dicdate = new Dictionary<string, DateTime>();
|
|
|
|
private Dictionary<string, DateTime> DictYear = new Dictionary<string, DateTime>();
|
|
|
|
public bool FetchReferenceNumbers { get; set; }
|
|
|
|
public ServicesReportViewAlt()
|
|
{
|
|
InitializeComponent();
|
|
InitDateCombos();
|
|
InitServiceCategoryCombo();
|
|
InitFilterCombos();
|
|
InitSortCombos();
|
|
|
|
if (BeWoApp.AppSettings.OpenReportInNewWindow)
|
|
{
|
|
checkbox_openInNewWindow.IsChecked = true;
|
|
}
|
|
//if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
|
|
//{
|
|
// checkbox_all.IsEnabled = false;
|
|
// checkbox_all.IsChecked = false;
|
|
//}
|
|
|
|
// SetMonthCombobox();
|
|
// SetYearCombobox();
|
|
|
|
|
|
//GridControlQuittierungsCheck.ItemsSource = _quittierungsCheck;
|
|
|
|
// GetQuittierungsCheckCustomerList(DateTime.Now);
|
|
|
|
combobox_month.SelectionChanged += combobox_month_SelectionChanged;
|
|
combobox_year.SelectionChanged += combobox_year_SelectionChanged;
|
|
|
|
ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, Theme.Office2010Black);
|
|
|
|
Unloaded += delegate
|
|
{
|
|
ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, null);
|
|
docPrevControl.Visibility = Visibility.Collapsed;
|
|
};
|
|
}
|
|
|
|
void combobox_month_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
InitDayCombos();
|
|
}
|
|
|
|
void combobox_year_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
InitDayCombos();
|
|
}
|
|
|
|
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
|
{
|
|
if (popupedit_customer == null)
|
|
return;
|
|
|
|
popupedit_customer.Text = string.Empty;
|
|
_Customer = null;
|
|
}
|
|
|
|
private void CustomerSearchView_CustomerSelected(object sender, EventArgs<CompactCustomerDC> e)
|
|
{
|
|
_Customer = e.Data;
|
|
popupedit_customer.Text = _Customer.ToString();
|
|
popup_customer.IsOpen = false;
|
|
}
|
|
|
|
private void TeamSearchView_CustomerSelected(object sender, EventArgs<CompactTeamDC> e)
|
|
{
|
|
_Team = e.Data;
|
|
popupedit_team.Text = _Team.ToString();
|
|
popup_team.IsOpen = false;
|
|
}
|
|
private void EmployeeSearchView_EmployeeSelected(object sender, EventArgs<CompactEmployeeDC> e)
|
|
{
|
|
_Employee = e.Data;
|
|
popupedit_employee.Text = _Employee.SimpleDescription;
|
|
popup_employee.IsOpen = false;
|
|
|
|
}
|
|
|
|
private void InitServiceCategoryCombo()
|
|
{
|
|
ServiceFacade.DoOperationsServiceSync(s => ServiceCategoriesComboBox.ItemsSource = s.GetAllServiceCategories());
|
|
ServiceCategoriesComboBox.SelectedIndex = -1;
|
|
}
|
|
|
|
private void InitDateCombos()
|
|
{
|
|
this.combobox_month.ItemsSource = DateTimeFormatInfo.CurrentInfo.MonthNames.Where(s => !string.IsNullOrEmpty(s));
|
|
int monthIdx = DateTime.Now.Month - 1;
|
|
//if (DateTime.Now.Day < 15)
|
|
//{
|
|
monthIdx--;
|
|
if (monthIdx < 0)
|
|
monthIdx = 11;
|
|
//}
|
|
this.combobox_month.SelectedIndex = monthIdx;
|
|
var years = new List<int>();
|
|
years.Add(DateTime.Now.Year + 1);
|
|
for (int i = 0; i <= 10; i++)
|
|
{
|
|
years.Add(DateTime.Now.Year - i);
|
|
}
|
|
|
|
this.combobox_year.ItemsSource = years;
|
|
if (monthIdx == 11)
|
|
{
|
|
this.combobox_year.SelectedItem = DateTime.Now.Year - 1;
|
|
}
|
|
else
|
|
this.combobox_year.SelectedItem = DateTime.Now.Year;
|
|
|
|
InitDayCombos();
|
|
}
|
|
|
|
private void InitDayCombos()
|
|
{
|
|
int year = DateTime.Now.Year;
|
|
|
|
var yearObj = this.combobox_year.SelectedItem;
|
|
if (yearObj != null)
|
|
year = Int32.Parse(yearObj.ToString());
|
|
|
|
int month = this.combobox_month.SelectedIndex + 1;
|
|
|
|
int lastStartIndex = combobox_Startday.SelectedIndex;
|
|
//if (combobox_Startday.HasItems)
|
|
// combobox_Startday.Items.Clear();
|
|
int lastEndIndex = combobox_Endday.SelectedIndex;
|
|
//if (combobox_Endday.HasItems)
|
|
// combobox_Endday.Items.Clear();
|
|
|
|
int days = DateTime.DaysInMonth(year, month);
|
|
List<int> dayList = new List<int>();
|
|
for (int i = 1 ; i <= days; i++)
|
|
{
|
|
dayList.Add(i);
|
|
}
|
|
|
|
|
|
this.combobox_Startday.ItemsSource = dayList;
|
|
if (lastStartIndex >= dayList.Count)
|
|
lastStartIndex = dayList.Count - 1;
|
|
if (lastStartIndex < 0)
|
|
lastStartIndex = 0;
|
|
this.combobox_Startday.SelectedIndex = lastStartIndex;
|
|
|
|
this.combobox_Endday.ItemsSource = dayList;
|
|
if (lastEndIndex >= 27)
|
|
lastEndIndex = dayList.Count - 1;
|
|
if (lastEndIndex < 0)
|
|
lastEndIndex = dayList.Count - 1;
|
|
this.combobox_Endday.SelectedIndex = lastEndIndex;
|
|
}
|
|
|
|
|
|
private void InitFilterCombos()
|
|
{
|
|
var filterList = new List<QBFilterItem>();
|
|
|
|
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
|
|
{
|
|
filterList.Add(new QBFilterItem(QBFilterEnum.AlleKlienten));
|
|
}
|
|
|
|
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
|
|
{
|
|
filterList.Add(new QBFilterItem(QBFilterEnum.NurKlientenMeinesTeams));
|
|
}
|
|
filterList.Add(new QBFilterItem(QBFilterEnum.MeineKlienten));
|
|
filterList.Add(new QBFilterItem(QBFilterEnum.KlientenAuswahl));
|
|
|
|
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.TeamView_ViewMyTeams) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.TeamView_ViewAll))
|
|
{
|
|
//Wenn man das Recht hat nur das eigene Team zu sehen aber nicht alle, muss man zumindest auch noch das Recht haben die Klienten des eigenen Teams zu sehen
|
|
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
|
|
{
|
|
filterList.Add(new QBFilterItem(QBFilterEnum.TeamAuswahl));
|
|
}
|
|
|
|
}
|
|
else if (BeWoApp.LoggedOnUser.HasRight(UserRightType.TeamView_ViewAll))
|
|
{
|
|
//Wenn man das Recht hat alle Teams zu sehen, muss man auch das Recht haben alle Klienten zu sehen.
|
|
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
|
|
{
|
|
filterList.Add(new QBFilterItem(QBFilterEnum.TeamAuswahl));
|
|
}
|
|
|
|
}
|
|
|
|
FilterComboBox.DisplayMemberPath = "Name";
|
|
FilterComboBox.ItemsSource = filterList;
|
|
FilterComboBox.SelectedIndex = 0;
|
|
|
|
FilterComboBox.SelectionChanged += FilterComboBox_SelectionChanged;
|
|
|
|
}
|
|
|
|
private void InitSortCombos()
|
|
{
|
|
var list = new List<QBSortOrderItem>();
|
|
|
|
list.Add(new QBSortOrderItem(QBSortOrderEnum.NachKlient));
|
|
list.Add(new QBSortOrderItem(QBSortOrderEnum.NachHauptbetreuung));
|
|
//list.Add(new QBSortOrderItem(QBSortOrderEnum.NachTeam));
|
|
|
|
|
|
SortComboBox.DisplayMemberPath = "Name";
|
|
SortComboBox.ItemsSource = list;
|
|
SortComboBox.SelectedIndex = 0;
|
|
|
|
|
|
}
|
|
|
|
private void FilterComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
popupedit_customer.Visibility = Visibility.Collapsed;
|
|
popupedit_team.Visibility = Visibility.Collapsed;
|
|
|
|
QBFilterItem filterItem = FilterComboBox.SelectedItem as QBFilterItem;
|
|
|
|
if (filterItem != null)
|
|
{
|
|
if (filterItem.FilterEnum == QBFilterEnum.KlientenAuswahl)
|
|
{
|
|
popupedit_customer.Visibility = Visibility.Visible;
|
|
}
|
|
else if (filterItem.FilterEnum == QBFilterEnum.TeamAuswahl)
|
|
{
|
|
popupedit_team.Visibility = Visibility.Visible;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void OrganisationSearchView_OrganisationSelected(object sender, EventArgs<CompactOrganisationDC> e)
|
|
{
|
|
_Organisation = e.Data;
|
|
popupedit_costbearer.Text = _Organisation.Name;
|
|
popup_costbearer.IsOpen = false;
|
|
}
|
|
|
|
private void button_generate_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
|
|
long? customerOid = 0;
|
|
long? teamOid = 0;
|
|
long? empOid = 0;
|
|
long? orgaOid = 0;
|
|
|
|
|
|
QBFilterItem filterItem = null;
|
|
|
|
if (FilterComboBox.SelectedItem != null)
|
|
{
|
|
filterItem = FilterComboBox.SelectedItem as QBFilterItem;
|
|
}
|
|
|
|
if (filterItem == null)
|
|
{
|
|
filterItem = new QBFilterItem(QBFilterEnum.AlleKlienten);
|
|
}
|
|
|
|
if (filterItem.FilterEnum != QBFilterEnum.KlientenAuswahl)
|
|
{
|
|
_Customer = null;
|
|
}
|
|
if (filterItem.FilterEnum != QBFilterEnum.TeamAuswahl)
|
|
{
|
|
_Team = null;
|
|
}
|
|
if (!chkForAllCostbearer.IsChecked.Value)
|
|
{
|
|
_Organisation = null;
|
|
}
|
|
|
|
if (!chkForAllEmployees.IsChecked.Value)
|
|
{
|
|
_Employee = null;
|
|
}
|
|
|
|
if (filterItem.FilterEnum == QBFilterEnum.KlientenAuswahl && _Customer == null)
|
|
{
|
|
MessageBox.Show(Translator.Translate("Bitte wählen Sie einen Klienten aus."), "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
}
|
|
else if (filterItem.FilterEnum == QBFilterEnum.TeamAuswahl && _Team == null)
|
|
{
|
|
MessageBox.Show(Translator.Translate("Bitte wählen Sie ein Team aus."), "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
}
|
|
else if (chkForAllCostbearer.IsChecked.Value && _Organisation == null)
|
|
{
|
|
MessageBox.Show(Translator.Translate("Bitte wählen Sie einen Kostenträger aus."), "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
}
|
|
else if (chkForAllEmployees.IsChecked.Value && _Employee == null)
|
|
{
|
|
MessageBox.Show(Translator.Translate("Bitte wählen Sie eine/n Mitarbeiter/in aus."), "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
}
|
|
else if (ChkForAllServiceCategories.IsChecked.HasValue && ChkForAllServiceCategories.IsChecked.Value && ServiceCategoriesComboBox.SelectedItem == null)
|
|
{
|
|
MessageBox.Show("Bitte wählen Sie eine Leistungskategorie aus.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
}
|
|
else
|
|
{
|
|
if (_Organisation != null)
|
|
{
|
|
orgaOid = _Organisation.OrganisationOid;
|
|
}
|
|
|
|
if (_Employee != null)
|
|
{
|
|
empOid = _Employee.EmployeeOid;
|
|
}
|
|
|
|
if (_Team != null)
|
|
{
|
|
teamOid = _Team.TeamOid;
|
|
}
|
|
|
|
if (_Customer != null)
|
|
{
|
|
customerOid = _Customer.CustomerOid;
|
|
}
|
|
|
|
var url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?";
|
|
|
|
|
|
url += "&ft=" + (int)filterItem.FilterEnum + "&cOid=" + customerOid + "&tOid=" + teamOid + "&orgaOid=" + orgaOid + "&empOid=" + empOid + "&month=" + (combobox_month.SelectedIndex + 1) + "&year=" + combobox_year.SelectedItem + "&start=" + combobox_Startday.SelectedItem + "&end=" + combobox_Endday.SelectedItem;
|
|
|
|
if (ChkForAllServiceCategories.IsChecked.HasValue && ChkForAllServiceCategories.IsChecked.Value)
|
|
{
|
|
url += "&scOid=" + ((ServiceCategoryDC)ServiceCategoriesComboBox.SelectedItem).ServiceCategoryOid;
|
|
}
|
|
|
|
QBSortOrderItem sortItem = SortComboBox.SelectedItem as QBSortOrderItem;
|
|
|
|
if (sortItem != null)
|
|
{
|
|
url += "&sortorder=" + (int)sortItem.SortOrderEnum;
|
|
}
|
|
url += "&type=" + Utils.EnumName(ReportTypes.ServicesOverviewNew);
|
|
|
|
//var tempToken = string.Empty;
|
|
//ServiceFacade.DoDownloadServiceSync(s => tempToken = s.CreateTemporaryToken(url, true));
|
|
//string addChar = (url.Contains("?")) ? "&" : "?";
|
|
//url = url + addChar + "token=" + tempToken;
|
|
|
|
url = BeWoWpfUtils.GetHTMLEncodedURL(url);
|
|
|
|
if (checkbox_openInNewWindow.IsChecked.Value)
|
|
{
|
|
BeWoUtils.NavigateToReportUri(url, null);
|
|
}
|
|
else
|
|
{
|
|
BeWoUtils.NavigateToReportUriWithDocumentPreviewControl(url, "Quittierungsbeleg", docPrevControl, null);
|
|
}
|
|
|
|
//BeWoUtils.NavigateToReportUri(url, "Quittierungsbeleg", docPrevControl);
|
|
//BeWoUtils.NavigateToReportUriSync(url, docPrevControl);
|
|
}
|
|
}
|
|
|
|
private void listbox_month_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
this.combobox_month.IsEnabled = false;
|
|
}
|
|
|
|
private void listbox_year_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
this.combobox_year.IsEnabled = false;
|
|
}
|
|
|
|
private void popupedit_costbearer_PopUpClick(object sender, RoutedEventArgs e)
|
|
{
|
|
popup_costbearer.IsOpen = true;
|
|
}
|
|
|
|
private void popupedit_customer_PopUpClick(object sender, RoutedEventArgs e)
|
|
{
|
|
popup_customer.IsOpen = true;
|
|
}
|
|
|
|
private void popupedit_employee_PopUpClick(object sender, RoutedEventArgs e)
|
|
{
|
|
popup_employee.IsOpen = true;
|
|
}
|
|
|
|
private void popupedit_team_PopUpClick(object sender, RoutedEventArgs e)
|
|
{
|
|
popup_team.IsOpen = true;
|
|
}
|
|
|
|
private void Popupedit_customer_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
|
{
|
|
if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || _Customer == null || !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
|
|
return;
|
|
|
|
VMFactory.CreateCustomerVMAsync(_Customer.CustomerOid, cb => this.Dispatch(() => BeWoUtils.OpenModalViewWindow<CustomerVM, CustomerDC, ServicesReportViewAlt>(cb, this, () => this.Dispatch(
|
|
() => BeWoUtils.UpdateAllViews(_Customer)))));
|
|
}
|
|
|
|
private void Popupedit_costbearer_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
|
{
|
|
if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || _Organisation == null || !BeWoApp.LoggedOnUser.HasRight(UserRightType.OrganisationView_View))
|
|
return;
|
|
|
|
VMFactory.CreateOrganisationVMAsync(_Organisation.OrganisationOid, cb => this.Dispatch(() => BeWoUtils.OpenModalViewWindow<OrganisationVM, OrganisationDC, ServicesReportViewAlt>(cb, this, () => this.Dispatch(
|
|
() => BeWoUtils.UpdateAllViews(_Organisation)))));
|
|
}
|
|
|
|
private void Popupedit_employee_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
|
{
|
|
if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || _Employee == null || !BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View))
|
|
return;
|
|
|
|
VMFactory.CreateEmployeeVMAsync(_Employee.EmployeeOid, cb => this.Dispatch(() => BeWoUtils.OpenModalViewWindow<EmployeeVM, EmployeeDC, ServicesReportViewAlt>(cb, this, () => this.Dispatch(
|
|
() => BeWoUtils.UpdateAllViews(_Employee)))));
|
|
}
|
|
|
|
private void checkbox_openInNewWindow_Checked(object sender, RoutedEventArgs e)
|
|
{
|
|
BeWoApp.AppSettings.OpenReportInNewWindow = checkbox_openInNewWindow.IsChecked.Value;
|
|
BeWoApp.SaveAppSettings();
|
|
}
|
|
|
|
//####################### Übersicht bereich #############################################
|
|
//private void GetQuittierungsCheckCustomerList(DateTime monat)
|
|
//{
|
|
// List<QuittierungsCheckViewListItemsDC> qbCheckList = new List<QuittierungsCheckViewListItemsDC>();
|
|
|
|
// long? oid = null;
|
|
|
|
// if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
|
|
// {
|
|
// oid = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
|
|
// }
|
|
|
|
// ServiceFacade.DoCustomerServiceAsync(
|
|
// s => s.GetAllActiveCustomersCompactWithQBCheckList(this.FetchReferenceNumbers, oid, monat),
|
|
// r =>
|
|
// {
|
|
// List<QuittierungsCheckViewListItemsDC> list = r;
|
|
|
|
// if (oid != null)
|
|
// {
|
|
// list = list.Where(c => c.Customer.IsRelatedToEmployee).ToList();
|
|
// }
|
|
|
|
// list.Sort((x, y) => (x.Customer.LastName + ", " + x.Customer.FirstName).CompareTo(y.Customer.LastName + ", " + y.Customer.FirstName));
|
|
|
|
// qbCheckList = list;
|
|
|
|
// #region Dispatcher Refresh and add items to Grid
|
|
// this.Dispatch(delegate
|
|
// {
|
|
// AddQuittierungsCheckToGrid(qbCheckList);
|
|
// GridControlQuittierungsCheck.RefreshData();
|
|
// GridControlQuittierungsCheck.RefreshUI();
|
|
// });
|
|
// #endregion
|
|
// });
|
|
//}
|
|
|
|
//private void AddQuittierungsCheckToGrid(List<QuittierungsCheckViewListItemsDC> customerListe)
|
|
//{
|
|
// _quittierungsCheck.Clear();
|
|
|
|
// foreach (var list in customerListe)
|
|
// {
|
|
// QuittierungsCheckView x = new QuittierungsCheckView();
|
|
|
|
// x.Klient = list.Customer.FullName;
|
|
|
|
// //############ Druck ####################
|
|
// if (list.QuittierungsbelegDruck.HasValue)
|
|
// x.QuittierungsbelegGedruckt = list.QuittierungsbelegDruck.Value;
|
|
|
|
// if (list.QuittierungsbelegDruckAm.HasValue)
|
|
// {
|
|
// x.QuittierungsbelegGedrucktAm = list.QuittierungsbelegDruckAm.Value.ToString("dd.MM.yyyy");
|
|
// x.IsQbUnterschriebenAvailable = true;
|
|
// }
|
|
// else
|
|
// {
|
|
// x.IsQbUnterschriebenAvailable = false;
|
|
// }
|
|
|
|
// x.GedrucktAm = list.QuittierungsbelegDruckAm;
|
|
|
|
|
|
// x.QuittierungsbelegGedrucktVonOid = list.QuittierungsbelegGedrucktVonOid;
|
|
|
|
// x.QuittierungsbelegGedrucktVon = list.QuittierungsbelegGedrucktVon;
|
|
|
|
// //######################################
|
|
|
|
// //############ Unterschrift ############
|
|
// if (list.QuittierungsbelegUnterschrift.HasValue)
|
|
// x.QuittierungsbelegUnterschrieben = list.QuittierungsbelegUnterschrift.Value;
|
|
|
|
// x.QuittierungsbelegUnterschriebenVonOid = list.QuittierungsbelegUnterschriftVonOid;
|
|
|
|
// x.QuittierungsbelegUnterschriebenVon = list.QuittierungsbelegUnterschriftVon;
|
|
|
|
// //######################################
|
|
|
|
// if (list.QuittierungsCheckOid.HasValue)
|
|
// x.QuittierungsCheckOid = list.QuittierungsCheckOid;
|
|
|
|
|
|
// if (list.Monat.HasValue)
|
|
// x.Monat = list.Monat.Value;
|
|
|
|
// x.CompactCustomer = list.Customer;
|
|
|
|
// _quittierungsCheck.Add(x);
|
|
// }
|
|
//}
|
|
|
|
//private void CheckBoxQBU_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
|
|
//{
|
|
// var qbChanges = (QuittierungsCheckView)GridControlQuittierungsCheck.SelectedItem;
|
|
|
|
// QuittierungsCheckDC qbCheck = new QuittierungsCheckDC()
|
|
// {
|
|
// CustomerOid = qbChanges.CompactCustomer.CustomerOid,
|
|
|
|
// QuittierungsbelegGedruckt = qbChanges.QuittierungsbelegGedruckt,
|
|
// QuittierungsbelegGedrucktAm = qbChanges.GedrucktAm,
|
|
// QuittierungsbelegGedrucktVon = qbChanges.QuittierungsbelegGedrucktVonOid,
|
|
|
|
// Monat = qbChanges.Monat
|
|
// };
|
|
|
|
// if ((bool)e.NewValue == true)
|
|
// {
|
|
// qbCheck.QuittierungsbelegUnterschriebenVon = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
|
|
// qbCheck.QuittierungsbelegUnterschrieben = true;
|
|
// }
|
|
// else
|
|
// {
|
|
// qbCheck.QuittierungsbelegUnterschriebenVon = null;
|
|
// qbCheck.QuittierungsbelegUnterschrieben = false;
|
|
// }
|
|
|
|
|
|
// if (qbChanges.QuittierungsCheckOid.HasValue)
|
|
// {
|
|
// qbCheck.QuittierungsCheckOid = qbChanges.QuittierungsCheckOid;
|
|
// ServiceFacade.DoCustomerServiceSync(r => r.UpdateNewQuittierungsCheck(qbCheck));
|
|
// }
|
|
// else
|
|
// {
|
|
// ServiceFacade.DoCustomerServiceSync(r => r.SaveNewQuittierungsCheck(qbCheck));
|
|
// }
|
|
|
|
|
|
// GetQuittierungsCheckCustomerList(Dicdate[(string)MonthCombobox.SelectedItem]);
|
|
//}
|
|
|
|
//private void SetMonthCombobox()
|
|
//{
|
|
// List<string> monate = new List<string>();
|
|
|
|
// monate.Add(Monat.Januar.ToString());
|
|
// monate.Add(Monat.Februar.ToString());
|
|
// monate.Add(Monat.März.ToString());
|
|
// monate.Add(Monat.April.ToString());
|
|
// monate.Add(Monat.Mai.ToString());
|
|
// monate.Add(Monat.Juni.ToString());
|
|
// monate.Add(Monat.Juli.ToString());
|
|
// monate.Add(Monat.August.ToString());
|
|
// monate.Add(Monat.September.ToString());
|
|
// monate.Add(Monat.Oktober.ToString());
|
|
// monate.Add(Monat.November.ToString());
|
|
// monate.Add(Monat.Dezember.ToString());
|
|
|
|
// MonthCombobox.ItemsSource = monate;
|
|
|
|
// var dateTime = DateTime.Now;
|
|
|
|
// var editValue = "default";
|
|
|
|
// int i = 1;
|
|
// foreach (var mon in monate)
|
|
// {
|
|
// var x = new DateTime(dateTime.Year,i,1);
|
|
// Dicdate.Add(mon,x);
|
|
|
|
// i++;
|
|
// }
|
|
|
|
// foreach (var key in Dicdate)
|
|
// {
|
|
// if (key.Value.Month == DateTime.Now.Month)
|
|
// {
|
|
// editValue = key.Key;
|
|
// }
|
|
// }
|
|
|
|
// MonthCombobox.EditValue = editValue;
|
|
//}
|
|
|
|
//private void SetYearCombobox()
|
|
//{
|
|
// List<string> year = new List<string>();
|
|
|
|
// year.Add(DateTime.Now.AddYears(-5).Year.ToString());
|
|
// year.Add(DateTime.Now.AddYears(-4).Year.ToString());
|
|
// year.Add(DateTime.Now.AddYears(-3).Year.ToString());
|
|
// year.Add(DateTime.Now.AddYears(-2).Year.ToString());
|
|
// year.Add(DateTime.Now.AddYears(-1).Year.ToString());
|
|
// year.Add(DateTime.Now.Year.ToString());
|
|
|
|
// YearCombobox.ItemsSource = year;
|
|
|
|
// YearCombobox.EditValue = DateTime.Now.Year.ToString();
|
|
|
|
|
|
// DictYear.Add(DateTime.Now.AddYears(-5).Year.ToString(), DateTime.Now.AddYears(-5));
|
|
// DictYear.Add(DateTime.Now.AddYears(-4).Year.ToString(), DateTime.Now.AddYears(-4));
|
|
// DictYear.Add(DateTime.Now.AddYears(-3).Year.ToString(), DateTime.Now.AddYears(-3));
|
|
// DictYear.Add(DateTime.Now.AddYears(-2).Year.ToString(), DateTime.Now.AddYears(-2));
|
|
// DictYear.Add(DateTime.Now.AddYears(-1).Year.ToString(), DateTime.Now.AddYears(-1));
|
|
// DictYear.Add(DateTime.Now.Year.ToString(), DateTime.Now);
|
|
|
|
//}
|
|
|
|
//private void MonthCombobox_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
|
|
//{
|
|
// var monat = (string)e.NewValue;
|
|
|
|
// var year = (string) YearCombobox.SelectedItem;
|
|
|
|
// if (year == null)
|
|
// {
|
|
// year = DateTime.Now.Year.ToString();
|
|
// }
|
|
|
|
// if (Dicdate.ContainsKey(monat))
|
|
// {
|
|
// if (DictYear.ContainsKey(year))
|
|
// {
|
|
// DateTime newDate = new DateTime(DictYear[year].Date.Year, Dicdate[monat].Date.Month, 1);
|
|
|
|
// GetQuittierungsCheckCustomerList(newDate);
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
//private void YearCombobox_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
|
|
//{
|
|
// var year = (string)e.NewValue;
|
|
|
|
// var month = (string) MonthCombobox.SelectedItem;
|
|
|
|
// if (DictYear.ContainsKey(year))
|
|
// {
|
|
// if (Dicdate.ContainsKey(month))
|
|
// {
|
|
// DateTime newDate = new DateTime(DictYear[year].Date.Year, Dicdate[month].Date.Month, 1);
|
|
|
|
// GetQuittierungsCheckCustomerList(newDate);
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
//public class QuittierungsCheckView
|
|
//{
|
|
// public string Klient { get; set; }
|
|
|
|
// public bool QuittierungsbelegGedruckt { get; set; }
|
|
// public string QuittierungsbelegGedrucktAm { get; set; }
|
|
// public string QuittierungsbelegGedrucktVon { get; set; }
|
|
|
|
// public bool QuittierungsbelegUnterschrieben { get; set; }
|
|
// public string QuittierungsbelegUnterschriebenVon { get; set; }
|
|
|
|
// public long? QuittierungsCheckOid { get; set; }
|
|
// public long? QuittierungsbelegUnterschriebenVonOid { get; set; }
|
|
// public long? QuittierungsbelegGedrucktVonOid { get; set; }
|
|
|
|
// public bool IsQbUnterschriebenAvailable { get; set; }
|
|
|
|
// public CompactCustomerDC CompactCustomer { get; set; }
|
|
|
|
// public DateTime Monat { get; set; }
|
|
// public DateTime? GedrucktAm { get; set; }
|
|
//}
|
|
|
|
} |