void btn_Click(object sender, EventArgs e) { //textBox1.Text = ""; Button btnUserName = (Button)sender; foreach (Button ctr in flowLayoutPanel1.Controls) { if (ctr.BackColor == Color.FromArgb(12, 120, 120)) { ctr.ForeColor = Color.White; ctr.BackColor = Color.FromArgb(153, 153, 153); } } btnUserName.BackColor = Color.FromArgb(12, 120, 120); btnUserName.ForeColor = Color.White; usermodel = (StaffModel)(btnUserName.Tag); }
void btnSaveUser_Click(object sender, EventArgs e) { frmConfirm frmcon = new frmConfirm("Messenger", "Do you want save info user ?"); frmcon.ShowDialog(); if (frmcon.DialogResult == System.Windows.Forms.DialogResult.OK) { Button btnSave = (Button)sender; StaffModel data = (StaffModel)(btnSave.Tag); var viewData = (UCUserListDetail)pDetail.Controls[0]; if (data == null) { data = new StaffModel(); } data.Fname = viewData.txtFname.Text ?? ""; data.Lname = viewData.txtLname.Text ?? ""; data.UserName = viewData.txtUserName.Text ?? ""; data.Password = viewData.txtPinCode.Text ?? ""; var cbDepartment = (KeyValueModel)viewData.cbRole.SelectedItem; if (cbDepartment != null) { data.DepartmentID = cbDepartment.Key; } var messenger = ""; if (data.Fname == "") messenger = messenger + "First Name isn't empty. "; if (data.Lname == "") messenger = messenger + "Last Name isn't empty. "; if (data.UserName == "") messenger = messenger + "User Name isn't empty. "; if (data.Password == "") messenger = messenger + "Pin Code isn't empty. "; if (data.DepartmentID == 0) messenger = messenger + "Please select role. "; if (messenger == "") { data.UpdateBy = userid; var result = UserService.SaveDataStaff(data); messenger = "Save data role fail."; if (result == 1) { addUserList("User List", 2); messenger = "Save data info user successful."; } if (result == -1) { messenger = "User name is exist. Please change user name."; } frmMessager frm = new frmMessager("Messenger", messenger); frmOpacity.ShowDialog(this, frm); } else { frmMessager frm = new frmMessager("Messenger", messenger + "Please input data."); frmOpacity.ShowDialog(this, frm); } } }
void addStaffDetail(StaffModel data) { // pDetail.Controls.Clear(); if (data.StaffID > 0) { UCUserListDetail ucUserDetail = new UCUserListDetail(); if (pDetail.Controls.Count > 0) { ucUserDetail = (UCUserListDetail)pDetail.Controls[0]; } else { ucUserDetail.Dock = DockStyle.Fill; pDetail.Controls.Add(ucUserDetail); } // ucUserDetail.Dock = DockStyle.Fill; ucUserDetail.lbTitle.Text = data.Fname + " " + data.Lname; ucUserDetail.txtFname.Text = data.Fname; ucUserDetail.txtLname.Text = data.Lname; ucUserDetail.txtUserName.Text = data.UserName; ucUserDetail.txtPinCode.Text = StaffModel.Decrypt(data.Password); var department = UserService.GetListDepartment().ToList(); ucUserDetail.cbRole.DisplayMember = "Value"; ucUserDetail.cbRole.ValueMember = "Key"; var textDefault = ""; foreach (var item in department) { if (item.DepartmentID == data.DepartmentID) { textDefault = item.DepartmentName; } var temp = new KeyValueModel(); temp.Key = item.DepartmentID; temp.Value = item.DepartmentName; ucUserDetail.cbRole.Items.Add(temp); } if (textDefault != "") { ucUserDetail.cbRole.Text = textDefault; } else { ucUserDetail.cbRole.SelectedIndex = 0; } ucUserDetail.btnSave.Tag = data; ucUserDetail.btnSave.Click += btnSaveUser_Click; ucUserDetail.btnDelete.Tag = data; ucUserDetail.btnDelete.Click += btnDeleteUser_Click; ucUserDetail.btnDelete.Show(); } }
//FUNCTION PRINT BILL private void PrintBill(PrintPageEventArgs e) { StaffModel staff = new ServicePOS.Model.StaffModel(); float l_y = 0; l_y = posPrinter.DrwaImage(e, new Font("Courier New", 10, FontStyle.Bold), l_y, 2); l_y = posPrinter.DrawString(cofig.Name, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 2, false, false); l_y = posPrinter.DrawString(cofig.ABN, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 2, false, false); l_y = posPrinter.DrawString(cofig.Address, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 2, false, false); l_y = posPrinter.DrawString(cofig.Tel, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 2, false, false); l_y += posPrinter.GetHeightPrinterLine() / 6; l_y = posPrinter.DrawLine("", new Font("Courier New", 8), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); l_y = posPrinter.DrawString(DateTime.Now.ToString("dd/MM/yyyy") + " " + DateTime.Now.ToShortTimeString() + " - " + OrderMain.UserName, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); if (!OrderMain.isStore) { if (OrderMain.isTKA == 0) { l_y = posPrinter.DrawString("Eat in - Table# " + OrderMain.FloorID, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); } else { l_y = posPrinter.DrawString("TKA - Table# " + OrderMain.FloorID, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); } } //l_y = posPrinter.DrawString("OPERATOR#" + OrderMain.UserName, e, new Font("Courier New", 8, FontStyle.Italic), l_y, 1, false, false); posPrinter.DrawLine("", new Font("Arial", 9), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); l_y += posPrinter.GetHeightPrinterLine() / 5; l_y = posPrinter.DrawString(" TAX INVOICE", e, new Font("Courier New", 12, FontStyle.Bold), l_y, 2, false, false); l_y += posPrinter.GetHeightPrinterLine() / 10; //posPrinter.DrawLine("", new Font("Courier New", 9), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); float yStart = l_y; posPrinter.DrawString1("Item(s)", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, true, false); l_y = posPrinter.DrawString1("Qty", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 2, false, true); posPrinter.DrawString1("$", e, new Font("Courier New", 8, FontStyle.Bold), yStart, 3, false, false); l_y += posPrinter.GetHeightPrinterLine() / 5; for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++) { yStart = l_y; if (OrderMain.ListOrderDetail[i].ItemTKA == 1) { posPrinter.DrawString(OrderMain.ListOrderDetail[i].ProductName + "-TKA", e, new Font("Courier New", 10, FontStyle.Bold), l_y, 1, true, false); } else { posPrinter.DrawString(OrderMain.ListOrderDetail[i].ProductName, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, true, false); } l_y = posPrinter.DrawString(OrderMain.ListOrderDetail[i].Qty.ToString(), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 2, false, true); posPrinter.DrawString(money.Format2(OrderMain.ListOrderDetail[i].Price.ToString()), e, new Font("Courier New", 8, FontStyle.Bold), yStart, 3, false, false); if (OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count > 0) { for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { yStart = l_y; posPrinter.DrawString("--" + OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j].ModifireName, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); l_y = posPrinter.DrawString("1", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 2, false, true); if (OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j].Price > 0) { l_y = posPrinter.DrawString(money.Format2(OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j].Price.ToString()), e, new Font("Courier New", 8, FontStyle.Bold), yStart, 3, false, false); } else { l_y = posPrinter.DrawString("0", e, new Font("Courier New", 8, FontStyle.Bold), yStart, 3, false, false); } } } //float test1 = e.Graphics.MeasureString(OrderMain.ListOrderDetail[i].ProductName, new Font("Arial", 10, FontStyle.Bold)).Width; //float test2 = (float)Math.Abs(e.PageBounds.Width - 173); float widthItem = Math.Abs(e.Graphics.MeasureString(OrderMain.ListOrderDetail[i].ProductName, new Font("Courier New", 8, FontStyle.Bold)).Width); float widthPage = Math.Abs(e.PageBounds.Width - 105); if (widthItem > e.PageBounds.Width) { List <string> lstString = posPrinter.SplitStringLine(OrderMain.ListOrderDetail[i].ProductName, e, new Font("Courier New", 8, FontStyle.Bold), true); int count = lstString.Count(); if (count >= 3) { l_y += (posPrinter.GetHeightPrinterLine() / 4) + 3; } else { l_y += posPrinter.GetHeightPrinterLine() / 6; } } else { if (widthItem > widthPage) { List <string> lstString = posPrinter.SplitStringLine(OrderMain.ListOrderDetail[i].ProductName, e, new Font("Courier New", 8, FontStyle.Bold), true); int count = lstString.Count(); if (count >= 2) { l_y += (posPrinter.GetHeightPrinterLine() / 6); } else { l_y += posPrinter.GetHeightPrinterLine() / 6; } } else { List <string> lstString = posPrinter.SplitStringLine(OrderMain.ListOrderDetail[i].ProductName, e, new Font("Courier New", 8, FontStyle.Bold), true); int count = lstString.Count(); if (count >= 2) { l_y += (posPrinter.GetHeightPrinterLine() / 6); } } } } l_y += posPrinter.GetHeightPrinterLine() / 5; posPrinter.DrawLine("", new Font("Courier New", 8), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); l_y += posPrinter.GetHeightPrinterLine() / 10; posPrinter.DrawString("SUB TOTAL:", e, new Font("Courier New", 12, FontStyle.Bold), l_y, 1, false, false); l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount)), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); l_y += posPrinter.GetHeightPrinterLine() / 10; posPrinter.DrawLine("", new Font("Courier New", 9), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); posPrinter.DrawString("G.S.T Content:", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); Double gst = Convert.ToDouble(OrderMain.TotalAmount) / 11000; if (gst < 1) { l_y = posPrinter.DrawString("$0" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount) / 11), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } else { l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount) / 11), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } //posPrinter.DrawLine("", new Font("Arial", 14), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); //posPrinter.DrawString("Total:", e, new Font("Arial", 10, FontStyle.Bold), l_y, 1); //l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount)), e, new Font("Arial", 10), l_y, 3); if (OrderMain.Discount > 0) { posPrinter.DrawString("Discount:", e, new Font("Courier New", 10, FontStyle.Bold), l_y, 1, false, false); l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.Discount), e, new Font("Courier New", 8), l_y, 3, false, false); posPrinter.DrawString("Total:", e, new Font("Courier New", 10, FontStyle.Bold), l_y, 1, false, false); l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.SubTotal() - OrderMain.Discount), e, new Font("Courier New", 8), l_y, 3, false, false); } else { //posPrinter.DrawString("Total:", e, new Font("Arial", 10, FontStyle.Bold), l_y, 1); //l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.SubTotal()), e, new Font("Arial", 10), l_y, 3); } //posPrinter.DrawString("GST(Include in total):", e, new Font("Arial", 10), l_y, 1); //l_y = posPrinter.DrawString("$1.0", e, new Font("Arial", 10), l_y, 3); if (OrderMain.ListPayment.Count > 0) { for (int j = 0; j < OrderMain.ListPayment.Count; j++) { if (OrderMain.ListPayment[j].PaymentTypeID == 1) { posPrinter.DrawString("Cash:", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); if (OrderMain.isPrevOrder == 1) { l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.ListPayment[j].Total), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } else { l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.ListPayment[j].Total * 1000), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } } if (OrderMain.ListPayment[j].PaymentTypeID == 2) { posPrinter.DrawString("Card:", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); if (OrderMain.isPrevOrder == 1) { l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.ListPayment[j].Total), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } else { l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.ListPayment[j].Total * 1000), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } if (OrderMain.ListInvoiceByCard.Count > 0) { for (int i = 0; i < OrderMain.ListInvoiceByCard.Count; i++) { posPrinter.DrawString("--" + OrderMain.ListInvoiceByCard[i].NameCard, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.ListInvoiceByCard[i].Total)), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } } } } } if (OrderMain.Change > 0) { posPrinter.DrawString("Change:", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.Change), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } if (OrderMain.CusItem.ClientID > 0) { posPrinter.DrawString("Account:", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.SubTotal())), e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); posPrinter.DrawString("AccountName:", e, new Font("Courier New", 8, FontStyle.Bold), l_y, 1, false, false); l_y = posPrinter.DrawString(OrderMain.CusItem.Fname, e, new Font("Courier New", 8, FontStyle.Bold), l_y, 3, false, false); } l_y += posPrinter.GetHeightPrinterLine() / 5; posPrinter.DrawLine("", new Font("Courier New", 8), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); l_y += posPrinter.GetHeightPrinterLine() / 5; l_y = posPrinter.DrawString(cofig.Web, e, new Font("Courier New", 12, FontStyle.Bold), l_y, 2, false, false); l_y = posPrinter.DrawString(cofig.Logan, e, new Font("Courier New", 12, FontStyle.Bold), l_y, 2, false, false); l_y = posPrinter.DrawString("Thank you!", e, new Font("Courier New", 12, FontStyle.Bold), l_y, 2, false, false); l_y = posPrinter.DrawString("See you again.", e, new Font("Courier New", 12, FontStyle.Bold), l_y, 2, false, false); }
public int SaveDataStaff(StaffModel data) { try { if (data.StaffID == 0) { var staffcheck = _context.STAFFs.Where(x => x.UserName == data.UserName).ToList(); if (staffcheck.Count > 0) { return -1; } var staff = new STAFF(); staff.Status = 1; staff.Fname = data.Fname; staff.Lname = data.Lname; staff.UserName = data.UserName; staff.Password = StaffModel.Encrypt(data.Password); staff.CreateBy = data.UpdateBy; staff.CreateDate = DateTime.Now; staff.UpdateBy = data.UpdateBy; staff.UpdateDate = DateTime.Now; staff.DepartmentID = data.DepartmentID; _context.Entry(staff).State = EntityState.Added; _context.SaveChanges(); return 1; } else { var staffcheck = _context.STAFFs.Where(x => x.UserName == data.UserName && x.StaffID!=data.StaffID).ToList(); if (staffcheck.Count > 0) { return -1; } var staff = _context.STAFFs.Find(data.StaffID); if (staff != null) { staff.Fname = data.Fname; staff.Lname = data.Lname; staff.UserName = data.UserName; staff.Password = StaffModel.Encrypt(data.Password); staff.UpdateBy = data.UpdateBy; staff.UpdateDate = DateTime.Now; staff.DepartmentID = data.DepartmentID; _context.Entry(staff).State = EntityState.Modified; _context.SaveChanges(); return 1; } return 0; } } catch (Exception ex) { LogPOS.WriteLog("SaveDataStaff :::::::::::::::::::::::::" + ex.Message); return 0; } }
//FUNCTION PRINT BILL private void PrintBill(PrintPageEventArgs e) { StaffModel staff = new ServicePOS.Model.StaffModel(); float l_y = 0; l_y = posPrinter.DrawString(cofig.Name, e, new Font("Arial", 10, FontStyle.Bold), l_y, 2, false); l_y = posPrinter.DrawString(cofig.ABN, e, new Font("Arial", 10, FontStyle.Bold), l_y, 2, false); l_y = posPrinter.DrawString(cofig.Address, e, new Font("Arial", 10, FontStyle.Italic), l_y, 2, false); l_y = posPrinter.DrawString(cofig.Tel, e, new Font("Arial", 10, FontStyle.Italic), l_y, 2, false); l_y += posPrinter.GetHeightPrinterLine() / 10; l_y = posPrinter.DrawLine("", new Font("Arial", 14), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); l_y = posPrinter.DrawString(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(), e, new Font("Arial", 10, FontStyle.Italic), l_y, 1, false); l_y = posPrinter.DrawString("Table# " + OrderMain.FloorID, e, new Font("Arial", 10, FontStyle.Italic), l_y, 1, false); l_y = posPrinter.DrawString("OPERATOR#" + OrderMain.UserName, e, new Font("Arial", 10, FontStyle.Italic), l_y, 1, false); posPrinter.DrawLine("", new Font("Arial", 14), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); l_y += posPrinter.GetHeightPrinterLine() / 10; l_y = posPrinter.DrawString(" TAX INVOICE", e, new Font("Arial", 10, FontStyle.Bold), l_y, 2, false); l_y += posPrinter.GetHeightPrinterLine() / 10; posPrinter.DrawLine("", new Font("Arial", 14), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); l_y += posPrinter.GetHeightPrinterLine() / 10; for (int i = 0; i < OrderMain.ListOrderDetail.Count; i++) { float yStart = l_y; posPrinter.DrawString(OrderMain.ListOrderDetail[i].ProductName, e, new Font("Arial", 10, FontStyle.Bold), l_y, 1, false); l_y = posPrinter.DrawString(OrderMain.ListOrderDetail[i].Qty.ToString(), e, new Font("Arial", 10, FontStyle.Bold), l_y, 2, false); posPrinter.DrawString("$" + money.Format2(OrderMain.ListOrderDetail[i].Price.ToString()), e, new Font("Arial", 10, FontStyle.Bold), yStart, 3, false); if (OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count > 0) { for (int j = 0; j < OrderMain.ListOrderDetail[i].ListOrderDetailModifire.Count; j++) { l_y = posPrinter.DrawString("__" + OrderMain.ListOrderDetail[i].ListOrderDetailModifire[j].ModifireName, e, new Font("Arial", 10), l_y, 1, false); } } } l_y += posPrinter.GetHeightPrinterLine() / 10; posPrinter.DrawLine("", new Font("Arial", 14), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); posPrinter.DrawString("Total:", e, new Font("Arial", 10, FontStyle.Bold), l_y, 1, false); l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount)), e, new Font("Arial", 10), l_y, 3, false); posPrinter.DrawLine("", new Font("Arial", 14), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); posPrinter.DrawString("G.S.T Content:", e, new Font("Arial", 10, FontStyle.Bold), l_y, 1, false); Double gst = Convert.ToDouble(OrderMain.TotalAmount) / 11000; if (gst < 1) { l_y = posPrinter.DrawString("$0" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount) / 11), e, new Font("Arial", 10), l_y, 3, false); } else { l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount) / 11), e, new Font("Arial", 10), l_y, 3, false); } //posPrinter.DrawLine("", new Font("Arial", 14), e, System.Drawing.Drawing2D.DashStyle.Dot, l_y, 1); //posPrinter.DrawString("Total:", e, new Font("Arial", 10, FontStyle.Bold), l_y, 1); //l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.TotalAmount)), e, new Font("Arial", 10), l_y, 3); if (OrderMain.Discount > 0) { posPrinter.DrawString("Discount:", e, new Font("Arial", 10, FontStyle.Bold), l_y, 1, false); l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.Discount), e, new Font("Arial", 10), l_y, 3, false); posPrinter.DrawString("Total:", e, new Font("Arial", 10, FontStyle.Bold), l_y, 1, false); l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.SubTotal() - OrderMain.Discount), e, new Font("Arial", 10), l_y, 3, false); } else { //posPrinter.DrawString("Total:", e, new Font("Arial", 10, FontStyle.Bold), l_y, 1); //l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.SubTotal()), e, new Font("Arial", 10), l_y, 3); } //posPrinter.DrawString("GST(Include in total):", e, new Font("Arial", 10), l_y, 1); //l_y = posPrinter.DrawString("$1.0", e, new Font("Arial", 10), l_y, 3); if (OrderMain.ListPayment.Count > 0) { for (int j = 0; j < OrderMain.ListPayment.Count; j++) { if (OrderMain.ListPayment[j].PaymentTypeID == 1) { posPrinter.DrawString("Cash:", e, new Font("Arial", 10), l_y, 1, false); if (OrderMain.isPrevOrder == 1) { l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.ListPayment[j].Total), e, new Font("Arial", 10), l_y, 3, false); } else { l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.ListPayment[j].Total * 1000), e, new Font("Arial", 10), l_y, 3, false); } } if (OrderMain.ListPayment[j].PaymentTypeID == 2) { posPrinter.DrawString("Card:", e, new Font("Arial", 10), l_y, 1, false); if (OrderMain.isPrevOrder == 1) { l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.ListPayment[j].Total), e, new Font("Arial", 10), l_y, 3, false); } else { l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.ListPayment[j].Total * 1000), e, new Font("Arial", 10), l_y, 3, false); } if (OrderMain.ListInvoiceByCard.Count > 0) { for (int i = 0; i < OrderMain.ListInvoiceByCard.Count; i++) { posPrinter.DrawString("--" + OrderMain.ListInvoiceByCard[i].NameCard, e, new Font("Arial", 10), l_y, 1, false); l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.ListInvoiceByCard[i].Total)), e, new Font("Arial", 10), l_y, 3, false); } } } } } if (OrderMain.Change > 0) { posPrinter.DrawString("Change:", e, new Font("Arial", 10), l_y, 1, false); l_y = posPrinter.DrawString("$" + money.Format2(OrderMain.Change), e, new Font("Arial", 10), l_y, 3, false); } if (OrderMain.CusItem.ClientID > 0) { posPrinter.DrawString("Account:", e, new Font("Arial", 10), l_y, 1, false); l_y = posPrinter.DrawString("$" + money.Format2(Convert.ToDouble(OrderMain.SubTotal())), e, new Font("Arial", 10), l_y, 3, false); posPrinter.DrawString("AccountName:", e, new Font("Arial", 10), l_y, 1, false); l_y = posPrinter.DrawString(OrderMain.CusItem.Fname, e, new Font("Arial", 10), l_y, 3, false); } l_y += posPrinter.GetHeightPrinterLine() / 2; l_y = posPrinter.DrawString(cofig.Web, e, new Font("Arial", 10), l_y, 2, false); l_y = posPrinter.DrawString(cofig.Logan, e, new Font("Arial", 10), l_y, 2, false); l_y = posPrinter.DrawString(cofig.Note, e, new Font("Arial", 10), l_y, 2, false); }