Files
BeWoPlaner/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs
2020-09-30 10:00:31 +02:00

58 lines
1.7 KiB
C#

using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BeWo.View.Detail.Report
{
/// <summary>
/// Interaktionslogik für TestEMailControl.xaml
/// </summary>
public partial class AbwesenheitsPrintControl : UserControl
{
public event Action ButtonAcceptClicked;
public event Action ButtonCancelClicked;
public AbwesenheitsPrintControl(DateTime dt)
{
InitializeComponent();
ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, Theme.Office2010Black);
var years = new List<int>();
for (int i = DateTime.Now.Year + 5; i >= 2010; i--)
{
years.Add(i);
}
ComboJahr.ItemsSource = years;
ComboJahr.SelectedItem = dt.Year;
ComboMonat.ItemsSource = DateTimeFormatInfo.CurrentInfo.MonthNames.Where(s => !string.IsNullOrEmpty(s));
ComboMonat.SelectedIndex = dt.Month - 1;
}
public DateTime SelectedDate => new DateTime((int)ComboJahr.SelectedItem, ComboMonat.SelectedIndex + 1, 1);
private void ButtonAccept_OnClick(object sender, RoutedEventArgs e)
{
ButtonAcceptClicked?.Invoke();
}
private void ButtonCancel_OnClick(object sender, RoutedEventArgs e)
{
ButtonCancelClicked?.Invoke();
}
}
}