| | |
| | | public const Int16 HLowerlimit = 11; |
| | | public const Int16 HUSEORGID = 12; |
| | | public const Int16 HRemarkCol = 13; |
| | | public const Int16 HStdPiece = 14; |
| | | public const Int16 HStdPric = 15; |
| | | public bool BillChange; // |
| | | public DBUtility.ClsPub.Enum_OKTag OkTag; |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | |
| | | public DAL.ClsGy_StdWorkTimes_Ctl BillNew = new DAL.ClsGy_StdWorkTimes_Ctl(); |
| | | public Model.ClsGy_StdWorkTimes_Model BillOld = new Model.ClsGy_StdWorkTimes_Model(); |
| | | ClsGridViewSum oSumGrid = new ClsGridViewSum(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | |
| | | |
| | | |
| | | #region åºå®ä»£ç |
| | | //å计 |
| | | private void Total() |
| | |
| | | private void bclk_Click(object sender, EventArgs e) |
| | | { |
| | | //ä¿åå宽 |
| | | DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name); |
| | | DBUtility.Xt_BaseBillFun.SaveGrid(grdMain1, this.Name); |
| | | } |
| | | |
| | | private void mrlk_Click(object sender, EventArgs e) |
| | | { |
| | | DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name); |
| | | DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain1, this.Name); |
| | | } |
| | | |
| | | //æ¸
空çé¢ |
| | |
| | | { |
| | | //æå°åå§å |
| | | oSumGrid.NoCol = HSnoCol; |
| | | oSumGrid.ogrdMain = grdMain; |
| | | oSumGrid.ogrdMain = grdMain1; |
| | | oSumGrid.oGridsum = grdSum; |
| | | lblCaption.Text = ModName; |
| | | textBox1.Hide(); |
| | | textBox2.Hide(); |
| | | this.Text = ModName; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | //ä¿®æ¹æçº½ |
| | | private void xg_Click(object sender, EventArgs e) |
| | | { |
| | | this.Sub_EditBill(); |
| | | try |
| | | { |
| | | if (Convert.ToDecimal(txtHStdWorkTimes.Text.ToString())<=0) |
| | | { |
| | | MessageBox.Show("æ åå·¥æ¶å¿
须大äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | if (Convert.ToDecimal(txtHUpperlimit.Text) <= 0) |
| | | { |
| | | MessageBox.Show("ä¸éæ¯ä¾å¿
须大äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | if (Convert.ToDecimal(txtHLowerlimit.Text) <= 0) |
| | | { |
| | | MessageBox.Show("ä¸çº¿æ¯ä¾å¿
须大äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | if (Convert.ToDecimal(txtHStdPiece.Text) <= 0) |
| | | { |
| | | MessageBox.Show("æ å计件å¿
须大äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | if (Convert.ToDecimal(txtHStdPric.Text) <= 0) |
| | | { |
| | | MessageBox.Show("æ å计价å¿
须大äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | string sql = string.Format(@"Update Gy_StdWorkTimes set" + |
| | | " HMaterID=" + textBox1.Text + |
| | | ",HProcID=" + textBox2.Text + |
| | | ",HStdWorkTimes=" + txtHStdWorkTimes.Text + |
| | | ",HUpperlimit=" + txtHUpperlimit.Text + |
| | | ",HLowerlimit=" + txtHLowerlimit.Text + |
| | | ",HStdPiece=" + txtHStdPiece.Text + |
| | | ",HStdPric=" + txtHStdPric.Text + |
| | | ",HMaker='" + DBUtility.ClsPub.CurUserName + "'" + |
| | | ",HMakeDate='" + DateTime.Now + "'" + |
| | | ",HUSEORGID=" + DBUtility.ClsPub.HOrgID + |
| | | " where HItemID=" + BillOld.HItemID); |
| | | oCn.BeginTran(); |
| | | oCn.RunProc(sql); |
| | | oCn.Commit(); |
| | | MessageBox.Show("ä¿®æ¹æå,请éåºå¹¶å·æ°", "æç¤º"); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | oCn.RollBack(); |
| | | MessageBox.Show("ä¿®æ¹å¤±è´¥", "æç¤º"); |
| | | throw; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | //å é¤æé® |
| | | private void sc_Click(object sender, EventArgs e) |
| | |
| | | { |
| | | timer1.Enabled = false; |
| | | Sub_ControlLocation(); |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_View)//|| BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Viewonly |
| | | if (BillOld.HItemID.ToString()!=null&& BillOld.HItemID.ToString() !="0")//|| BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Viewonly |
| | | { |
| | | this.Sub_ShowBill(); |
| | | } |
| | |
| | | { |
| | | switch (BillStatus) |
| | | { |
| | | case DBUtility.ClsPub.Enum_BillStatus.BillStatus_View: |
| | | //case DBUtility.ClsPub.Enum_BillStatus.BillStatus_Viewonly: |
| | | //æµè§ç¶æ |
| | | yl.Enabled = true; |
| | | xz.Enabled = true; |
| | | case 0: |
| | | xg.Enabled = true; |
| | | sc.Enabled = true; |
| | | AddRow.Enabled = false; |
| | | DelRow.Enabled = false; |
| | | bc.Enabled = false; |
| | | tc.Enabled = true; |
| | | //æªå®¡æ ¸ |
| | | if (txtHChecker.Text.Trim() == "") |
| | | { |
| | | xg.Enabled = true; |
| | | sc.Enabled = true; |
| | | } |
| | | else |
| | | { |
| | | xg.Enabled = false; |
| | | sc.Enabled = false; |
| | | } |
| | | Sub_LrtextStatus(true); |
| | | grdStatus = true; |
| | | break; |
| | | case DBUtility.ClsPub.Enum_BillStatus.BillStatus_View: |
| | | xg.Enabled = true; |
| | | AddRow.Enabled = false; |
| | | DelRow.Enabled = false; |
| | | bc.Enabled = false; |
| | | tc.Enabled = true; |
| | | Sub_LrtextStatus(false); |
| | | grdStatus = false; |
| | | break; |
| | | case DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew: |
| | | //æ°å¢ç¶æ |
| | | yl.Enabled = false; |
| | | xz.Enabled = false; |
| | | xg.Enabled = false; |
| | | sc.Enabled = false; |
| | | AddRow.Enabled = true; |
| | | DelRow.Enabled = true; |
| | | bc.Enabled = true; |
| | |
| | | break; |
| | | case DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify: |
| | | //ä¿®æ¹ç¶æ |
| | | yl.Enabled = false; |
| | | xz.Enabled = false; |
| | | xg.Enabled = false; |
| | | sc.Enabled = false; |
| | | AddRow.Enabled = true; |
| | | DelRow.Enabled = true; |
| | | bc.Enabled = true; |
| | |
| | | Sub_LrtextStatus(true); |
| | | grdStatus = true; |
| | | break; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View(); |
| | | DAL.ClsIF_Process_View oProc = new DAL.ClsIF_Process_View(); |
| | | //夿æ¯å¦åå¨åæ® |
| | | if (BillNew.ShowBill(BillOld.HItemID, ref ClsPub.sExeReturnInfo) == false) |
| | | { |
| | | MessageBox.Show(ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | DataSet DsSub = oCn.RunProcReturn("Select * from h_v_Gy_StdWorkTimesListNew Where HitemID=" + BillOld.HItemID.ToString(), "Gy_StdWorkTimes"); |
| | | DataRow dr = DsSub.Tables[0].Rows[0]; |
| | | |
| | | //æ¸
空 |
| | | Sub_ClearBill(); |
| | | |
| | | // |
| | | this.txtHMaker.Text = BillOld.HMaker; |
| | | this.txtHMakeDate.Text = BillOld.HMakeDate; |
| | | this.txtHChecker.Text = BillOld.HChecker; |
| | | |
| | | //å è½½è¡¨ä½ |
| | | initGrid(); |
| | | int i = 0; |
| | | foreach (Model.ClsGy_StdWorkTimes_Model oSub in BillNew.DetailColl) |
| | | { |
| | | // |
| | | if (i >= grdMain.RowCount - 1) |
| | | grdMain.Rows.Add(); |
| | | grdMain.Rows[i].Cells[HTagCol].Value = "*"; |
| | | grdMain.Rows[i].Cells[HMaterIDCol].Value = oSub.HMaterID.ToString(); |
| | | if (oMater.GetInfoByID(oSub.HMaterID)) |
| | | { |
| | | grdMain.Rows[i].Cells[HMaterNumberCol].Value = oMater.omodel.HNumber; |
| | | grdMain.Rows[i].Cells[HMaterNameCol].Value = oMater.omodel.HName; |
| | | grdMain.Rows[i].Cells[HMaterModelCol].Value = oMater.omodel.HModel; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HMaterNumberCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HMaterNameCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HMaterModelCol].Value = ""; |
| | | } |
| | | grdMain.Rows[i].Cells[HProcIDCol].Value = oSub.HProcID.ToString(); |
| | | if (oProc.GetInfoByID(oSub.HProcID)) |
| | | { |
| | | grdMain.Rows[i].Cells[HProcNumberCol].Value = oProc.omodel.HNumber; |
| | | grdMain.Rows[i].Cells[HProcNameCol].Value = oProc.omodel.HName; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HProcNumberCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HProcNameCol].Value = ""; |
| | | } |
| | | |
| | | grdMain.Rows[i].Cells[HStdWorkTimes].Value = oSub.HStdWorkTimes.ToString(); |
| | | grdMain.Rows[i].Cells[HUpperlimit].Value = oSub.HUpperlimit.ToString(); |
| | | grdMain.Rows[i].Cells[HLowerlimit].Value = oSub.HLowerlimit.ToString(); |
| | | grdMain.Rows[i].Cells[HUSEORGID].Value = oSub.HUSEORGID.ToString(); |
| | | grdMain.Rows[i].Cells[HRemarkCol].Value = oSub.HRemark; |
| | | i = i + 1; |
| | | } |
| | | // |
| | | this.textBox1.Text = dr["HMaterID"].ToString(); |
| | | this.txtHMaterID.Text = dr["ç©æä»£ç "].ToString(); |
| | | this.txtHMaterName.Text = dr["ç©æåç§°"].ToString(); |
| | | this.txtHMaterModel.Text = dr["è§æ ¼åå·"].ToString(); |
| | | this.textBox2.Text = dr["HProcID"].ToString(); |
| | | this.txtHProcID.Text = dr["å·¥åºä»£ç "].ToString(); |
| | | this.txtHProcName.Text = dr["å·¥åºåç§°"].ToString(); |
| | | this.txtHStdWorkTimes.Text = dr["æ åå·¥æ¶"].ToString(); |
| | | this.txtHUpperlimit.Text = dr["ä¸çº¿æ¯ä¾"].ToString(); |
| | | this.txtHLowerlimit.Text = dr["ä¸çº¿æ¯ä¾"].ToString(); |
| | | this.txtHStdPiece.Text = dr["æ å计件"].ToString(); |
| | | this.txtHStdPric.Text = dr["æ å计价"].ToString(); |
| | | |
| | | |
| | | //GRIDå
è®¸å·æ° |
| | | DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid); |
| | | //å计 |
| | |
| | | //忮宿´æ§å¤æ æªå®æ |
| | | private bool Sub_AllowSave() |
| | | { |
| | | //å¿
è¾é¡¹ç®æ¯å¦ä¸ºç©º |
| | | //ClsK3_DepartmentHlp oDept = new ClsK3_DepartmentHlp(); |
| | | //if(!oDept.GetInfoByID(ClsPub.isLong(txtHDeptID.Tag))) |
| | | //{ |
| | | // MessageBox.Show("é¨é¨ä¸åå¨ï¼"); |
| | | // return false; |
| | | //} |
| | | |
| | | //æç»è¡¨æ¯å¦ä¸ºé¶è¡ |
| | | bool b = false; |
| | | for (int i = 0; i < grdMain.RowCount; i++) |
| | | { |
| | | if (!IsNullRow(i)) |
| | | { |
| | | b = true; |
| | | break; |
| | | } |
| | | } |
| | | if (b == false) |
| | | if (!IsNullRow(0)) |
| | | { |
| | | MessageBox.Show("è¡¨ä½æç»è¡ä¸åå¨ï¼è¯·å½å
¥ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | return true; |
| | | 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(); |
| | | // |
| | | if (!Sub_AllowSave())//忮宿´æ§å¤æ |
| | | return false; |
| | | { return false; } |
| | | |
| | | // |
| | | //æç»ç±»èµå¼ |
| | | BillNew.DetailColl = new List<Model.ClsGy_StdWorkTimes_Model>(); |
| | | for (i = 0; i <= grdMain.RowCount - 1; i++) |
| | | for (i = 0; i <= grdMain1.RowCount - 1; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value) != 0 && DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HProcIDCol].Value) != 0) |
| | | if (IsNullRow(i)) |
| | | { |
| | | Model.ClsGy_StdWorkTimes_Model oSub = new Model.ClsGy_StdWorkTimes_Model(); |
| | | oSub.HMaterID = ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value); |
| | | oSub.HProcID = ClsPub.isLong(grdMain.Rows[i].Cells[HProcIDCol].Value); |
| | | oSub.HStdWorkTimes = ClsPub.isDoule(grdMain.Rows[i].Cells[HStdWorkTimes].Value); |
| | | oSub.HUpperlimit = ClsPub.isDoule(grdMain.Rows[i].Cells[HUpperlimit].Value); |
| | | oSub.HLowerlimit = ClsPub.isDoule(grdMain.Rows[i].Cells[HLowerlimit].Value); |
| | | oSub.HUSEORGID = ClsPub.HOrgID; |
| | | oSub.HStopflag = true; |
| | | oSub.HMaker = ClsPub.CurUserName; |
| | | oSub.HMakeDate = DateTime.Today.ToString(); |
| | | oSub.HRemark = ClsPub.isStrNull(grdMain.Rows[i].Cells[HRemarkCol].Value); |
| | | BillNew.DetailColl.Add(oSub); |
| | | 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); |
| | | oSub.HProcID = ClsPub.isLong(grdMain1.Rows[i].Cells[HProcIDCol].Value); |
| | | oSub.HStdWorkTimes = ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdWorkTimes].Value); |
| | | oSub.HUpperlimit = ClsPub.isDoule(grdMain1.Rows[i].Cells[HUpperlimit].Value); |
| | | oSub.HLowerlimit = ClsPub.isDoule(grdMain1.Rows[i].Cells[HLowerlimit].Value); |
| | | oSub.HStdPiece = ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdPiece].Value); |
| | | oSub.HStdPric = ClsPub.isDoule(grdMain1.Rows[i].Cells[HStdPric].Value); |
| | | oSub.HUSEORGID = ClsPub.HOrgID; |
| | | oSub.HStopflag = false; |
| | | oSub.HMaker = ClsPub.CurUserName; |
| | | oSub.HMakeDate = DateTime.Today.ToString(); |
| | | oSub.HRemark = ClsPub.isStrNull(grdMain1.Rows[i].Cells[HRemarkCol].Value); |
| | | BillNew.DetailColl.Add(oSub); |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("第" + (i + 1) + "è¡,æ åå·¥æ¶,ä¸éæ¯ä¾,ä¸éæ¯ä¾ï¼æ åè®¡ä»¶åæ å计价é½åºå¤§äº0", "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("第" + (i + 1) + "è¡,ç©æãå·¥åºåæ åå·¥æ¶ä¸è½ä¸ºç©º", "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | | //ä¿å宿¯åå¤ç |
| | |
| | | //åå§åGRID |
| | | private void initGrid() |
| | | { |
| | | grdMain.ColumnCount = 22; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name); |
| | | grdMain1.ColumnCount = 22; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain1, this.Name); |
| | | // |
| | | grdMain.Columns[HMaterIDCol].HeaderText = "ç©æID"; |
| | | grdMain.Columns[HMaterNumberCol].HeaderText = "ç©æä»£ç "; |
| | | grdMain.Columns[HMaterNameCol].HeaderText = "ç©æåç§°"; |
| | | grdMain.Columns[HMaterModelCol].HeaderText = "è§æ ¼åå·"; |
| | | grdMain.Columns[HProcIDCol].HeaderText = "å·¥åºID"; |
| | | grdMain.Columns[HProcNumberCol].HeaderText = "å·¥åºä»£ç "; |
| | | grdMain.Columns[HProcNameCol].HeaderText = "å·¥åºåç§°"; |
| | | grdMain1.Columns[HMaterIDCol].HeaderText = "ç©æID"; |
| | | grdMain1.Columns[HMaterNumberCol].HeaderText = "ç©æä»£ç "; |
| | | grdMain1.Columns[HMaterNameCol].HeaderText = "ç©æåç§°"; |
| | | grdMain1.Columns[HMaterModelCol].HeaderText = "è§æ ¼åå·"; |
| | | grdMain1.Columns[HProcIDCol].HeaderText = "å·¥åºID"; |
| | | grdMain1.Columns[HProcNumberCol].HeaderText = "å·¥åºä»£ç "; |
| | | grdMain1.Columns[HProcNameCol].HeaderText = "å·¥åºåç§°"; |
| | | |
| | | grdMain.Columns[HStdWorkTimes].HeaderText = "æ åå·¥æ¶"; |
| | | grdMain.Columns[HUpperlimit].HeaderText = "ä¸éæ¯ä¾"; |
| | | grdMain.Columns[HLowerlimit].HeaderText = "ä¸éæ¯ä¾"; |
| | | grdMain.Columns[HUSEORGID].HeaderText = "ç»ç»ID"; |
| | | grdMain.Columns[HRemarkCol].HeaderText = "夿³¨"; |
| | | grdMain1.Columns[HStdWorkTimes].HeaderText = "æ åå·¥æ¶"; |
| | | grdMain1.Columns[HUpperlimit].HeaderText = "ä¸éæ¯ä¾"; |
| | | grdMain1.Columns[HLowerlimit].HeaderText = "ä¸éæ¯ä¾"; |
| | | grdMain1.Columns[HStdPiece].HeaderText = "æ å计件"; |
| | | grdMain1.Columns[HStdPric].HeaderText = "æ å计价"; |
| | | |
| | | grdMain1.Columns[HUSEORGID].HeaderText = "ç»ç»ID"; |
| | | grdMain1.Columns[HRemarkCol].HeaderText = "夿³¨"; |
| | | // |
| | | //éèå |
| | | grdMain.Columns[HTagCol].Visible = false; |
| | | grdMain.Columns[HProcIDCol].Visible = false; |
| | | grdMain.Columns[HMaterIDCol].Visible = false; |
| | | grdMain.Columns[HUSEORGID].Visible = false; |
| | | grdMain1.Columns[HTagCol].Visible = false; |
| | | grdMain1.Columns[HProcIDCol].Visible = false; |
| | | grdMain1.Columns[HMaterIDCol].Visible = false; |
| | | grdMain1.Columns[HUSEORGID].Visible = false; |
| | | //å¯ç¼è¾å |
| | | string sAllowCol = HMaterNumberCol.ToString() + |
| | | "," + HProcNumberCol.ToString() + |
| | | "," + HStdWorkTimes.ToString() + |
| | | "," + HUpperlimit.ToString() + |
| | | "," + HLowerlimit.ToString() + |
| | | "," + HStdPiece.ToString() + |
| | | "," + HStdPric.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | //å计å |
| | | string sTotalCol = ""; |
| | |
| | | oSumGrid.EditStatus = false; |
| | | return true; |
| | | } |
| | | //æ¯å¦æ¯ç©ºè¡ |
| | | private bool IsNullRow(int Row) |
| | | { |
| | | if (ClsPub.isInt(grdMain.Rows[Row].Cells[HMaterIDCol].Value) == 0) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | //'å¤æç½æ ¼è¡çå½å
¥æ¯å¦æ£ç¡® |
| | | private bool CheckGridRow(int Row) |
| | | { |
| | |
| | | { |
| | | case HMaterNumberCol: |
| | | //BLL.ClsBaseSelect_K3.SetGridByMater_K3(grdMain, sRow, HMaterIDCol, HMaterNumberCol, HMaterNameCol, HMaterModelCol, 0, 0, 0); |
| | | BLL.ClsBaseSelect_InterFace.SetGridByMater(grdMain, sRow, HMaterIDCol, HMaterNumberCol, HMaterNameCol, HMaterModelCol, 0, 0, 0); |
| | | BLL.ClsBaseSelect_InterFace.SetGridByMater(grdMain1, sRow, HMaterIDCol, HMaterNumberCol, HMaterNameCol, HMaterModelCol, 0, 0, 0); |
| | | if (rbHSelectCus.Checked) |
| | | { |
| | | grdMain.Rows[sRow].Cells[HProcIDCol].Value = txtHProcID.Tag.ToString(); |
| | | grdMain.Rows[sRow].Cells[HProcNameCol].Value = txtHProcName.Text.Trim(); |
| | | grdMain.Rows[sRow].Cells[HProcNumberCol].Value = txtHProcID.Text.Trim(); |
| | | grdMain1.Rows[sRow].Cells[HProcIDCol].Value = txtHProcID.Tag.ToString(); |
| | | grdMain1.Rows[sRow].Cells[HProcNameCol].Value = txtHProcName.Text.Trim(); |
| | | grdMain1.Rows[sRow].Cells[HProcNumberCol].Value = txtHProcID.Text.Trim(); |
| | | } |
| | | oEdit.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[sRow].Cells[HMaterNumberCol].Value); |
| | | oEdit.Text = DBUtility.ClsPub.isStrNull(grdMain1.Rows[sRow].Cells[HMaterNumberCol].Value); |
| | | break; |
| | | case HProcNumberCol: |
| | | //BLL.ClsBaseSelect.SetGridByProc(grdMain, sRow, HProcIDCol, HProcNumberCol, HProcNameCol); |
| | | BLL.ClsBaseSelect_InterFace.SetGridByProc(grdMain, sRow, HProcIDCol, HProcNumberCol, HProcNameCol); |
| | | BLL.ClsBaseSelect_InterFace.SetGridByProc(grdMain1, sRow, HProcIDCol, HProcNumberCol, HProcNameCol); |
| | | if (rbHSelectMater.Checked) |
| | | { |
| | | grdMain.Rows[sRow].Cells[HMaterIDCol].Value = txtHMaterID.Tag.ToString(); |
| | | grdMain.Rows[sRow].Cells[HMaterNumberCol].Value = txtHMaterID.Text.Trim(); |
| | | grdMain.Rows[sRow].Cells[HMaterNameCol].Value = txtHMaterName.Text.Trim(); |
| | | grdMain.Rows[sRow].Cells[HMaterModelCol].Value = txtHMaterModel.Text.Trim(); |
| | | grdMain1.Rows[sRow].Cells[HMaterIDCol].Value = txtHMaterID.Tag.ToString(); |
| | | grdMain1.Rows[sRow].Cells[HMaterNumberCol].Value = txtHMaterID.Text.Trim(); |
| | | grdMain1.Rows[sRow].Cells[HMaterNameCol].Value = txtHMaterName.Text.Trim(); |
| | | grdMain1.Rows[sRow].Cells[HMaterModelCol].Value = txtHMaterModel.Text.Trim(); |
| | | } |
| | | oEdit.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[sRow].Cells[HProcNumberCol].Value); |
| | | oEdit.Text = DBUtility.ClsPub.isStrNull(grdMain1.Rows[sRow].Cells[HProcNumberCol].Value); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | DataGridViewTextBoxEditingControl EditingControl; |
| | | private void grdMain_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e) |
| | | { |
| | | int i = grdMain.CurrentCell.ColumnIndex; |
| | | int i = grdMain1.CurrentCell.ColumnIndex; |
| | | if (DBUtility.Xt_BaseBillFun.AllowEdit(grdStatus, oSumGrid, i)) |
| | | { |
| | | e.Cancel = true; |
| | |
| | | |
| | | private void grdMain_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) |
| | | { |
| | | if (grdMain.CurrentCell != null) |
| | | if (grdMain1.CurrentCell != null) |
| | | { |
| | | if (e.Control is DataGridViewTextBoxEditingControl) |
| | | { |
| | |
| | | private void EditingControl_KeyDown(object sender, KeyEventArgs e) |
| | | { |
| | | //ä¸å¡å¤ç |
| | | Sub_GridKey(e.KeyValue, grdMain.CurrentRow.Index, grdMain.CurrentCell.ColumnIndex, EditingControl); |
| | | Sub_GridKey(e.KeyValue, grdMain1.CurrentRow.Index, grdMain1.CurrentCell.ColumnIndex, EditingControl); |
| | | } |
| | | |
| | | private void grdMain_RowHeadersWidthChanged(object sender, EventArgs e) |