| | |
| | | //ä¿ååæ® |
| | | private bool Sub_SaveBill() |
| | | { |
| | | Model.ClsSc_ProcessExchangeBillSub oBillSub = new Model.ClsSc_ProcessExchangeBillSub(); |
| | | //夿æé |
| | | //if (!ClsPub.Security_Log(ModRightNameEdit, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // return false; |
| | | //} |
| | | // |
| | | Int32 i; |
| | | bool bResult; |
| | | BillNew = new DAL.ClsSc_ProcessExchangeBill(); |
| | | //失å»ç¦ç¹ |
| | | lblCaption.Focus(); |
| | | if (!Sub_AllowSave())//忮宿´æ§å¤æ |
| | | return false; |
| | | //èµå¼ID |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) |
| | | BillNew.omodel.HInterID = BillOld.omodel.HInterID; |
| | | else if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_UpdatePrice) |
| | | BillNew.omodel.HInterID = BillOld.omodel.HInterID; |
| | | //主类èµå¼ |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | //if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(dtpHDate.Value, ref sYear, ref sPeriod, ref s) == false) |
| | | //{ |
| | | // MessageBox.Show(s, "æç¤º"); |
| | | // return false; |
| | | //} |
| | | sYear = ClsPub.isDate(dtpHDate.Value).Year; |
| | | sPeriod = ClsPub.isDate(dtpHDate.Value).Month; |
| | | //æºåä¿¡æ¯ |
| | | //BillNew.omodel.HMainSourceBillType = cmbSourceBillType.Text; |
| | | // |
| | | BillNew.omodel.HYear = sYear; |
| | | BillNew.omodel.HPeriod = sPeriod; |
| | | BillNew.omodel.HPRDORGID = DBUtility.ClsPub.HOrgID; //ç»ç» |
| | | //åºå®èµå¼================================= |
| | | BillNew.omodel.HBillNo = this.txtHBillNo.Text.Trim(); //å¨èµå¼ç±»åå°±å¤ç好åç¬¦ä¸²åæ°å |
| | | BillNew.omodel.HDate = this.dtpHDate.Value; |
| | | BillNew.omodel.HRemark = this.txtHRemark.Text.Trim(); |
| | | //==================================================== |
| | | BillNew.omodel.HMaker = DBUtility.ClsPub.CurUserName; |
| | | BillNew.omodel.HWWOrderInterID = ClsPub.isLong(this.txtHWWOrderInterID.Text.ToString()); |
| | | BillNew.omodel.HWWOrderEntryID = ClsPub.isLong(this.txtHWWOrderEntryID.Text.ToString()); |
| | | BillNew.omodel.HWWOrderBillNo = ClsPub.isStrNull(this.txtHWWOrderBillNo.Text); |
| | | BillNew.omodel.HICMOInterID = ClsPub.isLong(this.txtHICMOBillNo.Tag); |
| | | BillNew.omodel.HICMOEntryID = ClsPub.isLong(this.txtHICMOEntryID.Text); |
| | | BillNew.omodel.HICMOBillNo = ClsPub.isStrNull(this.txtHICMOBillNo.Text); |
| | | BillNew.omodel.HMaterID2 = ClsPub.isLong(this.txtHMaterID2.Tag); |
| | | BillNew.omodel.HMaterID = ClsPub.isLong(this.txtHMaterID.Tag.ToString()); |
| | | BillNew.omodel.HMaterNumber = ClsPub.isStrNull(this.txtHMaterNumber.Text); |
| | | BillNew.omodel.HBatchNo = ClsPub.isStrNull(this.txtHBatchNo.Text); |
| | | BillNew.omodel.HUnitID = ClsPub.isLong(this.txtHUnitID.Tag.ToString()); |
| | | BillNew.omodel.HUnitNumber = ClsPub.isStrNull(this.txtHUnitNumber.Text); |
| | | BillNew.omodel.HPlanQty = ClsPub.isDoule(this.txtHPlanQty.Text); |
| | | BillNew.omodel.HQty = ClsPub.isDoule(this.txtHQty.Text); |
| | | //BillNew.omodel.HQty = ClsPub.isDoule(this.txtHprocExQty.Text); |
| | | BillNew.omodel.HPlanBeginDate = ClsPub.isDate(this.dtpHPlanBeginDate.Value); |
| | | BillNew.omodel.HPlanEndDate = ClsPub.isDate(this.dtpHPlanEndDate.Value); |
| | | BillNew.omodel.HExplanation = ClsPub.isStrNull(this.txtHExplanation.Text); |
| | | BillNew.omodel.HInnerBillNo = ClsPub.isStrNull(this.txtHInnerBillNo.Text); |
| | | BillNew.omodel.HWorkShopID = ClsPub.isLong(this.txtHWorkShopID.Tag.ToString()); |
| | | BillNew.omodel.HSupID = ClsPub.isLong(this.txtHSupID.Tag.ToString()); |
| | | BillNew.omodel.HBLFlag = chkHBLFlag.Checked; |
| | | //BillNew.omodel.HWorkTypeNum = ClsPub.isStrNull(this.txtHWorkTypeID.Tag.ToString()); |
| | | //======================== |
| | | BillNew.omodel.HMainMaterID = ClsPub.isLong(this.txtHMainMaterID.Text.ToString()); |
| | | BillNew.omodel.HKeyMaterID = ClsPub.isLong(this.txtHKeyMaterID.Text.ToString()); |
| | | BillNew.omodel.HOrderProcNO = ClsPub.isStrNull(this.txtHOrderProcNO.Text.ToString()); |
| | | BillNew.omodel.HEquipMentID = ClsPub.isLong(this.txtHEquipMentID.Tag.ToString()); |
| | | BillNew.omodel.HMateOutBatchNo = ClsPub.isStrNull(this.txtHMateOutBatchNo.Text); |
| | | BillNew.omodel.HProjectNum = ClsPub.isStrNull(this.txtHProjectNum.Text); |
| | | //=================== |
| | | BillNew.omodel.HProdMaterCode = ClsPub.isStrNull(this.txtHProdMaterCode.Text); |
| | | BillNew.omodel.HSeOrderBillNo = ClsPub.isStrNull(this.txtHSeOrderBillNo.Text); |
| | | BillNew.omodel.HCusShortName = ClsPub.isStrNull(this.txtHCusShortName.Text); |
| | | BillNew.omodel.HCusNeedMaterial = ClsPub.isStrNull(this.txtHCusNeedMaterial.Text); |
| | | BillNew.omodel.HPlanSendGoodsDate = ClsPub.isStrNull(this.txtHPlanSendGoodsDate.Text); |
| | | BillNew.omodel.HProdMaterName = ClsPub.isStrNull(this.txtHProdMaterName.Text); |
| | | BillNew.omodel.HCusName = ClsPub.isStrNull(this.txtHCusName.Text); |
| | | BillNew.omodel.HWorkRemark = ClsPub.isStrNull(this.txtHWorkRemark.Text); |
| | | BillNew.omodel.HImportNote = ClsPub.isStrNull(this.txtHImportNote.Text); |
| | | BillNew.omodel.HMaterNumber_A = ClsPub.isStrNull(this.txtHMaterNumber_A.Text); |
| | | BillNew.omodel.HMaterNumber_B = ClsPub.isStrNull(this.txtHMaterNumber_B.Text); |
| | | BillNew.omodel.HMaterNumber_C = ClsPub.isStrNull(this.txtHMaterNumber_C.Text); |
| | | BillNew.omodel.HMaterNumber_D = ClsPub.isStrNull(this.txtHMaterNumber_D.Text); |
| | | BillNew.omodel.HProdType = ClsPub.isStrNull(this.txtHProdType.Text); |
| | | BillNew.omodel.HMaterShortName = ClsPub.isStrNull(this.txtHMaterShortName.Text); |
| | | BillNew.omodel.HMaterIDA = ClsPub.isStrNull(this.txtHMaterIDA.Text); |
| | | BillNew.omodel.HMaterIDB = ClsPub.isStrNull(this.txtHMaterIDB.Text); |
| | | BillNew.omodel.HMaterIDC = ClsPub.isStrNull(this.txtHMaterIDC.Text); |
| | | BillNew.omodel.HMaterIDD = ClsPub.isStrNull(this.txtHMaterIDD.Text); |
| | | //=================== |
| | | BillNew.omodel.HPicNumVer = ClsPub.isStrNull(this.textHPicNumVer.Text); |
| | | BillNew.omodel.HPicNumAssemble = ClsPub.isStrNull(this.textHPicNumAssemble.Text); |
| | | BillNew.omodel.HMaterTexture = ClsPub.isStrNull(this.textHMaterTexture.Text); |
| | | BillNew.omodel.HProductNum = ClsPub.isStrNull(this.textHProductNum.Text); |
| | | BillNew.omodel.HVerNum = ClsPub.isStrNull(this.textHVerNum.Text); |
| | | //è·åæå¤§è¡å· |
| | | int MaxRowNo = 0; |
| | | for (int n = 0; n < grdMain.Rows.Count; n++) |
| | | try |
| | | { |
| | | if (DBUtility.ClsPub.isInt(grdMain.Rows[n].Cells[HEntryIDCol].Value) > MaxRowNo) |
| | | Model.ClsSc_ProcessExchangeBillSub oBillSub = new Model.ClsSc_ProcessExchangeBillSub(); |
| | | //夿æé |
| | | //if (!ClsPub.Security_Log(ModRightNameEdit, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // return false; |
| | | //} |
| | | // |
| | | Int32 i; |
| | | bool bResult; |
| | | BillNew = new DAL.ClsSc_ProcessExchangeBill(); |
| | | //失å»ç¦ç¹ |
| | | lblCaption.Focus(); |
| | | if (!Sub_AllowSave())//忮宿´æ§å¤æ |
| | | return false; |
| | | //èµå¼ID |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) |
| | | BillNew.omodel.HInterID = BillOld.omodel.HInterID; |
| | | else if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_UpdatePrice) |
| | | BillNew.omodel.HInterID = BillOld.omodel.HInterID; |
| | | //主类èµå¼ |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | //if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(dtpHDate.Value, ref sYear, ref sPeriod, ref s) == false) |
| | | //{ |
| | | // MessageBox.Show(s, "æç¤º"); |
| | | // return false; |
| | | //} |
| | | sYear = ClsPub.isDate(dtpHDate.Value).Year; |
| | | sPeriod = ClsPub.isDate(dtpHDate.Value).Month; |
| | | //æºåä¿¡æ¯ |
| | | //BillNew.omodel.HMainSourceBillType = cmbSourceBillType.Text; |
| | | // |
| | | BillNew.omodel.HYear = sYear; |
| | | BillNew.omodel.HPeriod = sPeriod; |
| | | BillNew.omodel.HPRDORGID = DBUtility.ClsPub.HOrgID; //ç»ç» |
| | | //åºå®èµå¼================================= |
| | | BillNew.omodel.HBillNo = this.txtHBillNo.Text.Trim(); //å¨èµå¼ç±»åå°±å¤ç好åç¬¦ä¸²åæ°å |
| | | BillNew.omodel.HDate = this.dtpHDate.Value; |
| | | BillNew.omodel.HRemark = this.txtHRemark.Text.Trim(); |
| | | //==================================================== |
| | | BillNew.omodel.HMaker = DBUtility.ClsPub.CurUserName; |
| | | BillNew.omodel.HWWOrderInterID = ClsPub.isLong(this.txtHWWOrderInterID.Text.ToString()); |
| | | BillNew.omodel.HWWOrderEntryID = ClsPub.isLong(this.txtHWWOrderEntryID.Text.ToString()); |
| | | BillNew.omodel.HWWOrderBillNo = ClsPub.isStrNull(this.txtHWWOrderBillNo.Text); |
| | | BillNew.omodel.HICMOInterID = ClsPub.isLong(this.txtHICMOBillNo.Tag); |
| | | BillNew.omodel.HICMOEntryID = ClsPub.isLong(this.txtHICMOEntryID.Text); |
| | | BillNew.omodel.HICMOBillNo = ClsPub.isStrNull(this.txtHICMOBillNo.Text); |
| | | BillNew.omodel.HMaterID2 = ClsPub.isLong(this.txtHMaterID2.Tag); |
| | | BillNew.omodel.HMaterID = ClsPub.isLong(this.txtHMaterID.Tag.ToString()); |
| | | BillNew.omodel.HMaterNumber = ClsPub.isStrNull(this.txtHMaterNumber.Text); |
| | | BillNew.omodel.HBatchNo = ClsPub.isStrNull(this.txtHBatchNo.Text); |
| | | BillNew.omodel.HUnitID = ClsPub.isLong(this.txtHUnitID.Tag.ToString()); |
| | | BillNew.omodel.HUnitNumber = ClsPub.isStrNull(this.txtHUnitNumber.Text); |
| | | BillNew.omodel.HPlanQty = ClsPub.isDoule(this.txtHPlanQty.Text); |
| | | BillNew.omodel.HQty = ClsPub.isDoule(this.txtHQty.Text); |
| | | //BillNew.omodel.HQty = ClsPub.isDoule(this.txtHprocExQty.Text); |
| | | BillNew.omodel.HPlanBeginDate = ClsPub.isDate(this.dtpHPlanBeginDate.Value); |
| | | BillNew.omodel.HPlanEndDate = ClsPub.isDate(this.dtpHPlanEndDate.Value); |
| | | BillNew.omodel.HExplanation = ClsPub.isStrNull(this.txtHExplanation.Text); |
| | | BillNew.omodel.HInnerBillNo = ClsPub.isStrNull(this.txtHInnerBillNo.Text); |
| | | BillNew.omodel.HWorkShopID = ClsPub.isLong(this.txtHWorkShopID.Tag.ToString()); |
| | | BillNew.omodel.HSupID = ClsPub.isLong(this.txtHSupID.Tag.ToString()); |
| | | BillNew.omodel.HBLFlag = chkHBLFlag.Checked; |
| | | //BillNew.omodel.HWorkTypeNum = ClsPub.isStrNull(this.txtHWorkTypeID.Tag.ToString()); |
| | | //======================== |
| | | BillNew.omodel.HMainMaterID = ClsPub.isLong(this.txtHMainMaterID.Text.ToString()); |
| | | BillNew.omodel.HKeyMaterID = ClsPub.isLong(this.txtHKeyMaterID.Text.ToString()); |
| | | BillNew.omodel.HOrderProcNO = ClsPub.isStrNull(this.txtHOrderProcNO.Text.ToString()); |
| | | BillNew.omodel.HEquipMentID = ClsPub.isLong(this.txtHEquipMentID.Tag.ToString()); |
| | | BillNew.omodel.HMateOutBatchNo = ClsPub.isStrNull(this.txtHMateOutBatchNo.Text); |
| | | BillNew.omodel.HProjectNum = ClsPub.isStrNull(this.txtHProjectNum.Text); |
| | | //=================== |
| | | BillNew.omodel.HProdMaterCode = ClsPub.isStrNull(this.txtHProdMaterCode.Text); |
| | | BillNew.omodel.HSeOrderBillNo = ClsPub.isStrNull(this.txtHSeOrderBillNo.Text); |
| | | BillNew.omodel.HCusShortName = ClsPub.isStrNull(this.txtHCusShortName.Text); |
| | | BillNew.omodel.HCusNeedMaterial = ClsPub.isStrNull(this.txtHCusNeedMaterial.Text); |
| | | BillNew.omodel.HPlanSendGoodsDate = ClsPub.isStrNull(this.txtHPlanSendGoodsDate.Text); |
| | | BillNew.omodel.HProdMaterName = ClsPub.isStrNull(this.txtHProdMaterName.Text); |
| | | BillNew.omodel.HCusName = ClsPub.isStrNull(this.txtHCusName.Text); |
| | | BillNew.omodel.HWorkRemark = ClsPub.isStrNull(this.txtHWorkRemark.Text); |
| | | BillNew.omodel.HImportNote = ClsPub.isStrNull(this.txtHImportNote.Text); |
| | | BillNew.omodel.HMaterNumber_A = ClsPub.isStrNull(this.txtHMaterNumber_A.Text); |
| | | BillNew.omodel.HMaterNumber_B = ClsPub.isStrNull(this.txtHMaterNumber_B.Text); |
| | | BillNew.omodel.HMaterNumber_C = ClsPub.isStrNull(this.txtHMaterNumber_C.Text); |
| | | BillNew.omodel.HMaterNumber_D = ClsPub.isStrNull(this.txtHMaterNumber_D.Text); |
| | | BillNew.omodel.HProdType = ClsPub.isStrNull(this.txtHProdType.Text); |
| | | BillNew.omodel.HMaterShortName = ClsPub.isStrNull(this.txtHMaterShortName.Text); |
| | | BillNew.omodel.HMaterIDA = ClsPub.isStrNull(this.txtHMaterIDA.Text); |
| | | BillNew.omodel.HMaterIDB = ClsPub.isStrNull(this.txtHMaterIDB.Text); |
| | | BillNew.omodel.HMaterIDC = ClsPub.isStrNull(this.txtHMaterIDC.Text); |
| | | BillNew.omodel.HMaterIDD = ClsPub.isStrNull(this.txtHMaterIDD.Text); |
| | | //=================== |
| | | BillNew.omodel.HPicNumVer = ClsPub.isStrNull(this.textHPicNumVer.Text); |
| | | BillNew.omodel.HPicNumAssemble = ClsPub.isStrNull(this.textHPicNumAssemble.Text); |
| | | BillNew.omodel.HMaterTexture = ClsPub.isStrNull(this.textHMaterTexture.Text); |
| | | BillNew.omodel.HProductNum = ClsPub.isStrNull(this.textHProductNum.Text); |
| | | BillNew.omodel.HVerNum = ClsPub.isStrNull(this.textHVerNum.Text); |
| | | //è·åæå¤§è¡å· |
| | | int MaxRowNo = 0; |
| | | for (int n = 0; n < grdMain.Rows.Count; n++) |
| | | { |
| | | MaxRowNo = DBUtility.ClsPub.isInt(grdMain.Rows[n].Cells[HEntryIDCol].Value); |
| | | } |
| | | } |
| | | //æç»ç±»èµå¼ |
| | | BillNew.DetailColl = new List<Model.ClsSc_ProcessExchangeBillSub>(); |
| | | for (i = 0; i <= grdMain.RowCount - 1; i++) |
| | | { |
| | | if (ClsPub.isLong(grdMain.Rows[i].Cells[HProcIDCol].Value) != 0) |
| | | { |
| | | Model.ClsSc_ProcessExchangeBillSub oSub = new Model.ClsSc_ProcessExchangeBillSub(); |
| | | //åºå®èµå¼======================================== |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) |
| | | if (DBUtility.ClsPub.isInt(grdMain.Rows[n].Cells[HEntryIDCol].Value) > MaxRowNo) |
| | | { |
| | | if (DBUtility.ClsPub.isInt(grdMain.Rows[i].Cells[HEntryIDCol].Value) == 0) |
| | | MaxRowNo = DBUtility.ClsPub.isInt(grdMain.Rows[n].Cells[HEntryIDCol].Value); |
| | | } |
| | | } |
| | | //æç»ç±»èµå¼ |
| | | BillNew.DetailColl = new List<Model.ClsSc_ProcessExchangeBillSub>(); |
| | | for (i = 0; i <= grdMain.RowCount - 1; i++) |
| | | { |
| | | if (ClsPub.isLong(grdMain.Rows[i].Cells[HProcIDCol].Value) != 0) |
| | | { |
| | | Model.ClsSc_ProcessExchangeBillSub oSub = new Model.ClsSc_ProcessExchangeBillSub(); |
| | | //åºå®èµå¼======================================== |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) |
| | | { |
| | | oSub.HEntryID = MaxRowNo + i; |
| | | grdMain.Rows[i].Cells[HEntryIDCol].Value = oSub.HEntryID; |
| | | if (DBUtility.ClsPub.isInt(grdMain.Rows[i].Cells[HEntryIDCol].Value) == 0) |
| | | { |
| | | oSub.HEntryID = MaxRowNo + i; |
| | | grdMain.Rows[i].Cells[HEntryIDCol].Value = oSub.HEntryID; |
| | | } |
| | | else |
| | | { |
| | | oSub.HEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HEntryIDCol].Value); |
| | | } |
| | | } |
| | | else if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | oSub.HEntryID = i + 1; |
| | | } |
| | | else |
| | | { |
| | | oSub.HEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HEntryIDCol].Value); |
| | | if (DBUtility.ClsPub.isInt(grdMain.Rows[i].Cells[HEntryIDCol].Value) == 0) |
| | | { |
| | | oSub.HEntryID = MaxRowNo + i; |
| | | grdMain.Rows[i].Cells[HEntryIDCol].Value = oSub.HEntryID; |
| | | } |
| | | else |
| | | { |
| | | oSub.HEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HEntryIDCol].Value); |
| | | } |
| | | } |
| | | } |
| | | else if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | oSub.HEntryID = i + 1; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isInt(grdMain.Rows[i].Cells[HEntryIDCol].Value) == 0) |
| | | oSub.HRemark = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HRemarkCol].Value); |
| | | oSub.HSourceInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSourceInterIDCol].Value); |
| | | oSub.HSourceEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSourceEntryIDCol].Value); |
| | | oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HSourceBillTypeCol].Value); |
| | | oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HSourceBillNoCol].Value); |
| | | oSub.HRelationQty = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQtyCol].Value); |
| | | oSub.HRelationQty_In = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQty_InCol].Value); |
| | | oSub.HRelationQty_Out = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQty_OutCol].Value); |
| | | oSub.HRelationQty_WWOrder = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQty_WWOrderCol].Value); |
| | | oSub.HRelationQty_Bad = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQty_BadCol].Value); |
| | | oSub.HRelationMoney = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationMoneyCol].Value); |
| | | oSub.HCloseMan = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HCloseManCol].Value); |
| | | oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEntryCloseDateCol].Value); |
| | | oSub.HCloseType = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HCloseTypeCol].Value); |
| | | //============================= |
| | | oSub.HQty = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HQtyCol].Value); |
| | | if (oSub.HQty <= 0) |
| | | { |
| | | oSub.HEntryID = MaxRowNo + i; |
| | | grdMain.Rows[i].Cells[HEntryIDCol].Value = oSub.HEntryID; |
| | | MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼æµè½¬å¡æ°éä¸è½ä¸º0æè
å°äº0"); |
| | | return false; |
| | | } |
| | | else |
| | | oSub.HProcNo = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HProcNoCol].Value); |
| | | if (oSub.HProcNo <= 0) |
| | | { |
| | | oSub.HEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HEntryIDCol].Value); |
| | | MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼æµæ°´å·ä¸è½ä¸º0æè
å°äº0"); |
| | | return false; |
| | | } |
| | | oSub.HProcID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HProcIDCol].Value); |
| | | oSub.HProcNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcNumberCol].Value); |
| | | oSub.HWorkRemark = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWorkRemarkCol].Value); |
| | | oSub.HCenterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HCenterIDCol].Value); |
| | | oSub.HDeptID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HDeptIDCol].Value); |
| | | oSub.HDeptNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HDeptNumberCol].Value); |
| | | //oSub.HGroupID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HGroupIDCol].Value); |
| | | oSub.HGroupNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HGroupNumberCol].Value); |
| | | oSub.HWorkerID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HWorkerIDCol].Value); |
| | | oSub.HWorkerNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWorkerNumberCol].Value); |
| | | oSub.HSourceID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSourceIDCol].Value); |
| | | oSub.HTimeUnit = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HTimeUnitCol].Value); |
| | | |
| | | oSub.HPlanWorkTimes = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HPlanWorkTimesCol].Value); |
| | | |
| | | oSub.HPlanBeginDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HPlanBeginDateCol].Value); |
| | | oSub.HPlanEndDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HPlanEndDateCol].Value); |
| | | oSub.HRelBeginDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HRelBeginDateCol].Value); |
| | | oSub.HRelEndDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HRelEndDateCol].Value); |
| | | |
| | | oSub.HReadyTime = 0; |
| | | oSub.HQueueTime = 0; |
| | | oSub.HMoveTime = 0; |
| | | oSub.HBeginDayQty = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HBeginDayQtyCol].Value); |
| | | oSub.HBeginFixQty = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HBeginFixQtyCol].Value); |
| | | oSub.HFixWorkDays = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HFixWorkDaysCol].Value); |
| | | oSub.HTrunWorkDays = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HTrunWorkDaysCol].Value); |
| | | oSub.HReadyTimes = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HReadyTimesCol].Value); |
| | | oSub.HMyWorkDays = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HMyWorkDaysCol].Value); |
| | | oSub.HOutPrice = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HOutPriceCol].Value); |
| | | oSub.HOutMoney = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HOutMoneyCol].Value); |
| | | |
| | | oSub.HLastProc = "å¦"; |
| | | oSub.HFstProc = "å¦"; |
| | | oSub.HKeyProc = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HKeyProcCol].Value); |
| | | |
| | | oSub.HSupID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSupIDCol].Value); |
| | | oSub.HSupFlag = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HSupFlagCol].Value); |
| | | oSub.HBackProc = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HBackProcCol].Value); |
| | | oSub.HEdit = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HEditCol].Value); |
| | | //if (oSub.HSourceID == 0) |
| | | //{ |
| | | // MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼çäº§èµæºä¸è½ä¸ºç©º"); |
| | | // return false; |
| | | //} |
| | | // |
| | | if (oSub.HCenterID == 0 && oSub.HSupFlag == false) |
| | | { |
| | | MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼å·¥ä½ä¸å¿æå§å¤æ è®°ä¸è½åæ¶ä¸ºç©º"); |
| | | return false; |
| | | } |
| | | oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HICMOBillNoCol].Value); |
| | | oSub.HICMOInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HICMOInterIDCol].Value); |
| | | oSub.HICMOEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HICMOEntryIDCol].Value); |
| | | oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSeOrderInterIDCol].Value); |
| | | oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSeOrderEntryIDCol].Value); |
| | | oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HSeOrderBillNoCol].Value); |
| | | oSub.HWWOrderInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HWWOrderInterIDCol].Value); |
| | | oSub.HWWOrderEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HWWOrderEntryIDCol].Value); |
| | | oSub.HWWOrderBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWWOrderBillNoCol].Value); |
| | | oSub.HSumPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HSumPassRateCol].Value); |
| | | oSub.HPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HPassRateCol].Value); |
| | | oSub.HOverRate = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HOverRateCol].Value); |
| | | oSub.HMaxQty = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HMaxQtyCol].Value); |
| | | oSub.HTechnologyParameter = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HTechnologyParameterCol].Value); |
| | | oSub.HPicNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HPicNumCol].Value); |
| | | oSub.HProcCheckNote = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcCheckNoteCol].Value); |
| | | oSub.HMouldNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMouldNoCol].Value); |
| | | oSub.HProcWorkNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcWorkNumCol].Value); |
| | | BillNew.DetailColl.Add(oSub); |
| | | } |
| | | oSub.HRemark = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HRemarkCol].Value); |
| | | oSub.HSourceInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSourceInterIDCol].Value); |
| | | oSub.HSourceEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSourceEntryIDCol].Value); |
| | | oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HSourceBillTypeCol].Value); |
| | | oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HSourceBillNoCol].Value); |
| | | oSub.HRelationQty = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQtyCol].Value); |
| | | oSub.HRelationQty_In = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQty_InCol].Value); |
| | | oSub.HRelationQty_Out = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQty_OutCol].Value); |
| | | oSub.HRelationQty_WWOrder = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQty_WWOrderCol].Value); |
| | | oSub.HRelationQty_Bad = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationQty_BadCol].Value); |
| | | oSub.HRelationMoney = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HRelationMoneyCol].Value); |
| | | oSub.HCloseMan = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HCloseManCol].Value); |
| | | oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HEntryCloseDateCol].Value); |
| | | oSub.HCloseType = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HCloseTypeCol].Value); |
| | | //============================= |
| | | oSub.HQty = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HQtyCol].Value); |
| | | if (oSub.HQty <= 0) |
| | | { |
| | | MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼æµè½¬å¡æ°éä¸è½ä¸º0æè
å°äº0"); |
| | | return false; |
| | | } |
| | | oSub.HProcNo = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HProcNoCol].Value); |
| | | if (oSub.HProcNo <= 0) |
| | | { |
| | | MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼æµæ°´å·ä¸è½ä¸º0æè
å°äº0"); |
| | | return false; |
| | | } |
| | | oSub.HProcID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HProcIDCol].Value); |
| | | oSub.HProcNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcNumberCol].Value); |
| | | oSub.HWorkRemark = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWorkRemarkCol].Value); |
| | | oSub.HCenterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HCenterIDCol].Value); |
| | | oSub.HDeptID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HDeptIDCol].Value); |
| | | oSub.HDeptNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HDeptNumberCol].Value); |
| | | //oSub.HGroupID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HGroupIDCol].Value); |
| | | oSub.HGroupNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HGroupNumberCol].Value); |
| | | oSub.HWorkerID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HWorkerIDCol].Value); |
| | | oSub.HWorkerNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWorkerNumberCol].Value); |
| | | oSub.HSourceID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSourceIDCol].Value); |
| | | oSub.HTimeUnit = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HTimeUnitCol].Value); |
| | | |
| | | oSub.HPlanWorkTimes = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HPlanWorkTimesCol].Value); |
| | | |
| | | oSub.HPlanBeginDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HPlanBeginDateCol].Value); |
| | | oSub.HPlanEndDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HPlanEndDateCol].Value); |
| | | oSub.HRelBeginDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HRelBeginDateCol].Value); |
| | | oSub.HRelEndDate = DBUtility.ClsPub.isDate(grdMain.Rows[i].Cells[HRelEndDateCol].Value); |
| | | |
| | | oSub.HReadyTime = 0; |
| | | oSub.HQueueTime = 0; |
| | | oSub.HMoveTime = 0; |
| | | oSub.HBeginDayQty = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HBeginDayQtyCol].Value); |
| | | oSub.HBeginFixQty = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HBeginFixQtyCol].Value); |
| | | oSub.HFixWorkDays = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HFixWorkDaysCol].Value); |
| | | oSub.HTrunWorkDays = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HTrunWorkDaysCol].Value); |
| | | oSub.HReadyTimes = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HReadyTimesCol].Value); |
| | | oSub.HMyWorkDays = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HMyWorkDaysCol].Value); |
| | | oSub.HOutPrice = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HOutPriceCol].Value); |
| | | oSub.HOutMoney = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HOutMoneyCol].Value); |
| | | |
| | | oSub.HLastProc = "å¦"; |
| | | oSub.HFstProc = "å¦"; |
| | | oSub.HKeyProc = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HKeyProcCol].Value); |
| | | |
| | | oSub.HSupID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSupIDCol].Value); |
| | | oSub.HSupFlag = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HSupFlagCol].Value); |
| | | oSub.HBackProc = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HBackProcCol].Value); |
| | | oSub.HEdit = DBUtility.ClsPub.isBool(grdMain.Rows[i].Cells[HEditCol].Value); |
| | | //if (oSub.HSourceID == 0) |
| | | //{ |
| | | // MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼çäº§èµæºä¸è½ä¸ºç©º"); |
| | | // return false; |
| | | //} |
| | | // |
| | | if (oSub.HCenterID == 0 && oSub.HSupFlag == false) |
| | | { |
| | | MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼å·¥ä½ä¸å¿æå§å¤æ è®°ä¸è½åæ¶ä¸ºç©º"); |
| | | return false; |
| | | } |
| | | oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HICMOBillNoCol].Value); |
| | | oSub.HICMOInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HICMOInterIDCol].Value); |
| | | oSub.HICMOEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HICMOEntryIDCol].Value); |
| | | oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSeOrderInterIDCol].Value); |
| | | oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HSeOrderEntryIDCol].Value); |
| | | oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HSeOrderBillNoCol].Value); |
| | | oSub.HWWOrderInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HWWOrderInterIDCol].Value); |
| | | oSub.HWWOrderEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HWWOrderEntryIDCol].Value); |
| | | oSub.HWWOrderBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWWOrderBillNoCol].Value); |
| | | oSub.HSumPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HSumPassRateCol].Value); |
| | | oSub.HPassRate = DBUtility.ClsPub.isSingle(grdMain.Rows[i].Cells[HPassRateCol].Value); |
| | | oSub.HOverRate = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HOverRateCol].Value); |
| | | oSub.HMaxQty = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[HMaxQtyCol].Value); |
| | | oSub.HTechnologyParameter = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HTechnologyParameterCol].Value); |
| | | oSub.HPicNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HPicNumCol].Value); |
| | | oSub.HProcCheckNote = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcCheckNoteCol].Value); |
| | | oSub.HMouldNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMouldNoCol].Value); |
| | | oSub.HProcWorkNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcWorkNumCol].Value); |
| | | BillNew.DetailColl.Add(oSub); |
| | | } |
| | | } |
| | | //ä¿å宿¯åå¤ç |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = BillNew.ModifyBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | } |
| | | //æç¤º |
| | | if (bResult == true) |
| | | { |
| | | BillChange = true; |
| | | MessageBox.Show("åæ®åç宿¯!åæ®å·:" + this.txtHBillNo.Text.Trim(), "æç¤º"); |
| | | //ä¿å宿¯åå¤ç |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View; |
| | | BillOld.omodel.HInterID = BillNew.omodel.HInterID; |
| | | this.Sub_ShowBill(); |
| | | bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | } |
| | | else if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) |
| | | else |
| | | { |
| | | BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View; |
| | | this.Sub_ShowBill(); |
| | | bResult = BillNew.ModifyBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo); |
| | | } |
| | | this.Sub_OperStatus(); |
| | | return true; |
| | | //æç¤º |
| | | if (bResult == true) |
| | | { |
| | | BillChange = true; |
| | | MessageBox.Show("åæ®åç宿¯!åæ®å·:" + this.txtHBillNo.Text.Trim(), "æç¤º"); |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View; |
| | | BillOld.omodel.HInterID = BillNew.omodel.HInterID; |
| | | this.Sub_ShowBill(); |
| | | } |
| | | else if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) |
| | | { |
| | | BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View; |
| | | this.Sub_ShowBill(); |
| | | } |
| | | this.Sub_OperStatus(); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("ä¿å失败!åå :" + ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | catch(Exception e1) |
| | | { |
| | | MessageBox.Show("ä¿å失败!åå :" + ClsPub.sExeReturnInfo, "æç¤º"); |
| | | MessageBox.Show(ClsPub.sExeReturnInfo + e1.Message); |
| | | return false; |
| | | } |
| | | } |