| | |
| | | public Int64 HInterID = 0; //å
ç |
| | | public Int64 HOrgID = -1; |
| | | public string HOrgNumber = ""; |
| | | public string ERPMode = ""; //ERP模å¼ï¼WISEãCLOUDï¼ |
| | | public string CampanyName = ""; //客æ·å®å¶ååç§° |
| | | public string SourceQtyCtl = ""; //è¶
æºåæ°éæ§å¶ |
| | | //------------------------------------------------------------------------- |
| | |
| | | } |
| | | else |
| | | { |
| | | ERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode; |
| | | CampanyName = oSystemParameter.omodel.WMS_CampanyName; |
| | | SourceQtyCtl = oSystemParameter.omodel.BarCode_SourceQtyCtl; |
| | | } |
| | |
| | | grdSub.RowCount = 0; |
| | | grdMain.ColumnCount = 60; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name); |
| | | grdMain.Columns[HSnoCol].HeaderText = "åºå·"; |
| | | grdMain.Columns[HMainIDCol].HeaderText = "æºå主ID"; |
| | | grdMain.Columns[HSubIDCol].HeaderText = "æºååID"; |
| | | grdMain.Columns[HBillNoCol].HeaderText = "æºååå·"; |
| | |
| | | grdMain.Columns[HInnerBillNoCol].HeaderText = "å
é¨éè´è®¢åå·"; |
| | | grdMain.Columns[HMakerCol].HeaderText = "å¶å人"; |
| | | //// |
| | | grdMain.Columns[HSnoCol].HeaderText = "åºå·"; |
| | | //æ ¼å¼å |
| | | grdMain.Columns[HTagCol].Visible = false; //éèå |
| | | grdMain.Columns[HMainIDCol].Visible = false; |
| | |
| | | grdMain.Columns[HModelCol].Visible = false; |
| | | //grdMain.Columns[HBatchNoCol].Visible = false; |
| | | grdMain.Columns[HAuxPropIDCol].Visible = false; |
| | | grdMain.Columns[HAuxPropNumberCol].Visible = false; |
| | | grdMain.Columns[HAuxPropNameCol].Visible = false; |
| | | //grdMain.Columns[HAuxPropNumberCol].Visible = false; |
| | | //grdMain.Columns[HAuxPropNameCol].Visible = false; |
| | | grdMain.Columns[HUnitIDCol].Visible = false; |
| | | grdMain.Columns[HinitQtyCol].Visible = false; |
| | | grdMain.Columns[HSupIDCol].Visible = false; |
| | |
| | | grdSub.Columns[HMaterID2Col].Visible = false; |
| | | grdSub.Columns[HModel2Col].Visible = false; |
| | | grdSub.Columns[HAuxPropID2Col].Visible = false; |
| | | grdSub.Columns[HAuxPropNumber2Col].Visible = false; |
| | | grdSub.Columns[HAuxPropName2Col].Visible = false; |
| | | //grdSub.Columns[HAuxPropNumber2Col].Visible = false; |
| | | //grdSub.Columns[HAuxPropName2Col].Visible = false; |
| | | grdSub.Columns[HUnitID2Col].Visible = false; |
| | | grdSub.Columns[HPrintCol].Visible = false; |
| | | grdSub.Columns[HSourceInterID2Col].Visible = false; |
| | |
| | | } |
| | | 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();//è¾
å©å±æ§ |
| | | if (!grdStatus) |
| | | { |
| | | return; |
| | |
| | | grdMain.Rows[sRow].Cells[HMinQtyCol].Value = oMater.omodel.HQtyMin; |
| | | grdMain.Rows[sRow].Cells[HDateCol].Value = dtpHDate.Value.ToShortDateString(); |
| | | grdMain.Rows[sRow].Cells[HShowDateCol].Value = dtpHDate.Value.ToShortDateString(); |
| | | grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = 0; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = ""; |
| | | if (oUnit.GetInfoByID(oMater.omodel.HUnitID)) |
| | | { |
| | | grdMain.Rows[sRow].Cells[HUnitIDCol].Value = oUnit.omodel.HItemID.ToString(); |
| | |
| | | grdMain.Rows[sRow].Cells[HUnitIDCol].Value = 0; |
| | | grdMain.Rows[sRow].Cells[HUnitNumberCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HUnitNameCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = 0; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = ""; |
| | | } |
| | | } |
| | | else |
| | |
| | | grdMain.Rows[sRow].Cells[HMaterModelCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HMinQtyCol].Value = 0; |
| | | grdMain.Rows[sRow].Cells[HUnitIDCol].Value = 0; |
| | | grdMain.Rows[sRow].Cells[HUnitNumberCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HUnitNameCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = 0; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = ""; |
| | | } |
| | | break; |
| | | |
| | |
| | | case HDateCol: |
| | | BLL.ClsPub_BLL.Sub_SelectDate(grdMain, sRow, HDateCol); |
| | | oEdit.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[sRow].Cells[HDateCol].Value); |
| | | break; |
| | | |
| | | case HAuxPropNumberCol: |
| | | oProperty.WherePart = ""; |
| | | if (ERPMode == "CLOUD") |
| | | { |
| | | sWhere = " and HMaterNumber = '" + DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.CurrentCell.RowIndex].Cells[HMaterNumberCol].Value) + "'"; |
| | | } |
| | | else |
| | | { |
| | | sWhere = ""; |
| | | } |
| | | if (oProperty.RefreshView(sWhere)) |
| | | { |
| | | grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = oProperty.oModel.HItemID.ToString(); |
| | | grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = oProperty.oModel.HNumber; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = oProperty.oModel.HName; |
| | | oEdit.Text = oProperty.oModel.HNumber; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[sRow].Cells[HAuxPropIDCol].Value = 0; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNumberCol].Value = ""; |
| | | grdMain.Rows[sRow].Cells[HAuxPropNameCol].Value = ""; |
| | | } |
| | | break; |
| | | |
| | | |
| | |
| | | grdMain.Rows.Add(); |
| | | Application.DoEvents(); |
| | | //å¾å°ä¿¡æ¯ |
| | | Ds = oCn.RunProcReturn("select * from h_v_KF_ICInventoryList_IF where hmaterid=" + oSelectRow.BillMainID + " and hwhid=" + oSelectRow.BillSubID + " and hspid=" + oSelectRow.SPID + " and æ¹æ¬¡='" + oSelectRow.BatchNo + "' and 计åè·è¸ªå·='" + oSelectRow.BillNo + "'", "h_v_KF_ICInventoryList_IF"); |
| | | Ds = oCn.RunProcReturn("select * from h_v_KF_ICInventoryList_IF where hmaterid=" + oSelectRow.BillMainID + " and hwhid=" + oSelectRow.BillSubID + " and hspid=" + oSelectRow.SPID + " and HAuxPropID=" + oSelectRow.HAuxPropID + " and æ¹æ¬¡='" + oSelectRow.BatchNo + "' and 计åè·è¸ªå·='" + oSelectRow.BillNo + "'", "h_v_KF_ICInventoryList_IF"); |
| | | //åå
¥ä¿¡æ¯ |
| | | Sub_WriteInForm2(Ds.Tables[0], i); |
| | | } |
| | |
| | | //grdMain.Rows[i].Cells[HSourceNumberCol].Value = oTable.Rows[0]["ç产线代ç "].ToString(); |
| | | grdMain.Rows[i].Cells[HSourceNameCol].Value = oTable.Rows[0]["ç产线"].ToString(); |
| | | grdMain.Rows[i].Cells[HEndDateCol].Value = oTable.Rows[0]["计åå®å·¥æ¥æ"].ToString(); |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["æå°å
è£
æ°"].ToString(); |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["æå°å
è£
æ°"].ToString(); |
| | | //-- |
| | | //设置å¯ç¼è¾å |
| | | string sAllowCol = HQtyCol.ToString() + |
| | | "," + HMinQtyCol.ToString() + |
| | | "," + HAuxPropNumberCol.ToString() + |
| | | "," + HBatchNoCol.ToString() + |
| | | "," + HRemarkCol.ToString() + |
| | | "," + HMinQtyCol.ToString(); |
| | | "," + HRemarkCol.ToString(); |
| | | grdMain.Columns[HBillNoCol].ReadOnly = true; |
| | | //设置å计å |
| | | string sTotalCol = HQtyCol.ToString(); |
| | |
| | | //-- |
| | | //设置å¯ç¼è¾å |
| | | string sAllowCol = HQtyCol.ToString() + |
| | | "," + HMinQtyCol.ToString() + |
| | | "," + HAuxPropNumberCol.ToString() + |
| | | "," + HBatchNoCol.ToString() + |
| | | "," + HRemarkCol.ToString() + |
| | | "," + HMinQtyCol.ToString(); |
| | | "," + HRemarkCol.ToString(); |
| | | grdMain.Columns[HBillNoCol].ReadOnly = true; |
| | | //设置å计å |
| | | string sTotalCol = HQtyCol.ToString(); |
| | |
| | | } |
| | | } |
| | | |
| | | //æ¹æ¬¡æé® |
| | | private void BatchNo_Click(object sender, EventArgs e) |
| | | { |
| | | bool b = false; |
| | | for (int i = 0; i < grdMain.RowCount; i++) |
| | | { |
| | | long HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value); // ç©æå
ç |
| | | string HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HBatchNoCol].Value); // æ¹å· |
| | | |
| | | if (HMaterID != 0) |
| | | { |
| | | DataSet oDs = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_GetBatchNo " + HMaterID.ToString() + ",'" + HBatchNo + "','" + dtpHDate.Value.ToShortDateString()+ "','" + CampanyName+"'", "h_p_Gy_BarCodeBill_GetBatchNo"); |
| | | // |
| | | if (oDs == null && oDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("çææ¹æ¬¡å¤±è´¥ï¼"); |
| | | return; |
| | | } |
| | | else if (DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][0]) == "1") |
| | | { |
| | | grdMain.Rows[i].Cells[HBatchNoCol].Value = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]); |
| | | b = true; |
| | | } |
| | | } |
| | | } |
| | | //æç»è¡¨æ¯å¦ä¸ºé¶è¡ |
| | | if (b == false) |
| | | { |
| | | MessageBox.Show("没æéè¦çææ¹æ¬¡çæç»è¡ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |