Bugfixing

This commit is contained in:
Christian
2017-03-28 11:01:28 +02:00
parent d2ce476759
commit 4e9c52b04b
30 changed files with 441 additions and 244 deletions

View File

@@ -10,6 +10,7 @@ using System.Windows.Controls;
using System.Windows.Input;
using BeWo.Annotations;
using BeWo.Core;
using BeWo.Scheduler.ViewModel;
using BeWo.ServiceProxy;
using BeWo.View;
@@ -339,67 +340,42 @@ namespace BeWo.Scheduler.View
private void button_CreatZeiterfassung_Click(object sender, RoutedEventArgs e)
{
var startDate = StartDate.DateTime;
var startTime = DateTime.Parse(StartTime.Text);
var endDate = EndDate.DateTime;
var endTime = DateTime.Parse(EndTime.Text);
DateTime start = new DateTime(startDate.Year,startDate.Month,startDate.Day,startTime.Hour,startTime.Minute,startTime.Second);
DateTime end = new DateTime(endDate.Year,endDate.Month,endDate.Day,endTime.Hour,endTime.Minute,endTime.Second);
var employ = SelectedMitarbeiter.Items;
{
var employ = SelectedMitarbeiter.Items;
var y = SelectedKlient.Items;
if (y.Count == 0)
{
MessageBox.Show("Bitte wählen sie für die Zeiterfassung, mindestens einen Klienten aus !");
}
else if (y.Count == 1 && employ.Count == 0)
{
MessageBox.Show("Bitte wählen Sie mindestens einen Klienten aus!");
}
else
{
var startDate = StartDate.DateTime;
var startTime = DateTime.Parse(StartTime.Text);
long klientOid = 5;
var endDate = EndDate.DateTime;
var endTime = DateTime.Parse(EndTime.Text);
foreach (var klient in y)
{
var s = (CompactCustomerDC) klient;
DateTime start = new DateTime(startDate.Year, startDate.Month, startDate.Day, startTime.Hour, startTime.Minute, startTime.Second);
DateTime end = new DateTime(endDate.Year, endDate.Month, endDate.Day, endTime.Hour, endTime.Minute, endTime.Second);
klientOid = s.CustomerOid;
}
var compactKlient = ServiceFacade.DoCustomerServiceSync(s => s.GetCompactCustomerDC(klientOid));
//Normale Buchung
ChatDokumentationsView newView = new ChatDokumentationsView(Notice.Text, compactKlient, start, end);
newView.ShowDialog();
}
else if(y.Count != 0 && employ.Count != 0)
{
List<CompactCustomerDC> customerlist = new List<CompactCustomerDC>();
List<CompactEmployeeDC> employeelist = new List<CompactEmployeeDC>();
foreach (var employee in employ)
{
var xy = (Employee2SchedulerAppointmentDC) employee;
var xy = (Employee2SchedulerAppointmentDC)employee;
employeelist.Add(xy.Employee);
}
foreach (var klient in y)
{
var s = (CompactCustomerDC) klient;
var s = (CompactCustomerDC)klient;
customerlist.Add(s);
}
//gruppenbuchungen
ChatDokumentationsView newView = new ChatDokumentationsView(Notice.Text,start, end,customerlist,employeelist);
newView.ShowDialog();
BeWoUtils.CreateZeiterfassung(start, end, customerlist, employeelist, Notice.Text);
}
}