| | |
| | | { |
| | | InitializeComponent(); |
| | | } |
| | | public DBUtility.frmBillQueryCondition_New frmCondition; |
| | | public string ModName = "3790"; |
| | | public string ModCaption = "è¿ç«æ¥æ¶å"; |
| | | public const string ModRightName = "MES_StationInBill"; |
| | |
| | | public DAL.ClsSc_StationInBill BillNew = new DAL.ClsSc_StationInBill(); |
| | | public DAL.ClsSc_StationInBill BillOld = new DAL.ClsSc_StationInBill(); |
| | | |
| | | public Int64 lngBillKey; |
| | | public Int64 lngBillSubKey; |
| | | public Int64 HInterID;//主å
å |
| | | public Int64 lngBillKey; //æµè½¬å¡ID |
| | | public Int64 lngBillSubKey; //æµè½¬å¡åID |
| | | |
| | | public Int64 lngICMOEntryID; |
| | | //------------------------------------------------------------------------- |
| | |
| | | public void Sub_ClearBill() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp); |
| | | DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage1); |
| | | DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage2); |
| | | initGrid(); |
| | | txtHBarCode.Text = ""; |
| | | txtHProcExchBillNo.Enabled = true; |
| | | txtHProcNo.Enabled = true; |
| | | txtHBarCode.Enabled = true; |
| | | tabControl1.SelectedIndex = 0; |
| | | txtHBarCode.Focus(); |
| | | //å¾å°æ¥æ¶äººä¿¡æ¯ï¼è¿ç«æ¥æ¶äººé»è®¤ä¸ºç»å½äººï¼æ ¹æ®ç»å½äººç¨æ·åï¼æ¾å°èåååçè®°å½ï¼é»è®¤åå
¥ æ¥æ¶äºº ææ¬æ¡ï¼å¦ææ²¡æ¾å°å为空ï¼ï¼ |
| | | DataSet Ds; |
| | |
| | | DBUtility.Xt_BaseBillFun.initGridMESList(grdCardList, this.Name + "grdCardList"); |
| | | DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name); |
| | | grdSub.SelectionMode = DataGridViewSelectionMode.CellSelect; |
| | | grdCardList.DataSource = null; |
| | | } |
| | | |
| | | private void Display() |
| | |
| | | //åæ¶æé® |
| | | private void cmdCancel_Click(object sender, EventArgs e) |
| | | { |
| | | ClsPub.SaveGridView(grdSub, Name+"grdSub", ClsPub.AppPath);//设置å宽 |
| | | this.Close(); |
| | | } |
| | | //æ§ä»¶ä½ç½® |
| | |
| | | //çªä½å è½½ |
| | | private void Sc_StationInBill_Load(object sender, EventArgs e) |
| | | { |
| | | frmCondition = new DBUtility.frmBillQueryCondition_New(); |
| | | //æå°åå§å |
| | | this.Text = ModCaption; |
| | | this.lblCaption.Text = ModCaption; |
| | |
| | | private void Sc_StationInBill_FormClosing(object sender, FormClosingEventArgs e) |
| | | { |
| | | BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; |
| | | //DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name); |
| | | //DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name); |
| | | DBUtility.Xt_BaseBillFun.SaveGrid(grdCardList, this.Name + "grdCardList"); |
| | | } |
| | | //æ°å¢åæ® |
| | |
| | | this.txtHStationInTime.Text = DBUtility.ClsPub.GetServerDate(-1); |
| | | |
| | | this.txtHBillNo.Text = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//å¾å°æ°åå· |
| | | |
| | | if (lngBillKey != 0 ) |
| | | { |
| | | //LotShow(); |
| | | } |
| | | this.HInterID = DBUtility.ClsPub.CreateBillID(this.ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //if (lngBillKey != 0 ) |
| | | //{ |
| | | // //LotShow(); |
| | | //} |
| | | |
| | | } |
| | | private void LotShow() //èªå¨è½½å
¥ æµè½¬å¡è¿ç«çé¢åè½ |
| | |
| | | // |
| | | txtHProcExchBillNo.Enabled = false; |
| | | txtHProcNo.Enabled = false; |
| | | |
| | | //å è½½ é
ä»¶ç»å®æ¸
å |
| | | HInterID = BillOld.omodel.HInterID; |
| | | DisplaySub(); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | //忮宿´æ§å¤æ æªå®æ |
| | |
| | | return false; |
| | | //èµå¼ID |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) |
| | | { |
| | | BillNew.omodel.HInterID = BillOld.omodel.HInterID; |
| | | } |
| | | else |
| | | { |
| | | BillNew.omodel.HInterID = HInterID; |
| | | } |
| | | //主类èµå¼ |
| | | BillNew.omodel.HYear = 2011; |
| | | BillNew.omodel.HPeriod = 1; |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DBUtility.ClsPub.isDate(this.txtHStationInTime.Text), ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | MessageBox.Show(s, "æç¤º"); |
| | | return false; |
| | | } |
| | | // |
| | | BillNew.omodel.HYear = sYear; |
| | | BillNew.omodel.HPeriod = sPeriod; |
| | | BillNew.omodel.HBillNo = this.txtHBillNo.Text.Trim(); |
| | | BillNew.omodel.HICMOBillNo = this.txtHICMOBillNo.Text.Trim(); |
| | | BillNew.omodel.HICMOInterID = DBUtility.ClsPub.isLong(this.txtHICMOBillNo.Tag); |
| | |
| | | txtHGroupID.Tag = 0; |
| | | txtHGroupName.Text = ""; |
| | | } |
| | | txtHQty.Focus(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | Sub_WriteInForm_SM2(Ds.Tables[0], i); |
| | | } |
| | | txtHQty.Focus(); |
| | | //å¦æç³»ç»åæ°å¯ç¨äº è¿ç«åç»å®é
ä»¶æ¸
åå ä»çäº§ç¨ææ¸
åä¸è·åå·¥åºBOMåå
¥ 临æ¶è¡¨ï¼å¹¶å è½½è¡¨æ ¼ |
| | | Pub_Class.ClsXt_SystemParameter oParam = new ClsXt_SystemParameter(); |
| | | string sIsBingLine = oParam.GetSingleSystemParameter("MES_StationInBill_LineBindCtl",ref DBUtility.ClsPub.sExeReturnInfo ); |
| | | if (sIsBingLine.Trim() == "Y") |
| | | { |
| | | oCn.RunProc("exec h_p_MES_StationInBillSubBindSource_Insert " + lngBillKey.ToString() + " , " + lngBillSubKey.ToString() + "," + HInterID.ToString() + " "); |
| | | //å·æ°è¡¨ä½ç½æ ¼æ°æ® |
| | | DisplaySub(); |
| | | } |
| | | // |
| | | txtHGroupID.Focus(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | this.Sub_AddBill(); |
| | | } |
| | | |
| | | //é
ä»¶æ¡å½¢ç å车äºä»¶ |
| | | private void txtHBarCode_Mater_KeyDown(object sender, KeyEventArgs e) |
| | | { |
| | | try |
| | | { |
| | | if (e.KeyCode == Keys.Return) |
| | | { |
| | | if (txtHBarCode_Mater.Text.Trim() == "") |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ¡å½¢ç ï¼"); |
| | | return; |
| | | } |
| | | string sBarCode = txtHBarCode_Mater.Text.Trim(); |
| | | txtHBarCode_Mater.Text = ""; |
| | | //夿æ¡å½¢ç æ¯å¦å¨æ¡ç æ¡£æ¡ä¸ï¼å¤ææ¡å½¢ç æ¯å¦åç |
| | | //å
夿 临æ¶è¡¨ä¸æ¯å¦ææ°æ®ï¼æ¡å½¢ç çç©ææ¯å¦å¨æ¸
åä¸ï¼åå
¥ æ«ç è®°å½è¡¨ |
| | | //å¾å°ä¿¡æ¯ |
| | | SQLHelper.ClsCN oCn = new ClsCN(); |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindBarCode " + HInterID.ToString() + " ,'" + sBarCode + "'", "h_p_MES_StationInBillSub_BindBarCode"); |
| | | //åå
¥ä¿¡æ¯ |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("æªæ¥è¯¢å°æ¡å½¢ç ä¿¡æ¯ï¼"); |
| | | return; |
| | | } |
| | | else if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 2) |
| | | { |
| | | MessageBox.Show("é误ï¼" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1])); |
| | | return; |
| | | } |
| | | //å·æ°è¡¨ä½ç½æ ¼æ°æ®ï¼æå¥½é¢è²æ¾ç¤ºï¼ |
| | | DisplaySub(); |
| | | } |
| | | } |
| | | catch (Exception e1) |
| | | { |
| | | MessageBox.Show(e1.Message + "txtHBarCode_Mater_KeyDown"); |
| | | } |
| | | } |
| | | |
| | | private void DisplaySub() |
| | | { |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCn = new ClsCN(); |
| | | DataSet Dsplay; |
| | | Dsplay = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindDisplay " + HInterID.ToString() + " ", "h_p_MES_StationInBillSub_BindDisplay"); |
| | | //åå
¥ä¿¡æ¯ |
| | | if (Dsplay == null ) |
| | | { |
| | | MessageBox.Show("å·æ°å¤±è´¥ï¼"); |
| | | return; |
| | | } |
| | | else if(Dsplay.Tables[0].Rows.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | //éæ¾å»ç» |
| | | DBUtility.Xt_BaseBillFun.CancelFrozenCol(grdSub); |
| | | // |
| | | grdSub.DataSource = Dsplay.Tables[0].DefaultView; |
| | | //设置å计å |
| | | //string sTotalCol = ""; |
| | | //sTotalCol = DBUtility.Gy_BaseFun.GetTotalCols(DSet); |
| | | //string[] sT; |
| | | //sT = sTotalCol.Split(Convert.ToChar(",")); |
| | | //oSumGrid.BuildTotalCols(sT); |
| | | // |
| | | //å»ç» |
| | | int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | string s = frmCondition.cmbHComplete.Text; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name, s, FrCol); |
| | | //ç»çº¿ |
| | | GraphLine(); |
| | | //å»ç» |
| | | //int FrCol = 0; |
| | | //string s = "æ¯"; |
| | | //DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show(e.Message + "DisplaySub"); |
| | | } |
| | | } |
| | | private void GraphLine() |
| | | { |
| | | int MainIDCol = 0; |
| | | int SubIDCol = 0; |
| | | string s = frmCondition.cmbHComplete.Text; |
| | | long n = 0; |
| | | DBUtility.Xt_BaseBillFun.GraphLine(grdSub, MainIDCol, SubIDCol, s, ref n); |
| | | } |
| | | |
| | | private void cmdDelLine_Click(object sender, EventArgs e) |
| | | { |
| | | try |
| | | { |
| | | //æ ¹æ®éæ©çæ¡å½¢ç æ¥å é¤ |
| | | if (grdSub.CurrentRow == null) |
| | | return; |
| | | string sBarCode = DBUtility.ClsPub.isStrNull(grdSub.Rows[grdSub.CurrentRow.Index].Cells[Fun_GetCol("æ¡å½¢ç ")].Value); |
| | | SQLHelper.ClsCN oCn = new ClsCN(); |
| | | oCn.RunProc(" delete from Sc_StationInBillSub_BindBarCodeTemp " + |
| | | "Where HInterID = "+ HInterID.ToString() +" and HBarCode = '"+ sBarCode + "'"); |
| | | DisplaySub(); |
| | | } |
| | | catch (Exception e1) |
| | | { |
| | | MessageBox.Show("å é¤è¡å¤±è´¥ï¼"+e1.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void cmdHbclk_Click(object sender, EventArgs e) |
| | | { |
| | | //ä¿åå宽 |
| | | DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name); |
| | | } |
| | | |
| | | private void cmdHmrlk_Click(object sender, EventArgs e) |
| | | { |
| | | DBUtility.Xt_BaseBillFun.DefaultGridView(grdSub, this.Name); |
| | | } |
| | | } |
| | | } |