Change Init Users

This commit is contained in:
Nguyen Dinh Thuan
2024-09-11 16:06:27 +07:00
parent b8d7056e42
commit 409d942352
6 changed files with 132 additions and 45 deletions
+19 -16
View File
@@ -317,15 +317,18 @@ namespace SafeBagDE70
public void InitLvCountItems()
{
if (lvCount.Items.Count == 11) {
foreach(var item in lvCountItems)
{
item.Quantity = "0";
}
}
else
Dispatcher.Invoke(() =>
{
lvCountItems = new ObservableCollection<LvCountItem>()
if (lvCount.Items.Count == 11)
{
foreach (var item in lvCountItems)
{
item.Quantity = "0";
}
}
else
{
lvCountItems = new ObservableCollection<LvCountItem>()
{
new LvCountItem{Name = "500",Quantity = "0"},
new LvCountItem{Name = "1000",Quantity = "0"},
@@ -339,11 +342,9 @@ namespace SafeBagDE70
new LvCountItem{Name = "500000",Quantity = "0"},
new LvCountItem{Name = "Tổng",Quantity = "0",Value="0"},
};
}
lvCount.ItemsSource = lvCountItems;
}
lvCount.ItemsSource = lvCountItems;
});
//lvCountItems[0].Quantity = "10";
}
int prevPrinterStatus = -1;
@@ -1293,8 +1294,10 @@ namespace SafeBagDE70
var currentTime = DateTime.Now;
var printDocument = new PrintDocument();
System.Drawing.Image LogoAeonMall = System.Drawing.Image.FromFile("Logo\\logoAeonmall.png");
System.Drawing.Image LogoVietin = System.Drawing.Image.FromFile("Logo\\logoVietin.png");
var strLogoAM= System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logo\\logoAeonmall.png");
var strLogoVietin = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logo\\logoVietin.png");
System.Drawing.Image LogoAeonMall = System.Drawing.Image.FromFile(strLogoAM);
System.Drawing.Image LogoVietin = System.Drawing.Image.FromFile(strLogoVietin);
printDocument.PrinterSettings.PrinterName = "CUSTOM K80";
printDocument.PrintPage += (sender, e) =>
@@ -1334,7 +1337,7 @@ namespace SafeBagDE70
e.Graphics.DrawString("Tên Gian hàng: " + shopName, new Font("Arial", fontSize), System.Drawing.Brushes.Black, new PointF(50, lineSpace * 5 + 65));
e.Graphics.DrawString("Số tài khoản gian hàng: " + storeAccountNumber, new Font("Arial", fontSize), System.Drawing.Brushes.Black, new PointF(50, lineSpace * 6 + 65));
e.Graphics.DrawString("Nội dung giao dịch: Nop doanh so tien mat_", new Font("Arial", fontSize), System.Drawing.Brushes.Black, new PointF(50, lineSpace * 7 + 65));
e.Graphics.DrawString(shopCode, new Font("Arial", fontSize), System.Drawing.Brushes.Black, new PointF(50, lineSpace * 8 + 65));
e.Graphics.DrawString(AppData.GetNumberPartFromMerchantCode(shopCode), new Font("Arial", fontSize), System.Drawing.Brushes.Black, new PointF(50, lineSpace * 8 + 65));
e.Graphics.DrawString("Số tiền nộp: " + lvCountItems[10].Value, new Font("Arial", fontSize), System.Drawing.Brushes.Black, new PointF(50, lineSpace * 9 + 65));
e.Graphics.DrawString("*****Xin cám ơn*****", new Font("Arial", 7), System.Drawing.Brushes.Black, new PointF(120, lineSpace * 10 + 65));
// To send raw ESC/POS commands, you'd typically use e.Graphics.DrawString() with the command string,