Initial commit
Initial commit til Git. V2 er deployed
This commit is contained in:
58
PointOfSale/Pos.Ui/Pos/SaleOfDay.xaml.cs
Normal file
58
PointOfSale/Pos.Ui/Pos/SaleOfDay.xaml.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Shapes;
|
||||
using EpsonPrinter.Model;
|
||||
using Pos.Models;
|
||||
using Pos.Service;
|
||||
|
||||
namespace Pos
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for SaleOfDay.xaml
|
||||
/// </summary>
|
||||
public partial class SaleOfDay : Window
|
||||
{
|
||||
private bool _initialLoad = true;
|
||||
private TotalSaleDetail totalSaleDetail;
|
||||
public SaleOfDay()
|
||||
{
|
||||
InitializeComponent();
|
||||
SaleService saleService = new SaleService();
|
||||
totalSaleDetail = saleService.TotalSale(DateTime.Now);
|
||||
TotalSale.Content = $"Dagens salg: kr. {totalSaleDetail.TotalSale:0.00}";
|
||||
StartDatePicker.SelectedDate = DateTime.Now;
|
||||
GridSaleDetail.ItemsSource = totalSaleDetail.TotalSaleCategories;
|
||||
_initialLoad = false;
|
||||
}
|
||||
|
||||
private void StartDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (_initialLoad)
|
||||
return;
|
||||
|
||||
_initialLoad = false;
|
||||
DateTime selectedDate = DateTime.Parse(sender.ToString());
|
||||
SaleService saleService = new SaleService();
|
||||
totalSaleDetail = saleService.TotalSale(selectedDate);
|
||||
TotalSale.Content = $"Dagens salg: kr. {totalSaleDetail.TotalSale:0.00}";
|
||||
GridSaleDetail.ItemsSource = totalSaleDetail.TotalSaleCategories;
|
||||
}
|
||||
|
||||
private void PrintSale_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SaleService saleService = new SaleService();
|
||||
saleService.PrintSaleOfDay(StartDatePicker.SelectedDate.Value,totalSaleDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user