| | |
| | | public const Int16 HCode1Col = 20; |
| | | public const Int16 HCode2Col = 21; |
| | | public const Int16 HCode3Col = 22; |
| | | public const Int16 HQtyCol = 23; |
| | | public const Int16 HMinQtyCol = 24; |
| | | public const Int16 HBQtyCol = 25; |
| | | public const Int16 HProduceDateCol = 26; |
| | | public const Int16 HExpiryDateCol = 27; |
| | | public const Int16 HCusIDCol = 28; |
| | | public const Int16 HCusNumberCol = 29; |
| | | public const Int16 HCusNameCol = 30; |
| | | public const Int16 HSourceInterIDCol = 31; |
| | | public const Int16 HSourceEntryIDCol = 32; |
| | | public const Int16 HSourceBillNoCol = 33; |
| | | public const Int16 HSourceBillTypeCol = 34; |
| | | public const Int16 HRemarkCol = 35; |
| | | public const Int16 HInitQtyCol = 36; |
| | | public const Int16 HMTONoCol = 37; |
| | | public const Int16 HISKFPERIODCol = 38; |
| | | public const Int16 HEXPUNITCol = 39; |
| | | public const Int16 HEXPPERIODCol = 40; |
| | | public const Int16 HLSHCol = 41; |
| | | public const Int16 HBaNoCol = 42; |
| | | public const Int16 HInnerBillNoCol = 23; |
| | | public const Int16 HQtyCol = 24; |
| | | public const Int16 HMinQtyCol = 25; |
| | | public const Int16 HBQtyCol = 26; |
| | | public const Int16 HProduceDateCol = 27; |
| | | public const Int16 HExpiryDateCol = 28; |
| | | public const Int16 HCusIDCol = 29; |
| | | public const Int16 HCusNumberCol = 30; |
| | | public const Int16 HCusNameCol = 31; |
| | | public const Int16 HSourceInterIDCol = 32; |
| | | public const Int16 HSourceEntryIDCol = 33; |
| | | public const Int16 HSourceBillNoCol = 34; |
| | | public const Int16 HSourceBillTypeCol = 35; |
| | | public const Int16 HRemarkCol = 36; |
| | | public const Int16 HInitQtyCol = 37; |
| | | public const Int16 HMTONoCol = 38; |
| | | public const Int16 HISKFPERIODCol = 39; |
| | | public const Int16 HEXPUNITCol = 40; |
| | | public const Int16 HEXPPERIODCol = 41; |
| | | public const Int16 HLSHCol = 42; |
| | | public const Int16 HBaNoCol = 43; |
| | | // |
| | | public string ModName = "85"; |
| | | public string ModCaption = "å®¢æ·æ ç¾çæ"; |
| | |
| | | public bool grdStatus; |
| | | public int selectRow = 0; |
| | | public Int64 HInterID = 0; //å
ç |
| | | public Int64 HOrgID = -1; |
| | | public string HOrgNumber = ""; |
| | | public Int64 HOrgID = ClsPub.HOrgID; |
| | | public string HCusModel = "Z"; //åå代ç |
| | | public string sDate = ""; //æ¥æ |
| | | public string sYear = ""; //å¹´ |
| | |
| | | cmbHBarCodeType.Items.Add("å¤ç®±ç "); |
| | | //æºåç±»å |
| | | cmbSourceBillType.Items.Add("çäº§æ±æ¥å"); |
| | | // |
| | | |
| | | DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp); |
| | | //è·åç»ç» |
| | | //è·åå½åç»ç» |
| | | DataSet Ds1 = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS with(nolock) where HItemID=" + ClsPub.HOrgID, "Xt_ORGANIZATIONS", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (Ds1.Tables[0].Rows.Count != 0) |
| | | { |
| | | cmbHOrgID.Text = DBUtility.ClsPub.isStrNull(Ds1.Tables[0].Rows[0]["HName"]); |
| | | } |
| | | // |
| | | |
| | | txtHMaker.Text = ClsPub.CurUserName; |
| | | txtHMakeDate.Text = ""; |
| | | txtHChecker.Text = ""; |
| | |
| | | MessageBox.Show("è·åç»ç»å¤±è´¥"); |
| | | return; |
| | | } |
| | | cmbHOrgID.DataSource = null; |
| | | cmbHOrgID.Items.Clear(); |
| | | for (int i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | { |
| | | cmbHOrgID.Items.Add(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HName"])); |
| | | } |
| | | cmbHOrgID.DataSource = ds.Tables[0]; |
| | | cmbHOrgID.DisplayMember = "HName"; |
| | | cmbHOrgID.ValueMember = "HItemID"; |
| | | } |
| | | |
| | | //å 载客æ·ä¿¡æ¯ |
| | | private void Sub_AddHCusNameList() |
| | | { |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_Cus ", "h_p_Gy_CusBarCodeBill_Cus"); |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_Cus " + HOrgID.ToString(), "h_p_Gy_CusBarCodeBill_Cus"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | cmbHCusName.DataSource = null; |
| | | cmbHCusName.Items.Clear(); |
| | | MessageBox.Show("è·å客æ·ä¿¡æ¯å¤±è´¥"); |
| | | return; |
| | | } |
| | | cmbHCusName.DataSource = null; |
| | | cmbHCusName.Items.Clear(); |
| | | cmbHCusName.DataSource = ds.Tables[0]; |
| | | cmbHCusName.DisplayMember = "HName"; |
| | |
| | | { |
| | | //è·åå
ç |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //è·åç»ç»ä¿¡æ¯ |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | HOrgNumber = ""; |
| | | if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) |
| | | { |
| | | HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; |
| | | HOrgNumber = DBUtility.ClsPub.isStrNull(oClsGy_ORGANIZATIONS_View.omodel.HNumber); |
| | | } |
| | | if (HOrgID == -1) |
| | | { |
| | | MessageBox.Show("éæ©ç»ç»æé误ï¼"); |
| | | return false; |
| | | } |
| | | |
| | | lblCaption.Focus(); |
| | | //çææ¡ç åæ§å¶ |
| | | if (!Sub_AllowSave()) |
| | |
| | | string HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value); // çæ¬å· |
| | | string HBatchNoNumber = HCode1 + sYear + sPeriod + sDay + HCusModel; // æ¹æ¬¡çæåç¼ |
| | | HBatchNoNumber = HBatchNoNumber.ToUpper(); |
| | | string HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text); // æ¡ç ç±»å |
| | | string HInnerBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HInnerBillNoCol].Value); // 客æ·è®¢åå· |
| | | |
| | | if (HMaterID != 0) |
| | | { |
| | | DataSet oDsCheck = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_AddCheck " + HSno.ToString() + ",'" + HSourceBillNo + "'," + HMaterID.ToString() + "," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + ",'" + HCusModelName + "','" + HCode1 + "','" + HCode2 + "','" + HCode3 + "','" + HBatchNoNumber + "'", "h_p_Gy_CusBarCodeBill_AddCheck"); |
| | | DataSet oDsCheck = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_AddCheck " + HSno.ToString() + ",'" + HSourceBillNo + "'," + HMaterID.ToString() + "," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + ",'" + HCusModelName + "','" + HCode1 + "','" + HCode2 + "','" + HCode3 + "','" + HBatchNoNumber + "','" + HBarCodeType + "','" + HInnerBillNo + "'", "h_p_Gy_CusBarCodeBill_AddCheck"); |
| | | // |
| | | if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | string HSourceBillType = "";//æºåç±»å |
| | | string HMTONo = ""; //MTOå· |
| | | string HRemark = ""; //夿³¨ |
| | | string HInnerBillNo = ""; //客æ·è®¢åå· |
| | | string HSno = ""; //æ¹æ¬¡åºåå· |
| | | string HBoxNo = ""; //æ¹æ¬¡çæåç¼ |
| | | string sHBaNo = ""; //çé¢ä¸è¾å
¥çæ¹æ¬¡ä½ |
| | |
| | | HSourceBillType = ClsPub.isStrNull(grdMain.Rows[j].Cells[HSourceBillTypeCol].Value); |
| | | HRemark = ClsPub.isStrNull(grdMain.Rows[j].Cells[HRemarkCol].Value); |
| | | HMTONo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HMTONoCol].Value); |
| | | HInnerBillNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HInnerBillNoCol].Value); |
| | | HCode1 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode1Col].Value).ToUpper(); |
| | | HCode2 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode2Col].Value).ToUpper(); |
| | | HCode3 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value).ToUpper(); |
| | | HSno = ClsPub.isStrNull(LSH); |
| | | HBoxNo = HCode1 + sYear + sPeriod + sDay + HCusModel; |
| | | HBoxNo = HBoxNo.ToUpper(); |
| | | sHBaNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBaNoCol].Value); // çé¢ä¸è¾å
¥çæ¹æ¬¡ä½ |
| | | sHBaNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HBaNoCol].Value); // çé¢ä¸è¾å
¥çæ¹æ¬¡ä½ |
| | | |
| | | //å®¢æ·æå·HCusModelNameãç©æç±»å«HCode1ãæ¹æ¬¡ä½HCode2ãçæ¬å·HCode3ãæ¹æ¬¡åºåå·HSnoãæ¹æ¬¡çæåç¼HBoxNoãåå代ç HCusModelãçé¢ä¸è¾å
¥çæ¹æ¬¡ä½HSupNameã36è¿å¶æ¹æ¬¡åºåå·HSupNumber |
| | | //å®¢æ·æå·HCusModelNameãç©æç±»å«HCode1ãæ¹æ¬¡ä½HCode2ãçæ¬å·HCode3ãæ¹æ¬¡åºåå·HSnoãæ¹æ¬¡çæåç¼HBoxNoãåå代ç HCusModel |
| | | //çé¢ä¸è¾å
¥çæ¹æ¬¡ä½HSupNameã36è¿å¶æ¹æ¬¡åºåå·HSupNumberã客æ·è®¢åå·HInnerBillNo |
| | | oCn.RunProc("insert into Gy_BarCodeBill_Cus" + |
| | | "(HInterID,HEntryID,HBillType,HBarCode,HBarCodeType" + |
| | | ",HMaterID,HUnitID,HAuxPropID,HBatchNo,HQty" + |
| | |
| | | + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'" |
| | | + ",0,'','" + HRemark + "'," + HOrgID.ToString() + "," + HOrgID.ToString() |
| | | + ",'" + ClsPub.CurUserName + "',getdate(),'','','" + HMTONo + "'" |
| | | + ",0,'','',''" |
| | | + ",0,'','','" + HInnerBillNo + "'" |
| | | + ",'','','" + LSH2 + "','" + sHBaNo + "','" + HCode1 + "'" |
| | | + ",'" + HCode2 + "','" + HCode3 + "','','" + HSno + "','" + HBoxNo + "')"); |
| | | n = n + 1; |
| | |
| | | private void initGrid() |
| | | { |
| | | grdMain.RowCount = 0; |
| | | grdMain.ColumnCount = 43; //æ»åæ° |
| | | grdMain.ColumnCount = 44; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name); |
| | | grdMain.Columns[HSnoCol].HeaderText = "åºå·"; |
| | | grdMain.Columns[HMainIDCol].HeaderText = "æºå主ID"; |
| | |
| | | grdMain.Columns[HCode1Col].HeaderText = "ç©æç±»å«"; |
| | | grdMain.Columns[HCode2Col].HeaderText = "æ¹æ¬¡ä½"; |
| | | grdMain.Columns[HCode3Col].HeaderText = "çæ¬å·"; |
| | | grdMain.Columns[HInnerBillNoCol].HeaderText = "客æ·è®¢åå·"; |
| | | |
| | | //æ ¼å¼å éèå |
| | | grdMain.Columns[HTagCol].Visible = false; |
| | |
| | | "," + HCode1Col.ToString() + |
| | | //"," + HCode2Col.ToString() + |
| | | "," + HCode3Col.ToString() + |
| | | "," + HInnerBillNoCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | |
| | | //设置å计å |
| | |
| | | //帮å©å½æ° |
| | | private void Sub_GridKey(int sKeyCode, int sRow, int sCol, DataGridViewTextBoxEditingControl oEdit) |
| | | { |
| | | long sHOrgID = -1; |
| | | string sWhere = ""; |
| | | |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) |
| | | { |
| | | sHOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; |
| | | } |
| | | if (sHOrgID == -1) |
| | | { |
| | | MessageBox.Show("éæ©ç»ç»æé误ï¼"); |
| | | return; |
| | | } |
| | | DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View();//ç©æ |
| | | DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_Unit_View();//计éåä½ |
| | | DAL.ClsIF_Property_View oProperty = new DAL.ClsIF_Property_View();//è¾
å©å±æ§ |
| | |
| | | { |
| | | case HMaterNumberCol: |
| | | oMater.WherePart = ""; |
| | | sWhere = " and HUSEORGID = " + sHOrgID; |
| | | sWhere = " and HUSEORGID = " + HOrgID; |
| | | if (oMater.RefreshViewForBig(sWhere)) |
| | | { |
| | | if (oMater.GetInfoByID(oMater.oModel.HItemID)) |
| | |
| | | |
| | | private void cmdSourceBillNo_Click(object sender, EventArgs e) |
| | | { |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) |
| | | { |
| | | HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; |
| | | } |
| | | if (HOrgID == -1) |
| | | { |
| | | MessageBox.Show("éæ©ç»ç»æé误ï¼"); |
| | | return; |
| | | } |
| | | |
| | | if (cmbSourceBillType.Text.Trim() == "çäº§æ±æ¥å") |
| | | { |
| | | string sWhere = " and HOrgID =" + HOrgID.ToString(); |
| | |
| | | "," + HCode1Col.ToString() + |
| | | //"," + HCode2Col.ToString() + |
| | | "," + HCode3Col.ToString() + |
| | | "," + HInnerBillNoCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | grdMain.Columns[HBillNoCol].ReadOnly = true; |
| | | //设置å计å |
| | |
| | | { |
| | | if (e.KeyChar == (char)Keys.Return)//åè½¦å¸¦åºæºåä¿¡æ¯ |
| | | { |
| | | long sHOrgID = -1; |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) |
| | | { |
| | | sHOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; |
| | | } |
| | | |
| | | if (txtHSourceBillNo.Text.Length < 4) |
| | | { |
| | | MessageBox.Show("请è¾å
¥4ä½ä»¥ä¸æ°æ®ï¼"); |
| | |
| | | if (cmbSourceBillType.Text.Trim() == "çäº§æ±æ¥å") |
| | | { |
| | | DAL.Cls_S_IF_ICMOReportBillList_CusBarCodeBill oIF_ICMOReportBillList = new DAL.Cls_S_IF_ICMOReportBillList_CusBarCodeBill(); |
| | | if (oIF_ICMOReportBillList.RefreshBySourceBillNo(" Where åæ®å· like '%" + txtHSourceBillNo.Text + "' ")) //éæ©åå |
| | | if (oIF_ICMOReportBillList.RefreshBySourceBillNo(" Where åæ®å· like '%" + txtHSourceBillNo.Text + "' and HOrgID =" + HOrgID.ToString())) //éæ©åå |
| | | { |
| | | FillSelectData(oIF_ICMOReportBillList.oBillSelectColl); |
| | | txtHSourceBillNo.Text = ""; |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region éæ©ç»ç» |
| | | private void cmbHOrgID_SelectionChangeCommitted(object sender, EventArgs e) |
| | | { |
| | | HOrgID = ClsPub.isLong(cmbHOrgID.SelectedValue); |
| | | //å 载客æ·ä¿¡æ¯ |
| | | Sub_AddHCusNameList(); |
| | | //æ¸
空åå§åå表 |
| | | initGrid(); |
| | | grdMain.Columns[HBillNoCol].ReadOnly = false; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |