| | |
| | | InitializeComponent(); |
| | | // æ°å¢è¿è¡ï¼è®¾ç½®EPPlusç许å¯è¯ä¸ä¸æ |
| | | ExcelPackage.LicenseContext = OfficeOpenXml.LicenseContext.NonCommercial; |
| | | try |
| | | { |
| | | // 读åæä»¶ææè¡ |
| | | string[] lines = System.IO.File.ReadAllLines("D:\\æå°æºè½¦åè½´æ¿åçä¸ææ¡æä»¶å¤¹\\车å.txt"); |
| | | string[] lines2 = System.IO.File.ReadAllLines("D:\\æå°æºè½¦åè½´æ¿åçä¸ææ¡æä»¶å¤¹\\è½´æ¿åå·.txt"); |
| | | string[] lines3 = System.IO.File.ReadAllLines("D:\\æå°æºè½¦åè½´æ¿åçä¸ææ¡æä»¶å¤¹\\è½´æ¿åç.txt"); |
| | | |
| | | // æ·»å å°ä¸ææ¡ |
| | | this.comboBox3.Items.AddRange(lines2); |
| | | this.comboBox2.Items.AddRange(lines); |
| | | this.comboBox4.Items.AddRange(lines3); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // 读åå¤±è´¥æ¶æç¤º |
| | | MessageBox.Show("读åæä»¶å¤±è´¥ï¼" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void btn_print_Click(object sender, EventArgs e) |
| | |
| | | // MessageBox.Show("请è¾å
¥æå°æ°æ®", "æç¤º", MessageBoxButtons.OKCancel); |
| | | // return; |
| | | //} |
| | | Dictionary<string,string> printData = GetInputTxtData(); |
| | | Dictionary<string, string> printData = GetInputTxtData(); |
| | | |
| | | //if (printData.Count == 0) |
| | | //{ |
| | |
| | | // return; |
| | | //} |
| | | |
| | | |
| | | if (isInputError) |
| | | { |
| | | MessageBox.Show("è¾å
¥æ°æ®æè¯¯æè
ä¸å®æ´,请å
æ£æ¥ååæå°", "æç¤º", MessageBoxButtons.OK); |
| | | return; |
| | | } |
| | | |
| | | // è¿éå䏿æ¡çç»å® |
| | | if (comboBox1.Text == "" || comboBox2.Text == "" |
| | | || comboBox3.Text == "" || comboBox4.Text == "" |
| | | || textBox1.Text.Trim() == "" || textBox3.Text.Trim() == "") |
| | | { |
| | | MessageBox.Show("è¾å
¥æ°æ®æè¯¯æè
ä¸å®æ´,请å
æ£æ¥ååæå°", "æç¤º", MessageBoxButtons.OK); |
| | | return; |
| | | } |
| | | //string MFile = ReportPath + "\\FRX\\wl.frx";//FastReport设计åçæä»¶ä¿åçè·¯å¾ã |
| | | // æ¿æ¢åæ¥ç string MFile = ReportPath + "\\FRX\\wl.frx"; |
| | | string MFile = Path.Combine(ReportPath, "FRX", "wl.frx"); |
| | |
| | | string Row = "{"; |
| | | |
| | | Row += "'è½´æ¿æ¡ç ':"+$"'{Txt_barcode1.Text}',"; |
| | | Row += "'车å':"+$"'{Txt_barcode2.Text}',"; |
| | | Row += "'è½´æ¿åå·':"+$"'{Txt_barcode3.Text}',"; |
| | | Row += "'åå®¶':"+$"'{Txt_barcode4.Text}',"; |
| | | Row += "'车å':"+$"'{comboBox2.Text}',"; |
| | | Row += "'è½´æ¿åå·':"+$"'{comboBox3.Text}',"; |
| | | Row += "'è½´æ¿åç':"+$"'{comboBox4.Text}',"; |
| | | Row += "'è½´æ¿ç±»å«':"+$"'{comboBox1.Text}',"; |
| | | Row += "'è½´æ¿åå·':"+$"'{Txt_barcode6.Text}',"; |
| | | |
| | | Row += "'è½´æ¿æ¹æ¬¡å·':"+$"'{textBox1.Text}',"; |
| | | Row += "'è½´æ¿éé':" + $"'{textBox2.Text}',"; |
| | | Row += "'æ¥æ':" + $"'{textBox3.Text}',"; |
| | | Row += "}"; |
| | | |
| | | partCode.Add(Txt_barcode1.Text, Row); |
| | |
| | | { |
| | | errorProvider1.SetError(textBox, ""); // æ¸
é¤é误æç¤º |
| | | isInputError = false; |
| | | } |
| | | |
| | | if (comboBox1.Text == "") |
| | | { |
| | | isInputError = true; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | //è½½å
¥æ¶ä¸ºæ¯ä¸ªè¾å
¥æ¡ 订é
ææ¬æ ¡éªäºä»¶ |
| | | Txt_barcode1.Validating += new CancelEventHandler(Validaltetion); |
| | | Txt_barcode2.Validating += new CancelEventHandler(Validaltetion); |
| | | Txt_barcode3.Validating += new CancelEventHandler(Validaltetion); |
| | | Txt_barcode4.Validating += new CancelEventHandler(Validaltetion); |
| | | //Txt_barcode2.Validating += new CancelEventHandler(Validaltetion); |
| | | //Txt_barcode3.Validating += new CancelEventHandler(Validaltetion); |
| | | //Txt_barcode4.Validating += new CancelEventHandler(Validaltetion); |
| | | textBox1.Validating += new CancelEventHandler(Validaltetion); |
| | | textBox2.Validating += new CancelEventHandler(Validaltetion); |
| | | //Txt_barcode5.Validating += new CancelEventHandler(ValidateTextBox); |
| | | Txt_barcode6.Validating += new CancelEventHandler(Validaltetion); |
| | | //Txt_barcode6.Validating += new CancelEventHandler(Validaltetion); |
| | | //Txt_barcode7.Validating += new CancelEventHandler(ValidateTextBox); |
| | | //Txt_barcode8.Validating += new CancelEventHandler(ValidateTextBox); |
| | | //Txt_barcode9.Validating += new CancelEventHandler(ValidateTextBox); |
| | |
| | | |
| | | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) |
| | | { |
| | | if(comboBox1.Text != "") |
| | | { |
| | | isInputError = false; |
| | | } |
| | | |
| | | } |
| | | |
| | | private void groupBox2_Enter(object sender, EventArgs e) |