-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbillModule.cs
More file actions
96 lines (76 loc) · 2.47 KB
/
billModule.cs
File metadata and controls
96 lines (76 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PuniPos_2
{
public partial class billModule : UserControl
{
public Panel faturaPanel;
private Form1 _masterForm;
public billModule(Form1 masterform)
{
InitializeComponent();
faturaPanel = new Panel();
_masterForm = masterform;
CreateFaturaPanel();
}
public void HideFaturaPanel()
{
faturaPanel.Hide();
}
public void ShowFaturaPanel()
{
faturaPanel.BringToFront();
faturaPanel.Show();
pullOrders();
}
public void CreateFaturaPanel()
{
_masterForm.Controls.Add(faturaPanel);
faturaPanel.BackColor = Color.White;
faturaPanel.Size = new Size(770, 499);
faturaPanel.Location = new Point(125, 12);
faturaPanel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left);
faturaPanel.Controls.Add(this);
this.Dock = DockStyle.Left;
faturaPanel.Hide();
dateLabel.Text = DateTime.Now.ToLongDateString();
}
private void printBillButton_Click(object sender, EventArgs e)
{
MessageBox.Show("Fatura yazıcıya gönderildi");
faturaPanel.Hide();
}
private void faturaCancelButton_Click(object sender, EventArgs e)
{
faturaPanel.Hide();
}
private void pullOrders()
{
billDataTable.Rows.Clear();
billDataTable.Refresh();
foreach (var item in _masterForm.orderList)
{
billDataTable.Rows.Add(item.Title, item.Quantity +" Adet", item.Price + " TL");
}
float totalS = _masterForm.totalAmount;
string s = totalS.ToString("N2");
gtoplamText.Text = s;
float kdv = totalS * 8 / 100;
string k = kdv.ToString("N2");
kdvText.Text = k;
float toplam = totalS - kdv;
string t = toplam.ToString("N2");
toplamText.Text = t;
}
private void toplamText_Click(object sender, EventArgs e)
{
}
}
}