| | |
| | | public int HStdWorkTimes = 0; //æ åå·¥æ¶ |
| | | public int HUpperlimit = 0; //ä¸éæ¯ä¾ |
| | | public int HLowerlimit = 0; //ä¸éæ¯ä¾ |
| | | |
| | | //public int HMaterNumberCol = 0; //产å代ç |
| | | //public int HWorkTypeNameCol = 0; //å·¥ç§ |
| | | //public int HProcNameCol = 0; //å·¥åº |
| | | //public int HWorkCenterNameCol = 0; //å·¥ä½ä¸å¿ |
| | | //public int HProcMulNameCol = 0; //工段 |
| | | //public int HWorkCenterName_SCol = 0; //产线 |
| | | //public int HWorkQtyCol = 0; //äº§è½ |
| | | //public int HSubStdEmpQtyCol = 0; //äººæ° |
| | | //public int HWorkQty_SCol = 0; //äº§çº¿äº§è½ |
| | | //public int HSubStdEmpQty_SCol = 0; //äº§çº¿äººæ° |
| | | |
| | | //public int HMouldNoCol = 0; //模å
·ç¼å· |
| | | //public int HChangeMouldCol = 0; //æ¢æ¨¡æ¶é´ |
| | | //public int HPackStdCol = 0; //å¨è½¬ç®±æ å |
| | | //public int HPackCol = 0; //å¨è½¬ç®± |
| | | //public int HPutAreaCol = 0; //ææ¾åº |
| | | //// |
| | | //public int HMyWorkDaysCol = 0; //çäº§å¨æ |
| | | //public int HMyFixWorkDaysCol = 0; //åºå®çäº§å¤©æ° |
| | | |
| | | //public int HBeginDayQtyCol = 6; //å¼å·¥åºå¤© |
| | | //public int HBeginFixQtyCol = 7; //å¼å·¥ä½é |
| | | //public int HFixPriceCol = 8; //å®é¢ å°æ¶å·¥èµ |
| | | //public int HProcPriceCol = 9; //工价 |
| | | //public int HProcTypeCol = 0; //å·¥åºç±»å |
| | | // |
| | | public const int HBeginRow = 2; //æææ°æ®ï¼å¼å§è¡æ° |
| | | |
| | | |
| | | // |
| | | //DAL.ClsGy_RoutingBill; |
| | | public DAL.ClsGy_Process_View oProcHlp = new DAL.ClsGy_Process_View(); |
| | | public DAL.ClsGy_StdWorkTimes_Ctl BillNew = new DAL.ClsGy_StdWorkTimes_Ctl(); |
| | | DAL.ClsIF_Material_View oMaterHlp = new DAL.ClsIF_Material_View(); |
| | | //DAL.ClsGy_WorkType_View oWorkType = new DAL.ClsGy_WorkType_View(); |
| | | long j = -1; |
| | | int c = 0; |
| | | |
| | | |
| | | |
| | | public override bool OpenExcelData() |
| | | { |
| | | base.sSheetName = txtHSheetName.Text; |
| | | return base.OpenExcelData(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå§åçé¢ |
| | |
| | | public override void initData() |
| | | { |
| | | base.initData(); |
| | | base.sSheetName = txtHSheetName.Text ; |
| | | base.sSheetName = "æ åå·¥æ¶"; |
| | | base.ModRightName = "Gy_StdWorkTimes_RoutingBill"; |
| | | base.ModRightNameCheck = base.ModRightName + base.ModRightNameCheck; |
| | | base.ModRightNameClose = base.ModRightName + base.ModRightNameClose; |
| | |
| | | base.ModRightNameEdit = base.ModRightName + base.ModRightNameEdit; |
| | | base.ModRightNameMoney = base.ModRightName + base.ModRightNameMoney; |
| | | base.ModRightNameQty = base.ModRightName + base.ModRightNameQty; |
| | | base.ModCaption = "æ åå·¥æ¶å¯¼å
¥"; |
| | | base.ModCaption = "æ åå·¥æ¶"; |
| | | this.Text = base.ModCaption; |
| | | lblCaption.Text = base.ModCaption; |
| | | // |
| | |
| | | DBUtility.Gy_BaseFun.SetComboxPeriod(cmbHPeriod); |
| | | // |
| | | } |
| | | //导å
¥ |
| | | |
| | | public override void Sub_DataIn() |
| | | { |
| | | string hnumber = ""; |
| | | // |
| | | HStdWorkTimes = DBUtility.Gy_BaseFun.Fun_GetCol("æ åå·¥æ¶", grdMain); |
| | | HProcNum = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åºä»£ç ", grdMain); |
| | | HProcName = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åº", grdMain); |
| | | HMaterNum = DBUtility.Gy_BaseFun.Fun_GetCol("ç©æä»£ç ", grdMain); |
| | | HMaterName = DBUtility.Gy_BaseFun.Fun_GetCol("ç©æ", grdMain); |
| | | HUpperlimit = DBUtility.Gy_BaseFun.Fun_GetCol("ä¸çº¿æ¯ä¾", grdMain); |
| | | HLowerlimit = DBUtility.Gy_BaseFun.Fun_GetCol("ä¸çº¿æ¯ä¾", grdMain); |
| | | HUSEORGName = DBUtility.Gy_BaseFun.Fun_GetCol("ç»ç»", grdMain); |
| | | HMaker = DBUtility.Gy_BaseFun.Fun_GetCol("å¶å人", grdMain); |
| | | HMakeDate = DBUtility.Gy_BaseFun.Fun_GetCol("å¶åæ¥æ", grdMain); |
| | | int sHStdWorkTimesCol = DBUtility.Gy_BaseFun.Fun_GetCol("æ åå·¥æ¶", grdMain); |
| | | int sHProcNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åºä»£ç ", grdMain); |
| | | int sHProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åº", grdMain); |
| | | int sHMaterNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("ç©æä»£ç ", grdMain); |
| | | int sHMaterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("ç©æ", grdMain); |
| | | int sHUpperlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("ä¸çº¿æ¯ä¾", grdMain); |
| | | int sHLowerlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("ä¸çº¿æ¯ä¾", grdMain); |
| | | int sHUSEORGNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("ç»ç»", grdMain); |
| | | int sHMakerCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¶å人", grdMain); |
| | | int sHMakeDateCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¶åæ¥æ", grdMain); |
| | | |
| | | //æ²¡ææ¾å°å |
| | | if (HStdWorkTimes == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãæ åå·¥æ¶ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HProcName == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå·¥åºãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HMaterName == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãç©æãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HUpperlimit == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãä¸çº¿æ¯ä¾ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HLowerlimit == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãä¸çº¿æ¯ä¾ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HUSEORGName == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãç»ç»ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HMaker == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¶å人ãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | if (HMakeDate == -1) |
| | | { |
| | | MessageBox.Show("æ²¡ææ¾å°ãå¶åæ¥æãçæ é¢", "æç¤º"); |
| | | return; |
| | | } |
| | | // |
| | | if (!Checkdata()) |
| | | { |
| | | return; |
| | | } |
| | | if (grdMain.Rows.Count > 0) |
| | | { |
| | | hnumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells[HMaterNum].Value); |
| | | BillNew.omodel.HMakeDate = (DateTime.Today.Date).ToString(); |
| | | BillNew.omodel.HUSEORGID = DBUtility.ClsPub.HOrgID; |
| | | BillNew.omodel.HStopflag = false; |
| | | BillNew.DetailColl.Clear(); |
| | | } |
| | | for (int i = 0; i <= grdMain.Rows.Count - 1; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcNum].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNum].Value) != "") |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHMaterNumCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHProcNumCol].Value) != "") |
| | | { |
| | | //åå
¥ç±» |
| | | if (WriteClass(i)) |
| | |
| | | //åå
¥ç±» 仿§ä»¶ |
| | | private bool WriteClass(int row) |
| | | { |
| | | string sHNumber = ""; |
| | | string sHNamePoc = ""; |
| | | string HStopflag = ""; |
| | | string HUSEORGID = ""; |
| | | //string sHNumberWorkType = ""; |
| | | string HStdWorkTimes = ""; |
| | | string HUpperlimit=""; //ä¸éæ¯ä¾ |
| | | string HLowerlimit=""; //ä¸éæ¯ä¾ |
| | | BillNew.DetailColl.Clear(); |
| | | string sMaterNumber = ""; |
| | | string sMaterName = ""; |
| | | string sProcNumber = ""; |
| | | string sProcName = ""; |
| | | double sStdWorkTimes = 0; |
| | | double sUpperlimit = 0; |
| | | double sLowerlimit = 0; |
| | | int sUSEORGName = 0; |
| | | DateTime sHMakeDate = DateTime.Today.Date; |
| | | string sHMaker = DBUtility.ClsPub.CurUserName; |
| | | |
| | | int HMaterNum = DBUtility.Gy_BaseFun.Fun_GetCol("产å代ç ", grdMain); |
| | | int sMaterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("产ååç§°", grdMain); |
| | | int sModelCol = DBUtility.Gy_BaseFun.Fun_GetCol("è§æ ¼åå·", grdMain); |
| | | int HProcNum = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åºä»£ç ", grdMain); |
| | | int sProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åº", grdMain); |
| | | int sSourceNumberCol = DBUtility.Gy_BaseFun.Fun_GetCol("èµæºä»£ç ", grdMain); |
| | | int sSourceNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("çäº§èµæº", grdMain); |
| | | int sPriceCol = DBUtility.Gy_BaseFun.Fun_GetCol("åä»·", grdMain); |
| | | //long HItemID = 0; |
| | | int sHStdWorkTimesCol = DBUtility.Gy_BaseFun.Fun_GetCol("æ åå·¥æ¶", grdMain); |
| | | int sHProcNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åºä»£ç ", grdMain); |
| | | int sHProcNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("å·¥åº", grdMain); |
| | | int sHMaterNumCol = DBUtility.Gy_BaseFun.Fun_GetCol("ç©æä»£ç ", grdMain); |
| | | int sHMaterNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("ç©æ", grdMain); |
| | | int sHUpperlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("ä¸çº¿æ¯ä¾", grdMain); |
| | | int sHLowerlimitCol = DBUtility.Gy_BaseFun.Fun_GetCol("ä¸çº¿æ¯ä¾", grdMain); |
| | | int sHUSEORGNameCol = DBUtility.Gy_BaseFun.Fun_GetCol("ç»ç»", grdMain); |
| | | int sHMakerCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¶å人", grdMain); |
| | | int sHMakeDateCol = DBUtility.Gy_BaseFun.Fun_GetCol("å¶åæ¥æ", grdMain); |
| | | // |
| | | sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HMaterNum].Value); |
| | | sHNamePoc = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[HProcNum].Value); |
| | | // |
| | | // |
| | | HStopflag = DBUtility.ClsPub.isBool(grdMain.Rows[row].Cells[HStopflag].Value).ToString(); |
| | | HUSEORGID = DBUtility.ClsPub.HOrgID.ToString(); |
| | | HStdWorkTimes = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HStdWorkTimes].Value).ToString(); |
| | | HUpperlimit = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HUpperlimit].Value).ToString(); |
| | | HLowerlimit = DBUtility.ClsPub.isSingle(grdMain.Rows[row].Cells[HLowerlimit].Value).ToString(); |
| | | sMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHMaterNumCol].Value); |
| | | //sMaterName = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHMaterNameCol].Value); |
| | | sProcNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHProcNumCol].Value); |
| | | //sProcName = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHProcNameCol].Value); |
| | | sStdWorkTimes = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHStdWorkTimesCol].Value); |
| | | sUpperlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHUpperlimitCol].Value); |
| | | sLowerlimit = DBUtility.ClsPub.isDoule(grdMain.Rows[row].Cells[sHLowerlimitCol].Value); |
| | | //sUSEORGName = DBUtility.ClsPub.isInt(grdMain.Rows[row].Cells[sHUSEORGNameCol].Value); |
| | | //sHMakeDate = DBUtility.ClsPub.isDate(grdMain.Rows[row].Cells[sHMakeDateCol].Value); |
| | | //sHMaker = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHMakerCol].Value); |
| | | |
| | | //夿æ¯å¦å
许 ä¿å |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNumber)) |
| | | //å®¡æ ¸ä»£ç æ¯å¦åç |
| | | if (!DBUtility.ClsPub.AllowNumber(sMaterNumber)) |
| | | { |
| | | MessageBox.Show("产å代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNamePoc)) |
| | | if (!DBUtility.ClsPub.AllowNumber(sProcNumber)) |
| | | { |
| | | MessageBox.Show("å·¥åºä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | |
| | | Model.ClsGy_StdWorkTimes_Model oSub = new Model.ClsGy_StdWorkTimes_Model(); |
| | | |
| | | //å¾å°å·¥åºå
ç |
| | | if (oProcHlp.GetInfoByName(sHNamePoc)) |
| | | { |
| | | oSub.HProcID = oProcHlp.omodel.HItemID; |
| | | } |
| | | //å¾å°ç©æå
ç |
| | | if (oMaterHlp.GetInfoByName(sHNumber)) |
| | | if (oMaterHlp.GetInfoByNumber(sMaterNumber)) |
| | | { |
| | | oSub.HMaterID = oMaterHlp.omodel.HItemID; |
| | | } |
| | | |
| | | |
| | | //åå
¥ä¿¡æ¯ |
| | | oSub.HEntryID = j; |
| | | |
| | | oSub.HMaker = DBUtility.ClsPub.CurUserName; |
| | | oSub.HMakeDate = (DateTime.Today.Date).ToString(); |
| | | oSub.HStdWorkTimes = double.Parse(HStdWorkTimes); |
| | | oSub.HRemark = ""; |
| | | oSub.HUpperlimit = double.Parse(HUpperlimit); |
| | | oSub.HLowerlimit = double.Parse(HLowerlimit); |
| | | oSub.HStopflag = bool.Parse(HStopflag); |
| | | |
| | | |
| | | BillNew.DetailColl.Add(oSub); |
| | | return true; |
| | | } |
| | | |
| | | //æ£æ¥ç©æ |
| | | private bool Checkdata() |
| | | { |
| | | bool b = false; |
| | | string sErrMsg = ""; |
| | | string sMsg = ""; |
| | | for (int i = 0; i <= grdMain.Rows.Count - 1; i++) |
| | | else |
| | | { |
| | | string sHNumber = ""; |
| | | string sHNamePoc = ""; |
| | | |
| | | // |
| | | sHNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMaterNum].Value); |
| | | sHNamePoc = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcNum].Value); |
| | | if (sHNumber != "") |
| | | { |
| | | // |
| | | //å®¡æ ¸ä»£ç æ¯å¦åç |
| | | if (!DBUtility.ClsPub.AllowNumber(sHNumber)) |
| | | { |
| | | MessageBox.Show("ç©æä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | //å¾å°ç©æå
ç |
| | | int j = i + HBeginRow; |
| | | if (!oMaterHlp.GetInfoByNumber(sHNumber)) |
| | | { |
| | | sMsg = "[" + sHNumber + "]ç©æä¸åå¨"; |
| | | if (sErrMsg.Contains(sMsg) == false) |
| | | { |
| | | sErrMsg = sErrMsg + "[" + sHNumber + "]ç©æä¸åå¨\r\n"; |
| | | } |
| | | b = true; |
| | | } |
| | | //å¾å°å·¥åºå
ç |
| | | if (!oProcHlp.GetInfoByName(sHNamePoc)) |
| | | { |
| | | sMsg = "[" + sHNamePoc + "]å·¥åºä¸åå¨"; |
| | | if (sErrMsg.Contains(sMsg) == false) |
| | | { |
| | | sErrMsg = sErrMsg + "[" + sHNamePoc + "]å·¥åºä¸åå¨\r\n"; |
| | | } |
| | | b = true; |
| | | } |
| | | } |
| | | } |
| | | if (b == true) |
| | | { |
| | | Pub_Control.ErrMsgBox oMsgbox = new Pub_Control.ErrMsgBox(); |
| | | oMsgbox.txtHErrMsg.Text = sErrMsg; |
| | | oMsgbox.ShowDialog(); |
| | | oSub.HMaterID = 0; |
| | | MessageBox.Show("第" + row.ToString() + "è¡," + sMaterNumber + "æ²¡ææ¾å°å¯¹åºçç©æï¼"); |
| | | return false; |
| | | } |
| | | //å¾å°å·¥åºå
ç |
| | | if (oProcHlp.GetInfoByNumber(sProcNumber)) |
| | | { |
| | | oSub.HProcID = oProcHlp.omodel.HItemID; |
| | | } |
| | | else |
| | | { |
| | | return true; |
| | | oSub.HProcID = 0; |
| | | MessageBox.Show("第" + row.ToString() + "è¡," + sProcNumber + "æ²¡ææ¾å°å¯¹åºçå·¥åºï¼"); |
| | | return false; |
| | | } |
| | | |
| | | //åå
¥ä¿¡æ¯ |
| | | |
| | | oSub.HRemark = ""; |
| | | oSub.HStdWorkTimes = sStdWorkTimes; |
| | | oSub.HUpperlimit = sUpperlimit; |
| | | oSub.HLowerlimit = sLowerlimit; |
| | | oSub.HUSEORGID = DBUtility.ClsPub.HOrgID; |
| | | oSub.HMaker = DBUtility.ClsPub.CurUserName; |
| | | oSub.HMakeDate = DateTime.Today.ToShortDateString(); |
| | | BillNew.DetailColl.Add(oSub); |
| | | //oProc.oModel.HBillSubType = DBUtility.ClsPub.isStrNull(txtHBillSubType.Text); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | private void Gy_StdWorkTimes_RoutingBill_Load(object sender, EventArgs e) |
| | | { |
| | | |