| | |
| | | public bool grdStatus; |
| | | public int selectRow = 0; |
| | | |
| | | //è®°å½å½åç»æçæ¡ç çæºåIDãåIDï¼ç¨äºä¿è¯å½åæä¸ææåæ¡ç 为åä¸ä¸ªå·¥åçæ |
| | | public int HSourceInterID_ICMO = 0; |
| | | public int HSourceEntryID_ICMO = 0; |
| | | |
| | | private void Gy_PackBarCodeBill_automaticallyByPLC_Load(object sender, EventArgs e) |
| | | { |
| | | //å è½½ç»ç»ä¿¡æ¯ |
| | |
| | | DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name + "grdSub"); |
| | | |
| | | getDisplay_GrdMain(); |
| | | |
| | | if (grdMain.Rows.Count > 0 && grdMain.Rows[0].Cells[4].Value!=null) |
| | | { |
| | | getPackQty(grdMain.Rows[0].Cells[4].Value.ToString()); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | return; |
| | | } |
| | | this.Sub_SaveBill(); |
| | | }catch(Exception ex) |
| | | |
| | | //ç»ææååï¼æ¸
ç©ºç»ææ°é䏿ºåä¿¡æ¯ |
| | | set_clearPackQtyAndSourceInfo(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | |
| | | //èªå¨ç»æ |
| | | private void button_startListen_Click(object sender, EventArgs e) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(textBox_PackQty.Text) == 0) |
| | | { |
| | | MessageBox.Show("è¯·è®¾ç½®ææ¡ç çæå°å
è£
æ°ï¼"); |
| | | return; |
| | | } |
| | | //if (DBUtility.ClsPub.isLong(textBox_PackQty.Text) == 0) |
| | | //{ |
| | | // MessageBox.Show("è¯·è®¾ç½®ææ¡ç çæå°å
è£
æ°ï¼"); |
| | | // return; |
| | | //} |
| | | |
| | | isStartListen = 1; |
| | | |
| | |
| | | Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(é»è®¤)", ""); |
| | | } |
| | | Report.Print(false); |
| | | |
| | | //ç»ææååï¼æ¸
ç©ºç»ææ°é䏿ºåä¿¡æ¯ |
| | | set_clearPackQtyAndSourceInfo(); |
| | | } |
| | | }catch(Exception ex) |
| | | { |
| | |
| | | { |
| | | if (e.KeyChar == (char)Keys.Return) |
| | | { |
| | | //é²é夿 |
| | | if(!judgeIsSameSourceBill(textBox_HBarCode.Text.Trim())) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | SetBarCode_Webs(); |
| | | textBox_HBarCode.Text = ""; |
| | | textBox_HBarCode.Focus(); |
| | | |
| | | autoProducePackBarCode(); |
| | | |
| | | if (grdMain.Rows.Count ==1 ) |
| | | { |
| | | getPackQty(grdMain.Rows[0].Cells[4].Value.ToString()); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e2) |
| | |
| | | private void toolStripButton_Delete_Click(object sender, EventArgs e) |
| | | { |
| | | deleteGrdMainNote(); |
| | | |
| | | if (grdMain.Rows.Count== 0) |
| | | { |
| | | set_clearPackQtyAndSourceInfo(); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | |
| | | Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(é»è®¤)", ""); |
| | | } |
| | | Report.Print(false); |
| | | |
| | | //ç»ææååï¼æ¸
ç©ºç»ææ°é䏿ºåä¿¡æ¯ |
| | | set_clearPackQtyAndSourceInfo(); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | textBox_sBillNo.Text = HBillNo; |
| | | |
| | | getDisplay_GrdMain(); |
| | | |
| | | if (grdMain.Rows.Count > 0 && grdMain.Rows[0].Cells[4].Value != null) |
| | | { |
| | | getPackQty(grdMain.Rows[0].Cells[4].Value.ToString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region æ ¹æ®æ¡ç ç¼å·ï¼è·åæ¡ç ä¸ç©ææå¯¹åºçç»ææ°éï¼åæ¶è®°å½æºå主IDãåID |
| | | private void getPackQty(string HBarCode) |
| | | { |
| | | string sql = "select * from h_v_IF_BarCodeBillList_getPackQty where æ¡ç ç¼å· = '" + HBarCode + "'"; |
| | | DataSet ds_getPackQty = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList_getPackQty"); |
| | | if (ds_getPackQty == null || ds_getPackQty.Tables[0].Rows.Count <= 0) |
| | | { |
| | | HSourceInterID_ICMO = 0; |
| | | HSourceEntryID_ICMO = 0; |
| | | |
| | | textBox_PackQty.Text = ""; |
| | | } |
| | | |
| | | HSourceInterID_ICMO = int.Parse(ds_getPackQty.Tables[0].Rows[0]["HSourceInterID"].ToString()); |
| | | HSourceEntryID_ICMO = int.Parse(ds_getPackQty.Tables[0].Rows[0]["HSourceEntryID"].ToString()); |
| | | textBox_PackQty.Text = ds_getPackQty.Tables[0].Rows[0]["ç»ææ°é"].ToString(); |
| | | } |
| | | #endregion |
| | | |
| | | #region 夿å½åæ«æçæ¡ç æ¯å¦ä¸å·²ç»æ«æè¿çæ¡ç 为åä¸å·¥åçæç |
| | | private bool judgeIsSameSourceBill(string HBarCode) |
| | | { |
| | | if (grdMain.Rows.Count == 0) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | string sql = "select * from h_v_IF_BarCodeBillList_getPackQty where æ¡ç ç¼å· = '" + HBarCode + "'"; |
| | | DataSet ds_getPackQty = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList_getPackQty"); |
| | | if (ds_getPackQty == null || ds_getPackQty.Tables[0].Rows.Count <= 0) |
| | | { |
| | | MessageBox.Show("å½åæ¡ç ä¸åå¨ï¼"); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | int HSourceInterID_ICMO_Bak = int.Parse(ds_getPackQty.Tables[0].Rows[0]["HSourceInterID"].ToString()); |
| | | int HSourceEntryID_ICMO_Bak = int.Parse(ds_getPackQty.Tables[0].Rows[0]["HSourceEntryID"].ToString()); |
| | | if (HSourceInterID_ICMO != HSourceInterID_ICMO_Bak || HSourceEntryID_ICMO != HSourceEntryID_ICMO_Bak) |
| | | { |
| | | MessageBox.Show("å½åæ«æçæ¡ç ä¸ä¹åææ«æçæ¡ç å·¥åä¸ä¸è´ï¼"); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¸
空 ç»ææ°é ä¸è®°å½çæºå主IDãåID |
| | | private void set_clearPackQtyAndSourceInfo() |
| | | { |
| | | textBox_PackQty.Text = ""; |
| | | HSourceInterID_ICMO = 0; |
| | | HSourceEntryID_ICMO = 0; |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | | |