| | |
| | | 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() |
| | |
| | | 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 (int.Parse(txtHStdWorkTimes.Text)<=0) |
| | | { |
| | | MessageBox.Show("æ åå·¥æ¶å¿
须大äº0", "æç¤º"); |
| | | } |
| | | if (int.Parse(txtHUpperlimit.Text) <= 0) |
| | | { |
| | | MessageBox.Show("ä¸éæ¯ä¾å¿
须大äº0", "æç¤º"); |
| | | } |
| | | if (int.Parse(txtHLowerlimit.Text) <= 0) |
| | | { |
| | | MessageBox.Show("ä¸çº¿æ¯ä¾å¿
须大äº0", "æç¤º"); |
| | | } |
| | | oCn.BeginTran(); |
| | | string sql = string.Format(@"Update Gy_StdWorkTimes set" + |
| | | " HMaterID=" + textBox1.Text + |
| | | ",HProcID=" + textBox2.Text + |
| | | ",HStdWorkTimes=" + txtHStdWorkTimes.Text + |
| | | ",HUpperlimit=" + txtHUpperlimit.Text + |
| | | ",HLowerlimit=" + txtHLowerlimit.Text + |
| | | ",HMaker='" + DBUtility.ClsPub.CurUserName + "'" + |
| | | ",HMakeDate='" + DateTime.Now + "'" + |
| | | ",HUSEORGID=" + DBUtility.ClsPub.HOrgID + |
| | | " where HItemID=" + BillOld.HItemID); |
| | | 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)//|| BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Viewonly |
| | | { |
| | | this.Sub_ShowBill(); |
| | | } |
| | |
| | | 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; |
| | | 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(); |
| | | |
| | | //å è½½è¡¨ä½ |
| | | 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; |
| | | } |
| | | //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); |
| | | //å计 |
| | |
| | | //} |
| | | |
| | | //æç»è¡¨æ¯å¦ä¸ºé¶è¡ |
| | | bool b = false; |
| | | |
| | | if (!IsNullRow(0)) |
| | | { |
| | | MessageBox.Show("è¡¨ä½æç»è¡ä¸åå¨ï¼è¯·å½å
¥ï¼", "æç¤º"); |
| | |
| | | lblCaption.Focus(); |
| | | // |
| | | if (!Sub_AllowSave())//忮宿´æ§å¤æ |
| | | return false; |
| | | { return false; } |
| | | |
| | | // |
| | | //æç»ç±»èµå¼ |
| | | BillNew.DetailColl = new List<Model.ClsGy_StdWorkTimes_Model>(); |
| | |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HMaterIDCol].Value) != 0 && DBUtility.ClsPub.isLong(grdMain1.Rows[i].Cells[HProcIDCol].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.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); |
| | | 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) |
| | | { |
| | | 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.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; |
| | | } |
| | | } |
| | | } |
| | | //ä¿å宿¯åå¤ç |