private void btnInvoicePrintLine_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.PrintLine(this.txtInvoicePrintText.Text.Trim(), msg); this.lbInvoiceHint.Text = "打印一行返回code:" + i + "返回msg:" + msg; }
private void btnInvoiceCancelPaper_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.MovePaper(0 - Convert.ToInt32(this.txtInvoicePaperMoveDistance.Text.Trim()), msg); this.lbInvoiceHint.Text = "退纸返回code:" + i + "返回msg:" + msg; }
private void btnInvoiceSettingFont_Click(object sender, EventArgs e) { string style = ""; if (this.cbInvoiceBolder.Checked) { style += "|" + this.cbHotBolder.Tag.ToString(); } if (this.cbInvoiceCharB.Checked) { style += "|" + this.cbHotCharB.Tag.ToString(); } if (this.cbInvoiceDoubleHeight.Checked) { style += "|" + this.cbHotDoubleHeight.Tag.ToString(); } if (this.cbInvoiceDoubleWidth.Checked) { style += "|" + this.cbHotDoubleWeight.Tag.ToString(); } if (this.cbInvoiceUnderLine.Checked) { style += "|" + this.cbHotUnderLine.Tag.ToString(); } style = style.TrimStart('|'); if (style.Length > 0) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.SetTextStyle(style, msg); this.lbInvoiceHint.Text = "设置字体返回code:" + i + "返回msg:" + msg; } }
private void btnInvoicePositionBlackMark_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.BlackMarkIdentify(msg); this.lbInvoiceHint.Text = "定位黑标位置返回code:" + i + "返回msg:" + msg; }
private void btnInvoiceRowDistance_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.SetRowDistance(Convert.ToInt32(this.txtInvoiceRowDistance.Text.Trim()), msg); this.lbInvoiceHint.Text = "设置行间距返回code:" + i + "返回msg:" + msg; }
private void btnInvoiceGetState_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.GetDeviceStatus(msg); this.lbInvoiceHint.Text = "获取设备状态返回code:" + i + "返回msg:" + msg; }
private void btnInvoiceCutPaper_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int flag = this.rbtnInvoiceBlackSettingCut.Checked == true ? 0 : 1; int i = InvoicePrinterImporter.CutPaper(flag, msg); this.lbInvoiceHint.Text = "切纸返回code:" + i + "返回msg:" + msg; }
private void btnInvoiceBlackOffSet_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.SetBlackOffset(Convert.ToInt32(this.txtInvoiceLength.Text) , Convert.ToInt32(this.txtInvoiceBlackMarkPosition.Text) , Convert.ToInt32(this.txtInvoicePrintPostion.Text), msg); this.lbInvoiceHint.Text = "设置黑标位置返回code:" + i + "返回msg:" + msg; }
private void btnInvoiceCloseDevice_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.CloseDevice(msg); this.lbInvoiceHint.Text = "关闭设备返回code:" + i + "返回msg:" + msg; if (i == 0) { this.EnabledButton(this.tabControl1.TabPages[2], this.btnInvoiceOpenDevice, false); } }
private void btnInvoiceOpenDevice_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int i = InvoicePrinterImporter.OpenDevice(Convert.ToInt32(this.txtInvoicePort.Text.Trim()), msg); this.lbInvoiceHint.Text = "打开设备返回code:" + i + "返回msg:" + msg; if (i == 0) { this.EnabledButton(this.tabControl1.TabPages[2], this.btnInvoiceOpenDevice, true); } }