| | |
| | | //忮宿´æ§å¤æ æªå®æ |
| | | 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) |