| | |
| | | |
| | | namespace PlanM |
| | | { |
| | | public partial class Gy_DataIn_RoutingBill :BLL.Gy_DataInTmp |
| | | public partial class Gy_DataIn_RoutingBill : BLL.Gy_DataInTmp |
| | | { |
| | | public Gy_DataIn_RoutingBill() |
| | | { |
| | |
| | | } |
| | | |
| | | public int HMaterNumberCol = 0; //产å代ç |
| | | public int HProcNoCol = 0; //å·¥åºåºå· |
| | | public int HProcNameCol = 0; //å·¥åº |
| | | public int HWorkCenterNameCol = 0; //å·¥ä½ä¸å¿ |
| | | public int HWorkQtyCol = 0; //äº§è½ |
| | | public int HWorkQtyCol = 0; //å å·¥æ°é |
| | | public int HBeginDayQtyCol = 6; //å¼å·¥åºå¤© |
| | | public int HBeginFixQtyCol = 7; //å¼å·¥ä½é |
| | | public int HFixPriceCol = 8; //å®é¢ å°æ¶å·¥èµ |
| | | public int HProcPriceCol = 9; //工价 |
| | | public int HProcNoCol = 0; //å·¥åºåºå· |
| | | public int HTechnologyParameterCol = 0; //å·¥èºåæ° |
| | | public int HPicNumCol = 0; //å¾çº¸ç¼å· |
| | | public int HProcCheckNoteCol = 0; //æ¬å·¥åºç¡®è®¤è®°å½ |
| | | |
| | | public int HPicNumVerCol = 0; //å¾å·çæ¬ |
| | | public int HPicNumAssembleCol = 0; //æ»è£
å¾å· |
| | | public int HMaterTextureCol = 0; //æè´¨ |
| | | public int HProductNumCol = 0; //æåç¼å· |
| | | public int HVerNumCol = 0; //çæ¬ |
| | | public int HMouldNoCol = 0; //模å
·ç¼å· |
| | | public int HProcWorkNumCol = 0; //ç¨åºå· |
| | | public int HPassRateCol = 0; //è¯ç |
| | | // |
| | | public const int HBeginRow = 2; //æææ°æ®ï¼å¼å§è¡æ° |
| | | // |
| | |
| | | { |
| | | base.sSheetName = txtHSheetName.Text; |
| | | return base.OpenExcelData(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åå§åçé¢ |
| | |
| | | public override void initData() |
| | | { |
| | | base.initData(); |
| | | base.sSheetName = txtHSheetName.Text ; |
| | | base.sSheetName = txtHSheetName.Text; |
| | | base.ModRightName = "Gy_DataIn_RoutingBill"; |
| | | base.ModRightNameCheck = base.ModRightName + base.ModRightNameCheck; |
| | | base.ModRightNameClose = base.ModRightName + base.ModRightNameClose; |
| | |
| | | //导å
¥ |
| | | public override void Sub_DataIn() |
| | | { |
| | | string hnumber = ""; |
| | | string HBillNo = ""; |
| | | // |
| | | HMaterNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("产å代ç ", grdMain); |
| | | HProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åº", grdMain); |
| | | HWorkCenterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥ä½ä¸å¿", grdMain); |
| | | HWorkQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("产è½", grdMain); |
| | | HBeginFixQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¼å·¥ä½é", grdMain); |
| | | HBeginDayQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¼å·¥åºå¤©", grdMain); |
| | | HFixPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("å°æ¶å·¥èµ", grdMain); |
| | | HProcPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("å个工价", grdMain); |
| | | try |
| | | { |
| | | string hnumber = ""; |
| | | string HBillNo = ""; |
| | | // |
| | | HMaterNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("产å代ç ", grdMain); |
| | | HProcNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åºåºå·", grdMain); |
| | | HProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åº", grdMain); |
| | | HWorkCenterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥ä½ä¸å¿", grdMain); |
| | | HWorkQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("å å·¥æ°é", grdMain); |
| | | HPicNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¾çº¸ç¼å·", grdMain); |
| | | HTechnologyParameterCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥èºåæ°", grdMain); |
| | | HProcCheckNoteCol = DBUtility.Gy_BaseFun.Fun_GetCol("æ¬å·¥åºç¡®è®¤è®°å½", grdMain); |
| | | HPicNumVerCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¾å·çæ¬", grdMain); |
| | | HPicNumAssembleCol = DBUtility.Gy_BaseFun.Fun_GetCol("æ»è£
å¾å·", grdMain); |
| | | HMaterTextureCol = DBUtility.Gy_BaseFun.Fun_GetCol("æè´¨", grdMain); |
| | | HProductNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("æåç¼å·", grdMain); |
| | | HVerNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("çæ¬", grdMain); |
| | | HMouldNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("模å
·ç¼å·", grdMain); |
| | | HProcWorkNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("ç¨åºå·", grdMain); |
| | | HBeginFixQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¼å·¥ä½é", grdMain); |
| | | HBeginDayQtyCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¼å·¥åºå¤©", grdMain); |
| | | HFixPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("å°æ¶å·¥èµ", grdMain); |
| | | HProcPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("å个工价", grdMain); |
| | | HPassRateCol = DBUtility.Gy_BaseFun.Fun_GetCol("è¯ç", grdMain); |
| | | |
| | | HProcNoCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åºåºå·", grdMain); |
| | | HTechnologyParameterCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥èºåæ°", grdMain); |
| | | HPicNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¾çº¸ç¼å·", grdMain); |
| | | HProcCheckNoteCol = DBUtility.Gy_BaseFun.Fun_GetCol("æ¬å·¥åºç¡®è®¤è®°å½", grdMain); |
| | | //æ²¡ææ¾å°å |
| | | if (HMaterNumberCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ã产å代ç ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcNameCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥åºãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HWorkCenterNameCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥ä½ä¸å¿ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HWorkQtyCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ã产è½ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HBeginFixQtyCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¼å·¥ä½éãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HBeginDayQtyCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¼å·¥åºå¤©ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HFixPriceCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå°æ¶å·¥èµãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcPriceCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå个工价ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcNoCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥åºåºå·ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HTechnologyParameterCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥èºåæ°ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HPicNumCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¾çº¸ç¼å·ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcCheckNoteCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãæ¬å·¥åºç¡®è®¤è®°å½ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | // |
| | | if (!Checkdata()) |
| | | { |
| | | return; |
| | | } |
| | | if (grdMain.Rows.Count > 0) |
| | | { |
| | | hnumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HMaterNumberCol].Value); |
| | | HBillNo = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true); |
| | | BillNew.omodel.HStandard = false; |
| | | BillNew.omodel.HMainTimeUnit = "Сʱ"; |
| | | BillNew.omodel.HYear = 2011; |
| | | BillNew.omodel.HPeriod = 1; |
| | | BillNew.omodel.HBillNo = HBillNo; |
| | | BillNew.omodel.HDate = DateTime.Today.Date; |
| | | BillNew.DetailColl.Clear(); |
| | | } |
| | | for (int i = 0; i <= grdMain.Rows.Count - 1; i++) |
| | | { |
| | | string sHNumber = ""; |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value) != "" ) |
| | | //æ²¡ææ¾å°å |
| | | if (HMaterNumberCol == -1) |
| | | { |
| | | // |
| | | sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value); |
| | | //å®¡æ ¸ä»£ç æ¯å¦åç |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNumber)) |
| | | MessageBox.Show("æ²¡ææ¾å°ã产å代ç ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcNameCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥åºãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HWorkCenterNameCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥ä½ä¸å¿ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HWorkQtyCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå å·¥æ°éãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HBeginFixQtyCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¼å·¥ä½éãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HBeginDayQtyCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¼å·¥åºå¤©ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HFixPriceCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå°æ¶å·¥èµãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcPriceCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå个工价ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcNoCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥åºåºå·ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HTechnologyParameterCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥èºåæ°ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HPicNumCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¾çº¸ç¼å·ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcCheckNoteCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãæ¬å·¥åºç¡®è®¤è®°å½ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HPicNumVerCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¾å·çæ¬ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HPicNumAssembleCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãæ»è£
å¾å·ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HMaterTextureCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãæè´¨ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProductNumCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãæåç¼å·ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HVerNumCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãçæ¬ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HMouldNoCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ã模å
·ç¼å·ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcWorkNumCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãç¨åºå·ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HPassRateCol == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãè¯çãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | // |
| | | if (!Checkdata()) |
| | | { |
| | | return; |
| | | } |
| | | if (grdMain.Rows.Count > 0) |
| | | { |
| | | hnumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HMaterNumberCol].Value); |
| | | HBillNo = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true); |
| | | BillNew.omodel.HStandard = false; |
| | | BillNew.omodel.HMainTimeUnit = "Сʱ"; |
| | | BillNew.omodel.HYear = 2011; |
| | | BillNew.omodel.HPeriod = 1; |
| | | BillNew.omodel.HBillNo = HBillNo; |
| | | BillNew.omodel.HDate = DateTime.Today.Date; |
| | | BillNew.omodel.HPicNumVer = ""; |
| | | BillNew.omodel.HPicNumAssemble = ""; |
| | | BillNew.omodel.HMaterTexture = ""; |
| | | BillNew.omodel.HProductNum = ""; |
| | | BillNew.omodel.HVerNum = ""; |
| | | BillNew.DetailColl.Clear(); |
| | | } |
| | | for (int i = 0; i <= grdMain.Rows.Count - 1; i++) |
| | | { |
| | | BillNew.omodel.HPicNumVer = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HPicNumVerCol].Value); |
| | | BillNew.omodel.HPicNumAssemble = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HPicNumAssembleCol].Value); |
| | | BillNew.omodel.HMaterTexture = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterTextureCol].Value); |
| | | BillNew.omodel.HProductNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProductNumCol].Value); |
| | | BillNew.omodel.HVerNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HVerNumCol].Value); |
| | | string sHNumber = ""; |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value) != "") |
| | | { |
| | | MessageBox.Show("ç©æä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | |
| | | if (hnumber == DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value)) |
| | | { |
| | | //å¾å°ç©æå
ç |
| | | if (oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | { |
| | | if (BillNew.omodel.HMaterID != oMaterHlp.omodel.HItemID) |
| | | { |
| | | BillNew.omodel.HMaterID = oMaterHlp.omodel.HItemID; |
| | | BillNew.omodel.HMaterNumber = oMaterHlp.omodel.HNumber; |
| | | BillNew.omodel.HUnitID = oMaterHlp.omodel.HUnitID; |
| | | BillNew.omodel.HUnitNumber = oMaterHlp.omodel.HUnitNumber; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | BillNew.omodel.HMaterID = 0; |
| | | MessageBox.Show("第" + i.ToString() + "è¡," + sHNumber + "æ²¡ææ¾å°å¯¹åºçç©æï¼"); |
| | | return; |
| | | } |
| | | j++; |
| | | //åå
¥ç±» |
| | | WriteClass(i); |
| | | |
| | | } |
| | | else |
| | | { |
| | | DataSet Ds; |
| | | ClsCN oCn=new ClsCN(); |
| | | bool b = false; |
| | | // 夿æ¯å¦åå¨å·¥èºè·¯çº¿ |
| | | Ds = oCn.RunProcReturn("Select HMaterID from Gy_RoutingBillMain Where HMaterID=" + BillNew.omodel.HMaterID.ToString(), "Gy_RoutingBillMain"); |
| | | if (checkadd.Checked == true) |
| | | { |
| | | //if (Ds.Tables[0].Rows.Count == 0)//追å |
| | | //{ |
| | | //æ°å¢å å
å é¤åæ¥å·¥èº |
| | | BillNew.DeleteByMaterID(BillNew.omodel.HMaterID); |
| | | b = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | if (b == false) return; |
| | | c++; |
| | | BillNew.CheckBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | //} |
| | | //else |
| | | //{ |
| | | |
| | | //} |
| | | } |
| | | else |
| | | { |
| | | BillNew.DeleteByMaterID(BillNew.omodel.HMaterID); |
| | | b = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | if (b == false) return; |
| | | c++; |
| | | BillNew.CheckBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | |
| | | BillNew.DetailColl.Clear(); |
| | | hnumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value); |
| | | // |
| | | sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value); |
| | | |
| | | //å®¡æ ¸ä»£ç æ¯å¦åç |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNumber)) |
| | | { |
| | | MessageBox.Show("ç©æä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | //å¾å°ç©æå
ç |
| | | if (oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | |
| | | if (hnumber == DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value)) |
| | | { |
| | | if (BillNew.omodel.HMaterID != oMaterHlp.omodel.HItemID) |
| | | //å¾å°ç©æå
ç |
| | | if (oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | { |
| | | BillNew.omodel.HMaterID = oMaterHlp.omodel.HItemID; |
| | | BillNew.omodel.HMaterNumber = oMaterHlp.omodel.HNumber; |
| | | BillNew.omodel.HUnitID = oMaterHlp.omodel.HUnitID; |
| | | BillNew.omodel.HUnitNumber = oMaterHlp.omodel.HUnitNumber; |
| | | if (BillNew.omodel.HMaterID != oMaterHlp.omodel.HItemID) |
| | | { |
| | | BillNew.omodel.HMaterID = oMaterHlp.omodel.HItemID; |
| | | BillNew.omodel.HMaterNumber = oMaterHlp.omodel.HNumber; |
| | | BillNew.omodel.HUnitID = oMaterHlp.omodel.HUnitID; |
| | | BillNew.omodel.HUnitNumber = oMaterHlp.omodel.HUnitNumber; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | BillNew.omodel.HMaterID = 0; |
| | | MessageBox.Show("第" + i.ToString() + "è¡," + sHNumber + "æ²¡ææ¾å°å¯¹åºçç©æï¼"); |
| | | return; |
| | | } |
| | | j++; |
| | | //åå
¥ç±» |
| | | WriteClass(i); |
| | | |
| | | } |
| | | else |
| | | { |
| | | BillNew.omodel.HMaterID = 0; |
| | | MessageBox.Show("第" + i.ToString() + "è¡," + sHNumber + "æ²¡ææ¾å°å¯¹åºçç©æï¼"); |
| | | return; |
| | | DataSet Ds; |
| | | ClsCN oCn = new ClsCN(); |
| | | bool b = false; |
| | | // 夿æ¯å¦åå¨å·¥èºè·¯çº¿ |
| | | Ds = oCn.RunProcReturn("Select HMaterID from Gy_RoutingBillMain Where HMaterID=" + BillNew.omodel.HMaterID.ToString(), "Gy_RoutingBillMain"); |
| | | if (checkadd.Checked == true) |
| | | { |
| | | //if (Ds.Tables[0].Rows.Count == 0)//追å |
| | | //{ |
| | | //æ°å¢å å
å é¤åæ¥å·¥èº |
| | | BillNew.DeleteByMaterID(BillNew.omodel.HMaterID); |
| | | b = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | if (b == false) |
| | | { |
| | | MessageBox.Show("第" + i.ToString() + "è¡,ç©æ" + BillNew.omodel.HMaterNumber + "æ°å¢å·¥èºè·¯çº¿å¤±è´¥ï¼ä»£ç 293è¡ä¸ï¼åå ï¼" + ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | c++; |
| | | BillNew.CheckBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | //} |
| | | //else |
| | | //{ |
| | | |
| | | //} |
| | | } |
| | | else |
| | | { |
| | | BillNew.DeleteByMaterID(BillNew.omodel.HMaterID); |
| | | b = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | if (b == false) |
| | | { |
| | | MessageBox.Show("第" + i.ToString() + "è¡,ç©æ" + sHNumber + "æ°å¢å·¥èºè·¯çº¿å¤±è´¥ï¼ä»£ç 310è¡ä¸"); |
| | | return; |
| | | } |
| | | c++; |
| | | BillNew.CheckBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | |
| | | BillNew.DetailColl.Clear(); |
| | | hnumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value); |
| | | sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value); |
| | | |
| | | //å®¡æ ¸ä»£ç æ¯å¦åç |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNumber)) |
| | | { |
| | | MessageBox.Show("ç©æä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | //å¾å°ç©æå
ç |
| | | if (oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | { |
| | | if (BillNew.omodel.HMaterID != oMaterHlp.omodel.HItemID) |
| | | { |
| | | BillNew.omodel.HMaterID = oMaterHlp.omodel.HItemID; |
| | | BillNew.omodel.HMaterNumber = oMaterHlp.omodel.HNumber; |
| | | BillNew.omodel.HUnitID = oMaterHlp.omodel.HUnitID; |
| | | BillNew.omodel.HUnitNumber = oMaterHlp.omodel.HUnitNumber; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | BillNew.omodel.HMaterID = 0; |
| | | MessageBox.Show("第" + i.ToString() + "è¡," + sHNumber + "æ²¡ææ¾å°å¯¹åºçç©æï¼"); |
| | | return; |
| | | } |
| | | j = 0; |
| | | HBillNo = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true); |
| | | BillNew.omodel.HBillNo = HBillNo; |
| | | //åå
¥ç±» |
| | | WriteClass(i); |
| | | } |
| | | j = 0; |
| | | HBillNo = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true); |
| | | BillNew.omodel.HBillNo = HBillNo; |
| | | //åå
¥ç±» |
| | | WriteClass(i); |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("第" + i.ToString() + "è¡,æ²¡ææ¾å°å¯¹åºçç©æï¼"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | //æåä¸ä¸ªç©æå¤ç |
| | | if (BillNew.DetailColl.Count > 0) |
| | | { |
| | | MessageBox.Show("第" + i.ToString() + "è¡,æ²¡ææ¾å°å¯¹åºçç©æï¼"); |
| | | return; |
| | | } |
| | | } |
| | | //æåä¸ä¸ªç©æå¤ç |
| | | if (BillNew.DetailColl.Count > 0) |
| | | { |
| | | DataSet Ds; |
| | | ClsCN oCn = new ClsCN(); |
| | | bool b = false; |
| | | //Ds = oCn.RunProcReturn("Select HMaterID from Gy_RoutingBillMain Where HMaterID=" + BillNew.omodel.HMaterID.ToString(), "Gy_RoutingBillMain"); |
| | | //if (Ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | DataSet Ds; |
| | | ClsCN oCn = new ClsCN(); |
| | | bool b = false; |
| | | //Ds = oCn.RunProcReturn("Select HMaterID from Gy_RoutingBillMain Where HMaterID=" + BillNew.omodel.HMaterID.ToString(), "Gy_RoutingBillMain"); |
| | | //if (Ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | BillNew.DeleteByMaterID(BillNew.omodel.HMaterID); |
| | | b = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | if (b == false) return; |
| | | c++; |
| | | BillNew.CheckBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | //} |
| | | MessageBox.Show("导å
¥å®æ¯:å
±"+c.ToString()+"个工èºè·¯çº¿"); |
| | | grdMain.DataSource = null; |
| | | //} |
| | | MessageBox.Show("导å
¥å®æ¯:å
±" + c.ToString() + "个工èºè·¯çº¿"); |
| | | grdMain.DataSource = null; |
| | | } |
| | | c = 0; |
| | | } |
| | | c = 0; |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show("导å
¥å¤±è´¥!åå :" + e.Message, "æç¤º"); |
| | | } |
| | | } |
| | | |
| | | //åå
¥ç±» 仿§ä»¶ |
| | | private bool WriteClass(int row) |
| | | { |
| | | string sHNumber = ""; |
| | | string sHNamePoc = ""; |
| | | string sHNamePoc = ""; |
| | | string sHNumberCen = ""; |
| | | Single sWorkQty = 0; |
| | | Single sBeginDayQty = 0; |
| | | Single sBeginFixQty = 0; |
| | | Single sHPassRate = 0; |
| | | //long HItemID = 0; |
| | | // |
| | | sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HMaterNumberCol].Value); |
| | | sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HMaterNumberCol].Value); |
| | | sHNumberCen = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HWorkCenterNameCol].Value); |
| | | sHNamePoc = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HProcNameCol].Value); |
| | | |
| | | sWorkQty = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HWorkQtyCol].Value); |
| | | sBeginDayQty = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HBeginDayQtyCol].Value); |
| | | sBeginFixQty = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HBeginFixQtyCol].Value); |
| | | sHPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HPassRateCol].Value); |
| | | //夿æ¯å¦å
许 ä¿å |
| | | |
| | | Model.ClsGy_RoutingBillSub oSub=new Model.ClsGy_RoutingBillSub(); |
| | | |
| | | Model.ClsGy_RoutingBillSub oSub = new Model.ClsGy_RoutingBillSub(); |
| | | |
| | | //å¾å°å·¥åºå
ç |
| | | if (oProcHlp.GetInfoByName(sHNamePoc)) |
| | |
| | | oSub.HProcNo = DBUtility.ClsPub.isInt(grdMain.Rows[row].Cells[HProcNoCol].Value); |
| | | oSub.HUnitTime = 1; |
| | | oSub.HWorkQty = sWorkQty; |
| | | oSub.HPassRate = sHPassRate; |
| | | oSub.HRemark = ""; |
| | | oSub.HTimeUnit = "Сʱ"; |
| | | oSub.HReadyTime = 0; |
| | | oSub.HQueueTime = 0; |
| | | oSub.HMoveTime = 0; |
| | | // |
| | | |
| | | |
| | | // |
| | | oSub.HCloseMan = ""; |
| | | oSub.HCloseType = false; |
| | | oSub.HSourceInterID = 0; |
| | | oSub.HSourceEntryID = 0; |
| | | oSub.HSourceBillType = ""; |
| | | oSub.HSourceBillNo =""; |
| | | oSub.HSourceBillNo = ""; |
| | | oSub.HRelationQty = 0; |
| | | oSub.HRelationMoney = 0; |
| | | |
| | |
| | | oSub.HTechnologyParameter = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HTechnologyParameterCol].Value); |
| | | oSub.HPicNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HPicNumCol].Value); |
| | | oSub.HProcCheckNote = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HProcCheckNoteCol].Value); |
| | | oSub.HMouldNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HMouldNoCol].Value); |
| | | oSub.HProcWorkNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HProcWorkNumCol].Value); |
| | | BillNew.DetailColl.Add(oSub); |
| | | return true; |
| | | } |
| | |
| | | //æ£æ¥ç©æ |
| | | private bool Checkdata() |
| | | { |
| | | bool b=false; |
| | | bool b = false; |
| | | string sErrMsg = ""; |
| | | string sMsg = ""; |
| | | for (int i = 0; i <= grdMain.Rows.Count - 1; i++) |
| | | { |
| | | string sHNumber = ""; |
| | | string sHNamePoc = ""; |
| | | string sHNamePoc = ""; |
| | | string sHNumberCen = ""; |
| | | |
| | | Single sWorkQty = 0; |
| | | Single sHPassRate = 0; |
| | | |
| | | // |
| | | sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNumberCol].Value); |
| | | sHNumberCen = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWorkCenterNameCol].Value); |
| | | sHNamePoc = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcNameCol].Value); |
| | | if (sHNumber != "" ) |
| | | sWorkQty = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HWorkQtyCol].Value); |
| | | sHPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HPassRateCol].Value); |
| | | if (sHNumber != "") |
| | | { |
| | | // |
| | | int index = i + 1; |
| | | //å å·¥æ°éä¸è½å°äºçäºé¶ |
| | | if (sWorkQty <= 0) |
| | | { |
| | | MessageBox.Show("第" + index + "è¡å å·¥æ°éä¸è½å°äºçäºé¶ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | //è¯çä¸è½å°äºçäºé¶ |
| | | if (sHPassRate <= 0) |
| | | { |
| | | MessageBox.Show("第" + index + "è¡è¯çä¸è½å°äºçäºé¶ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | //å®¡æ ¸ä»£ç æ¯å¦åç |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNumber)) |
| | | { |
| | |
| | | if (!oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | { |
| | | sMsg = "[" + sHNumber + "]ç©æä¸åå¨"; |
| | | if (sErrMsg.Contains(sMsg)==false) |
| | | if (sErrMsg.Contains(sMsg) == false) |
| | | { |
| | | sErrMsg = sErrMsg + "[" + sHNumber + "]ç©æä¸åå¨\r\n" ; |
| | | sErrMsg = sErrMsg + "[" + sHNumber + "]ç©æä¸åå¨\r\n"; |
| | | } |
| | | b = true; |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | if (b == true) |
| | | { |