| | |
| | | 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; |
| | |
| | | { |
| | | try |
| | | { |
| | | if (int.Parse(txtHStdWorkTimes.Text)<=0) |
| | | if (Convert.ToDecimal(txtHStdWorkTimes.Text.ToString())<=0) |
| | | { |
| | | MessageBox.Show("æ åå·¥æ¶å¿
须大äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | if (int.Parse(txtHUpperlimit.Text) <= 0) |
| | | if (Convert.ToDecimal(txtHUpperlimit.Text) <= 0) |
| | | { |
| | | MessageBox.Show("ä¸éæ¯ä¾å¿
须大äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | if (int.Parse(txtHLowerlimit.Text) <= 0) |
| | | if (Convert.ToDecimal(txtHLowerlimit.Text) <= 0) |
| | | { |
| | | MessageBox.Show("ä¸çº¿æ¯ä¾å¿
须大äº0", "æç¤º"); |
| | | return; |
| | | } |
| | | oCn.BeginTran(); |
| | | 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("ä¿®æ¹æå,请éåºå¹¶å·æ°", "æç¤º"); |
| | |
| | | { |
| | | timer1.Enabled = false; |
| | | Sub_ControlLocation(); |
| | | if (BillOld.HItemID.ToString()!=null)//|| 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(); |
| | | } |
| | |
| | | case DBUtility.ClsPub.Enum_BillStatus.BillStatus_View: |
| | | //case DBUtility.ClsPub.Enum_BillStatus.BillStatus_Viewonly: |
| | | //æµè§ç¶æ |
| | | yl.Enabled = true; |
| | | xz.Enabled = true; |
| | | |
| | | xg.Enabled = true; |
| | | sc.Enabled = true; |
| | | AddRow.Enabled = false; |
| | | DelRow.Enabled = false; |
| | | bc.Enabled = false; |
| | |
| | | if (txtHChecker.Text.Trim() == "") |
| | | { |
| | | xg.Enabled = true; |
| | | sc.Enabled = true; |
| | | } |
| | | else |
| | | { |
| | | xg.Enabled = false; |
| | | sc.Enabled = false; |
| | | } |
| | | 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; |
| | |
| | | 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(); |
| | | |
| | | //å è½½è¡¨ä½ |
| | | //initGrid(); |
| | | //int i = 0; |
| | | //foreach (Model.ClsGy_StdWorkTimes_Model oSub in BillNew.DetailColl) |
| | | //{ |
| | | // // |
| | | // if (i >= grdMain1.RowCount - 1) |
| | | // grdMain1.Rows.Add(); |
| | | // grdMain1.Rows[i].Cells[HTagCol].Value = "*"; |
| | | // grdMain1.Rows[i].Cells[HMaterIDCol].Value = oSub.HMaterID.ToString(); |
| | | // if (oMater.GetInfoByID(oSub.HMaterID)) |
| | | // { |
| | | // grdMain1.Rows[i].Cells[HMaterNumberCol].Value = oMater.omodel.HNumber; |
| | | // grdMain1.Rows[i].Cells[HMaterNameCol].Value = oMater.omodel.HName; |
| | | // grdMain1.Rows[i].Cells[HMaterModelCol].Value = oMater.omodel.HModel; |
| | | // } |
| | | // else |
| | | // { |
| | | // grdMain1.Rows[i].Cells[HMaterNumberCol].Value = ""; |
| | | // grdMain1.Rows[i].Cells[HMaterNameCol].Value = ""; |
| | | // grdMain1.Rows[i].Cells[HMaterModelCol].Value = ""; |
| | | // } |
| | | // grdMain1.Rows[i].Cells[HProcIDCol].Value = oSub.HProcID.ToString(); |
| | | // if (oProc.GetInfoByID(oSub.HProcID)) |
| | | // { |
| | | // grdMain1.Rows[i].Cells[HProcNumberCol].Value = oProc.omodel.HNumber; |
| | | // grdMain1.Rows[i].Cells[HProcNameCol].Value = oProc.omodel.HName; |
| | | // } |
| | | // else |
| | | // { |
| | | // grdMain1.Rows[i].Cells[HProcNumberCol].Value = ""; |
| | | // grdMain1.Rows[i].Cells[HProcNameCol].Value = ""; |
| | | // } |
| | | |
| | | // grdMain1.Rows[i].Cells[HStdWorkTimes].Value = oSub.HStdWorkTimes.ToString(); |
| | | // grdMain1.Rows[i].Cells[HUpperlimit].Value = oSub.HUpperlimit.ToString(); |
| | | // grdMain1.Rows[i].Cells[HLowerlimit].Value = oSub.HLowerlimit.ToString(); |
| | | // grdMain1.Rows[i].Cells[HUSEORGID].Value = oSub.HUSEORGID.ToString(); |
| | | // grdMain1.Rows[i].Cells[HRemarkCol].Value = oSub.HRemark; |
| | | // i = i + 1; |
| | | //} |
| | | |
| | | //GRIDå
è®¸å·æ° |
| | | DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid); |
| | | //å计 |
| | |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HMaterIDCol].Value) != 0 && DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HProcIDCol].Value) != 0) |
| | | { |
| | | 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) |
| | | 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) |
| | | { |
| | | Model.ClsGy_StdWorkTimes_Model oSub = new Model.ClsGy_StdWorkTimes_Model(); |
| | | oSub.HMaterID = ClsPub.isLong(grdMain1.Rows[i].Cells[HMaterIDCol].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; |
| | |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("第" + (i+1) + "è¡,æ åå·¥æ¶,ä¸éæ¯ä¾åä¸éæ¯ä¾é½åºå¤§äº0", "æç¤º"); |
| | | MessageBox.Show("第" + (i+1) + "è¡,æ åå·¥æ¶,ä¸éæ¯ä¾,ä¸éæ¯ä¾ï¼æ åè®¡ä»¶åæ å计价é½åºå¤§äº0", "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | 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 = "夿³¨"; |
| | | // |
| | |
| | | "," + HStdWorkTimes.ToString() + |
| | | "," + HUpperlimit.ToString() + |
| | | "," + HLowerlimit.ToString() + |
| | | "," + HStdPiece.ToString() + |
| | | "," + HStdPric.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | //å计å |
| | | string sTotalCol = ""; |