| | |
| | | //忮宿´æ§å¤æ æªå®æ |
| | | private bool Sub_AllowSave() |
| | | { |
| | | //å¿
è¾é¡¹ç®æ¯å¦ä¸ºç©º |
| | | //ClsK3_DepartmentHlp oDept = new ClsK3_DepartmentHlp(); |
| | | //if(!oDept.GetInfoByID(ClsPub.isLong(txtHDeptID.Tag))) |
| | | //{ |
| | | // MessageBox.Show("é¨é¨ä¸åå¨ï¼"); |
| | | // return false; |
| | | //} |
| | | |
| | | //æç»è¡¨æ¯å¦ä¸ºé¶è¡ |
| | | |
| | | if (!IsNullRow(0)) |
| | | { |
| | | MessageBox.Show("è¡¨ä½æç»è¡ä¸åå¨ï¼è¯·å½å
¥ï¼", "æç¤º"); |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | } |
| | | //æ¯å¦æ¯ç©ºè¡ |
| | | private bool IsNullRow(int Row) |
| | | { |
| | | if (ClsPub.isInt(grdMain1.Rows[Row].Cells[HMaterIDCol].Value) == 0&& ClsPub.isInt(grdMain1.Rows[Row].Cells[HProcIDCol].Value) == 0&& ClsPub.isDoule( grdMain1.Rows[Row].Cells[HStdWorkTimes].Value )== 0&& ClsPub.isDoule(grdMain1.Rows[Row].Cells[HUpperlimit].Value) == 0&& ClsPub.isDoule(grdMain1.Rows[Row].Cells[HLowerlimit].Value) == 0&& ClsPub.isStrNull(grdMain1.Rows[Row].Cells[HRemarkCol].Value) == ""&& ClsPub.isDoule(grdMain1.Rows[Row].Cells[HStdPiece].Value) == 0&& ClsPub.isDoule(grdMain1.Rows[Row].Cells[HStdPiece].Value) == 0) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | //ä¿ååæ® |
| | | private bool Sub_SaveBill() |
| | |
| | | Int32 i; |
| | | bool bResult; |
| | | BillNew = new DAL.ClsGy_StdWorkTimes_Ctl(); |
| | | //ç¼è¾æé |
| | | //if (!ClsPub.Security_Log(ModRightNameEdit, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // return false; |
| | | //} |
| | | |
| | | //失å»ç¦ç¹ |
| | | lblCaption.Focus(); |
| | | // |
| | |
| | | BillNew.DetailColl = new List<Model.ClsGy_StdWorkTimes_Model>(); |
| | | for (i = 0; i <= grdMain1.RowCount - 1; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HMaterIDCol].Value) != 0 && DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HProcIDCol].Value) != 0) |
| | | if (IsNullRow(i)) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HStdWorkTimes].Value)>0&& DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HUpperlimit].Value) > 0&& DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HLowerlimit].Value) > 0 && DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HStdPiece].Value) > 0 && DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HStdPric].Value) > 0) |
| | | break; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(grdMain1.Rows[i].Cells[HMaterIDCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain1.Rows[i].Cells[HProcIDCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain1.Rows[i].Cells[HStdWorkTimes].Value) != "") |
| | | { |
| | | if (DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdWorkTimes].Value) > 0 && DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HUpperlimit].Value) > 0 && DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HLowerlimit].Value) > 0 && DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdPiece].Value) > 0 && DBUtility.ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdPric].Value) > 0) |
| | | { |
| | | Model.ClsGy_StdWorkTimes_Model oSub = new Model.ClsGy_StdWorkTimes_Model(); |
| | | oSub.HMaterID = ClsPub.isLong(grdMain1.Rows[i].Cells[HMaterIDCol].Value); |
| | |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("第" + (i+1) + "è¡,æ åå·¥æ¶,ä¸éæ¯ä¾,ä¸éæ¯ä¾ï¼æ åè®¡ä»¶åæ å计价é½åºå¤§äº0", "æç¤º"); |
| | | MessageBox.Show("第" + (i + 1) + "è¡,æ åå·¥æ¶,ä¸éæ¯ä¾,ä¸éæ¯ä¾ï¼æ åè®¡ä»¶åæ å计价é½åºå¤§äº0", "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("第" + (i + 1) + "è¡,ç©æãå·¥åºåæ åå·¥æ¶ä¸è½ä¸ºç©º", "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | | //ä¿å宿¯åå¤ç |
| | |
| | | // |
| | | oSumGrid.EditStatus = false; |
| | | return true; |
| | | } |
| | | //æ¯å¦æ¯ç©ºè¡ |
| | | private bool IsNullRow(int Row) |
| | | { |
| | | if (ClsPub.isInt(grdMain1.Rows[Row].Cells[HMaterIDCol].Value) == 0) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | //'å¤æç½æ ¼è¡çå½å
¥æ¯å¦æ£ç¡® |
| | | private bool CheckGridRow(int Row) |
| | |
| | | sr = CurNode.Text.Split(c); |
| | | HParentID = sr[0].ToString(); |
| | | } |
| | | //è¿æ»¤æ¡ä»¶ |
| | | if (HParentID == "" || HParentID == "ç©æèµæ" || HParentID == "å·¥åºèµæ") |
| | | if (frmCondition==null) |
| | | { |
| | | sSql = "Select top 10000 * from " + ViewName + " order by HItemID Desc"; |
| | | } |
| | | else |
| | | { |
| | | if (wl.Checked == false) |
| | | //è¿æ»¤æ¡ä»¶ |
| | | if (HParentID == "" || HParentID == "ç©æèµæ" || HParentID == "å·¥åºèµæ") |
| | | { |
| | | sSql = "Select top 10000 * from " + ViewName + " where å·¥åºä»£ç like '%" + HParentID.ToString() + "%' order by HItemID Desc"; |
| | | sSql = "Select top 10000 * from " + ViewName + " order by HItemID Desc"; |
| | | } |
| | | else |
| | | { |
| | | sSql = "Select top 10000 * from " + ViewName + " where ç©æä»£ç like '%" + HParentID.ToString() + "%' order by HItemID Desc "; |
| | | } |
| | | if (wl.Checked == false) |
| | | { |
| | | sSql = "Select top 10000 * from " + ViewName + " where å·¥åºä»£ç like '%" + HParentID.ToString() + "%' order by HItemID Desc"; |
| | | } |
| | | else |
| | | { |
| | | sSql = "Select top 10000 * from " + ViewName + " where ç©æä»£ç like '%" + HParentID.ToString() + "%' order by HItemID Desc "; |
| | | } |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sSql = frmCondition.SqlStr + sWhere + " order by " + ModName; |
| | | } |
| | | |
| | | //æ§è¡SQL |
| | | DSet = SubCn.RunProcReturn(sSql, ViewName); |
| | | |
| | |
| | | else |
| | | { |
| | | //å®¡æ ¸ |
| | | if (oItem.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | MessageBox.Show("å®¡æ ¸æå!", "æç¤º"); |
| | | } |
| | | else |
| | | if (oItem.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) != true) |
| | | { |
| | | MessageBox.Show("å®¡æ ¸å¤±è´¥!", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | MessageBox.Show("å®¡æ ¸æåï¼è¯·å·æ°ï¼", "æç¤º"); |
| | | MessageBox.Show("å®¡æ ¸æå!", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | //åå®¡æ ¸ |
| | |
| | | else |
| | | { |
| | | //å®¡æ ¸ |
| | | if (oItem.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | MessageBox.Show("åå®¡æ ¸æå!", "æç¤º"); |
| | | } |
| | | else |
| | | if (oItem.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) != true) |
| | | { |
| | | MessageBox.Show("åå®¡æ ¸å¤±è´¥!", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | MessageBox.Show("å®¡æ ¸æåï¼è¯·å·æ°ï¼", "æç¤º"); |
| | | MessageBox.Show("åå®¡æ ¸æå!", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | |
| | |
| | | else |
| | | { |
| | | oCn.RunProc(" Update Gy_StdWorkTimes set HStopflag=1 Where HItemID=" + lngBillKey.ToString()); |
| | | |
| | | } |
| | | } |
| | | MessageBox.Show("ç¦ç¨æåï¼è¯·å·æ°ï¼", "æç¤º"); |
| | | MessageBox.Show("ç¦ç¨æåï¼", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | |
| | |
| | | else |
| | | { |
| | | oCn.RunProc(" Update Gy_StdWorkTimes set HStopflag=0 Where HItemID=" + lngBillKey.ToString()); |
| | | |
| | | } |
| | | } |
| | | MessageBox.Show("åç¦ç¨æåï¼è¯·å·æ°ï¼", "æç¤º"); |
| | | MessageBox.Show("åç¦ç¨æåï¼", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | } |
| | |
| | | DAL.ClsIF_Group_View oGroup = new DAL.ClsIF_Group_View(); |
| | | DAL.ClsIF_Process_View oProc = new DAL.ClsIF_Process_View(); |
| | | DAL.ClsIF_Supplier_View oSup = new DAL.ClsIF_Supplier_View(); |
| | | DAL.ClsIF_Warehouse_View oWare = new DAL.ClsIF_Warehouse_View(); |
| | | DAL.ClsIF_Warehouse_View oWare = new DAL.ClsIF_Warehouse_View(); |
| | | int FieldNameCol = 2; |
| | | int ConditionCol = 4; |
| | | if (sCol != ConditionCol) |
| | |
| | | |
| | | for (int i = 0; i <= grdMain.Rows.Count - 1; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHMaterNumCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHProcNumCol].Value) != "") |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHMaterNumCol].Value) != "" && DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHProcNumCol].Value) != ""&& DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[sHStdWorkTimesCol].Value) != "") |
| | | { |
| | | //åå
¥ç±» |
| | | if (WriteClass(i)) |
| | | if (DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHStdWorkTimesCol].Value)>0&& DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHUpperlimitCol].Value) > 0&& DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells[sHLowerlimitCol].Value) > 0) |
| | | { |
| | | //ä¿åè®°å½ |
| | | if (!BillNew.AddNew()) |
| | | //åå
¥ç±» |
| | | if (WriteClass(i)) |
| | | { |
| | | MessageBox.Show("导å
¥å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | //ä¿åè®°å½ |
| | | if (!BillNew.AddNew()) |
| | | { |
| | | MessageBox.Show("导å
¥å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("第" + (i + 1) + "è¡,æ åå·¥æ¶ãä¸éæ¯ä¾åä¸éæ¯ä¾ä¸è½å°äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("å·¥åºä»£ç æç©æä»£ç 为空!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | MessageBox.Show("第"+(i+1)+"è¡,å·¥åºä»£ç ãç©æä»£ç åæ åå·¥æ¶ä¸è½ä¸ºç©º!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | |
| | | //sHMaker = DBUtility.ClsPub.isStrNull(grdMain.Rows[row].Cells[sHMakerCol].Value); |
| | | |
| | | //夿æ¯å¦å
许 ä¿å |
| | | |
| | | //å®¡æ ¸ä»£ç æ¯å¦åç |
| | | if (!DBUtility.ClsPub.AllowNumber(sMaterNumber)) |
| | | { |
| | |
| | | int HYear = DBUtility.ClsPub.isInt(DateTime.Now.Year); |
| | | double HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | string HMouldNo = mainList[0].HMouldNo; |
| | | string HBarCode = mainList[0].HBarCode; |
| | | string HName = mainList[0].HName; |
| | | string HModel = mainList[0].HModel; |
| | | string HModel2 = mainList[0].HModel2; |
| | |
| | | ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" + |
| | | ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" + |
| | | ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" + |
| | | ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID" + |
| | | ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode" + |
| | | ") " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" + |
| | |
| | | ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" + |
| | | "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +","+ HCaveQty+ |
| | | "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID+"','"+ HNowSupTypeID+"'"+ |
| | | ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID+"','"+ HMouldMaintainRuleInterID+"'"+ |
| | | ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID+"','"+ HMouldMaintainRuleInterID+"','"+ HBarCode+"'"+ |
| | | ") "); |
| | | |
| | | |
| | |
| | | ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID" + |
| | | ") " + |
| | | " values('3899','3899'," + HItemID + ",'" + Num1 + j + "',getdate()" + |
| | | "," + dr["HYear"] + "," + dr["HPeriod"] + ",'" + dr["HRemark"] + "','" + dr["HMaker"] + "',getdate(),'" + dr["HBarCode"] + |
| | | "," + dr["HYear"] + "," + dr["HPeriod"] + ",'" + dr["HRemark"] + "','" + dr["HMaker"] + "',getdate(),'" + Num1 + j + |
| | | "','" + Num1 + j + "','" + dr["HName"] + "','" + dr["HModel"] + "','" + dr["HModel2"] + "','" + dr["HDiameter"] + "'" + |
| | | ",'" + dr["HSubjoin"] + "','" + dr["HSubjoin2"] + "','" + dr["HPICNo"] + "','" + dr["HWorkMaterModel"] + "'" + |
| | | "," + dr["HMaterID"] + ",'" + dr["HMaterNumber"] + "',0," + dr["HUnitID"] + |