| | |
| | | public const string ModRightNameCheck = ModRightName + "_Check"; |
| | | public const string ModRightNameClose = ModRightName + "_Close"; |
| | | public const string ModRightNameDelete = ModRightName + "_Delete"; |
| | | public DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //public Gy_ICBomBill oFrm; |
| | | public int selectRow = 0; |
| | | public int selectRow2 = 0; |
| | | public string sDlgWhere = ""; //å¤çªä½éå
¥ |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | public Int64 HInterID = 0; |
| | | // |
| | | private void initGrid() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.initGridList(grdMain,this.Name); |
| | | DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name); |
| | | } |
| | | // |
| | | |
| | |
| | | ClsCN SubCn = new ClsCN(); |
| | | DataSet DSet; |
| | | string sSql = ""; |
| | | string sFastSQL = ""; |
| | | //ç产订åå· |
| | | //if (txtHICMOBillNo.Text.Trim() != "") |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and HICMOBillNo like '%" + txtHICMOBillNo.Text + "%'"; |
| | | //} |
| | | string HICMOBillNo = ""; |
| | | HICMOBillNo = txtHICMOBillNo.Text.Trim().ToString(); |
| | | //ç©æ |
| | | //if (txtHMaterID.Text.Trim() != "") |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and HMaterName like '%" + txtHMaterID.Text + "%'"; |
| | | //} |
| | | string HMaterName = ""; |
| | | HMaterName = txtHMaterID.Text.Trim().ToString(); |
| | | //æºå° |
| | | //if (txtHSourceID.Text.Trim() != "") |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and HSourceName like '%" + txtHSourceID.Text + "%'"; |
| | | //} |
| | | string HSourceName = ""; |
| | | HSourceName = txtHSourceID.Text.Trim().ToString(); |
| | | //èå |
| | | string HEmpName = ""; |
| | | HEmpName = txtHEmpID.Text.Trim().ToString(); |
| | | //夿å¼å§æ¥æ |
| | | //if (dtpHBeginDate.Checked) |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and æ¥æ>='" + dtpHBeginDate.Value.ToShortDateString() + "'"; |
| | | //} |
| | | string HBeginDate = ""; |
| | | HBeginDate = dtpHBeginDate.Value.ToShortDateString(); |
| | | |
| | | //å¤æç»ææ¥æ |
| | | //if (dtpHEndDate.Checked) |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and æ¥æ<='" + dtpHEndDate.Value.ToShortDateString() + "'"; |
| | | //} |
| | | string HEndDate = ""; |
| | | HEndDate = dtpHEndDate.Value.ToShortDateString(); |
| | | //if (sFastSQL.Trim() == "") |
| | | //{ |
| | | // MessageBox.Show("没æè¾å
¥æ¡ä»¶!"); |
| | | // return; |
| | | //} |
| | | |
| | | //è¿æ»¤æ¡ä»¶ |
| | | if (frmCondition.SqlStr.Trim().Length == 0) |
| | | return; |
| | | sSql = "Select * from " + ViewName + " Where 1=1 " + sDlgWhere + " order by HICMOBillNo asc"; |
| | | |
| | | // |
| | | DSet = SubCn.RunProcReturn(sSql, ViewName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | DSet = SubCn.RunProcReturn("exec h_p_KSTMSC '" + HICMOBillNo + "' , '" + HMaterName + "' , '" + HSourceName + "' ,'" + HEmpName + "' ,'" + HBeginDate + "', '" + HEndDate + "'", "h_p_KSTMSC", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | |
| | | } |
| | | // |
| | | grdMain.DataSource = DSet.Tables[0].DefaultView; |
| | | |
| | | //æ åè£
ç®± |
| | | for (int i = 0; i < grdMain.SelectedRows.Count; i++) |
| | | { |
| | | txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[Fun_GetCol("HMiniQty")].Value); |
| | | } |
| | | //for (int i = 0; i < grdMain.SelectedRows.Count; i++) |
| | | //{ |
| | | // txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[Fun_GetCol("HMiniQty")].Value); |
| | | // if (txtHMiniQty.Text.Trim() != "") |
| | | // { |
| | | // txtHMiniQty.Enabled = false; |
| | | // } |
| | | //} |
| | | //å»ç» |
| | | int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | string s = frmCondition.cmbHComplete.Text; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s,FrCol); |
| | | //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | //string s = frmCondition.cmbHComplete.Text; |
| | | //DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s,FrCol); |
| | | //ç»çº¿ |
| | | GraphLine(); |
| | | |
| | |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain); |
| | | } |
| | | |
| | | private Int32 Fun_GetColList(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdList); |
| | | } |
| | | // |
| | | private void Sc_ICMOToBarCode_Load(object sender, EventArgs e) |
| | | { |
| | | // |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | //frmCondition = new frmBillQueryCondition_New(); |
| | | this.Text = ModCaption; |
| | | //lblCaption.Text = ModCaption; |
| | | initGrid(); |
| | |
| | | |
| | | private void cx_Click(object sender, EventArgs e) |
| | | { |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | SetCondition(frmCondition, ViewName, this.Name); |
| | | frmCondition.ShowDialog(); |
| | | if (frmCondition.Tag.ToString() == "OK") |
| | | { |
| | | Display(); |
| | | } |
| | | //frmCondition = new frmBillQueryCondition_New(); |
| | | //SetCondition(frmCondition, ViewName, this.Name); |
| | | //frmCondition.ShowDialog(); |
| | | //if (frmCondition.Tag.ToString() == "OK") |
| | | //{ |
| | | // Display(); |
| | | //} |
| | | } |
| | | |
| | | public void SetCondition(frmBillQueryCondition_New frmCondition, string ViewName, string Name) |
| | | { |
| | | frmCondition.Tag = ""; |
| | | frmCondition.ViewName = ViewName; |
| | | frmCondition.ModName = Name; |
| | | } |
| | | //public void SetCondition(frmBillQueryCondition_New frmCondition, string ViewName, string Name) |
| | | //{ |
| | | // frmCondition.Tag = ""; |
| | | // frmCondition.ViewName = ViewName; |
| | | // frmCondition.ModName = Name; |
| | | //} |
| | | |
| | | private void xz_Click(object sender, EventArgs e) |
| | | { |
| | |
| | | |
| | | private void timer2_Tick(object sender, EventArgs e) |
| | | { |
| | | timer2.Enabled = false; |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | SetCondition(frmCondition, ViewName, this.Name); |
| | | frmCondition.ShowDialog(); |
| | | if (frmCondition.Tag.ToString() == "OK") |
| | | { |
| | | timer1.Enabled = true; |
| | | } |
| | | //timer2.Enabled = false; |
| | | //frmCondition = new frmBillQueryCondition_New(); |
| | | //SetCondition(frmCondition, ViewName, this.Name); |
| | | //frmCondition.ShowDialog(); |
| | | //if (frmCondition.Tag.ToString() == "OK") |
| | | //{ |
| | | // timer1.Enabled = true; |
| | | //} |
| | | } |
| | | |
| | | |
| | |
| | | // |
| | | private void GraphLine() |
| | | { |
| | | int MainIDCol = Fun_GetCol("hmainid"); |
| | | int SubIDCol = Fun_GetCol("hsubid"); |
| | | string s = frmCondition.cmbHComplete.Text; |
| | | long n=0; |
| | | DBUtility.Xt_BaseBillFun.GraphLine(grdMain, MainIDCol, SubIDCol, s,ref n); |
| | | //int MainIDCol = Fun_GetCol("hmainid"); |
| | | //int SubIDCol = Fun_GetCol("hsubid"); |
| | | //string s = frmCondition.cmbHComplete.Text; |
| | | //long n=0; |
| | | //DBUtility.Xt_BaseBillFun.GraphLine(grdMain, MainIDCol, SubIDCol, s,ref n); |
| | | //æ¾ç¤º |
| | | //lbldj.Text = "æ¥è¯¢åº " + n.ToString() + " å¼ åæ®"; |
| | | //lbljl.Text = "å
±æ " + grdMain.RowCount.ToString() + " æ¡è®°å½"; |
| | |
| | | |
| | | private void cmdHSaveBill_Click(object sender, EventArgs e) |
| | | { |
| | | string sFastSQL = ""; |
| | | //ç产订åå· |
| | | if (txtHICMOBillNo.Text.Trim() != "") |
| | | |
| | | Display(); |
| | | } |
| | | |
| | | private void button4_Click(object sender, EventArgs e) |
| | | { |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HMaterNumber = ""; |
| | | string HBatchNo = ""; |
| | | string HDate = ""; |
| | | string HYear = ""; |
| | | string HPeriod = ""; |
| | | string HDay = ""; |
| | | string HTMNumber = ""; |
| | | string HOrgNumber = ""; |
| | | DataSet Ds; |
| | | int LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | double HSumQty = 0; //äº§åæ°é |
| | | double HMinQty = 0; //æå°å
è£
æ° |
| | | double HBQty = 0; //ç®±æ° |
| | | int k = 0; |
| | | int n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | string WeiShu = ""; //å°¾æ° |
| | | int LSHlen = 6; //æµæ°´å·é¿åº¦ |
| | | string TM = ""; //æ¡ç |
| | | for (int j = 0; j < grdMain.SelectedRows.Count; j++) |
| | | { |
| | | sFastSQL = sFastSQL + " and HICMOBillNo like '%" + txtHICMOBillNo.Text + "%'"; |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[j].Index].Cells[Fun_GetCol("ç©æä»£ç ")].Value); |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[j].Index].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | HDate = DateTime.Now.ToShortDateString(); |
| | | HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | //ç®±æ°å=æ°é/æå°å
è£
æ° |
| | | //double sMoney = 0; |
| | | //if ((DBUtility.ClsPub.isLong(grdMain.SelectedRows[j].Cells[Fun_GetCol("HMiniQty")].Value) == 0)) |
| | | //{ |
| | | // sMoney = 0; |
| | | //} |
| | | //else |
| | | //{ |
| | | // sMoney = ClsPub.isDoule(grdMain.SelectedRows[j].Cells[Fun_GetCol("HQty")].Value) / ClsPub.isDoule(grdMain.SelectedRows[j].Cells[Fun_GetCol("HMiniQty")].Value); |
| | | //} |
| | | //sMoney = Math.Ceiling(sMoney); |
| | | //grdMain.SelectedRows[j].Cells[Fun_GetCol("HBQty")].Value = sMoney; |
| | | |
| | | |
| | | HBQty = HBQty + ClsPub.isInt(txtHBQty.Text); |
| | | HMinQty = ClsPub.isDoule(txtHMiniQty.Text); |
| | | HSumQty = ClsPub.isDoule(txtHICMOQty.Text); |
| | | |
| | | |
| | | if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | { |
| | | HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "æ¹æ¬¡æ¡ç ") |
| | | { |
| | | TM = HOrgNumber + HMaterNumber + HBatchNo; |
| | | } |
| | | n = 0; |
| | | for (int i = k; i < HBQty; i++) |
| | | { |
| | | if (HSumQty - HMinQty > 0) |
| | | { |
| | | WeiShu = ""; |
| | | HSumQty = HSumQty - HMinQty; |
| | | } |
| | | else |
| | | { |
| | | if (HSumQty == HMinQty) |
| | | { |
| | | WeiShu = ""; |
| | | } |
| | | else |
| | | { |
| | | WeiShu = "å°¾æ°"; |
| | | } |
| | | HMinQty = HSumQty; |
| | | } |
| | | // |
| | | LSH = LSH + 1; |
| | | LSH2 = LSH.ToString(); |
| | | while (LSH2.Length < LSHlen) //å¦ææµæ°´å·å°äº6使°åé¢è¡¥0 |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | | } |
| | | if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | { |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | TM = HTMNumber + LSH2; |
| | | } |
| | | if (TM.Trim() == "") |
| | | { |
| | | MessageBox.Show("æ¡å½¢ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"); |
| | | return; |
| | | } |
| | | string HWei = ""; //å°¾æ° |
| | | string HBarCode = ""; |
| | | string HBarCodeType = ""; |
| | | Int64 HMaterID = 0; |
| | | Int64 HAuxPropID = 0; |
| | | Int64 HUnitID = 0; |
| | | double HQty2 = 0; |
| | | string HBatchNo2 = ""; |
| | | Int64 HSupID = 0; |
| | | Int64 HGroupID = 0; |
| | | int HPrintQty = 0; |
| | | Int64 HSourceInterID = 0; |
| | | Int64 HSourceEntryID = 0; |
| | | string HSourceBillNo = ""; |
| | | string HSourceBillType = ""; |
| | | Int64 HBarcodeNo = 0; //æå· |
| | | Int64 HBarcodeQtys = 0; //æ»ææ° |
| | | Int64 HDeptID = 0; |
| | | Int64 HWhID = 0; |
| | | Int64 HSPID = 0; |
| | | string HRemark = ""; |
| | | string HMaterName = ""; |
| | | string HMaterModel = ""; |
| | | string HPinfan = ""; |
| | | string HMTONo = ""; |
| | | Int64 HCusID = 0; |
| | | string HCusType = ""; |
| | | DateTime HEndDate; |
| | | string HWorkLineName = ""; |
| | | string HSeOrderBillNo = ""; |
| | | string HInnerBillNo = ""; |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | HWei = WeiShu; |
| | | HBarCode = TM; |
| | | HBarCodeType = ClsPub.isStrNull(cmbHBarCodeType.Text); |
| | | HMaterID = ClsPub.isLong(grdMain.SelectedRows[j].Cells[Fun_GetCol("HMaterID")].Value); |
| | | HAuxPropID = 0; |
| | | HUnitID = 0; |
| | | HQty2 = HMinQty; |
| | | HBatchNo2 = ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | HSourceInterID = 0; |
| | | HSourceEntryID = 0; |
| | | HSourceBillNo = ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("ç产订åå·")].Value); |
| | | HSourceBillType = "3710"; |
| | | HBarcodeQtys = 0; |
| | | HBarcodeNo = 0; |
| | | HSupID = 0; |
| | | HDeptID = 0; |
| | | HWhID = 0; |
| | | HSPID = 0; |
| | | HRemark = ""; |
| | | HMaterName = ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("ç©æåç§°")].Value); |
| | | HMaterModel = ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("è§æ ¼åå·")].Value); |
| | | HPinfan = ""; |
| | | HMTONo = ""; |
| | | HCusID = 0; |
| | | HCusType = ""; |
| | | HEndDate = ClsPub.isDate(grdMain.SelectedRows[j].Cells[Fun_GetCol("æ¥æ")].Value); |
| | | HWorkLineName = ""; |
| | | HSeOrderBillNo = ""; |
| | | HInnerBillNo = ""; |
| | | oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | | + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString() |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'" |
| | | + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + HDate + "'" |
| | | + ", " + ClsPub.HOrgID.ToString() + "," + ClsPub.HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')"); |
| | | oCn.Commit(); |
| | | MessageBox.Show("æ¡ç çæå®æ¯ï¼"); |
| | | //grdSub.RowCount = 0; |
| | | DisplayTM(); |
| | | } |
| | | |
| | | catch (Exception e1) |
| | | { |
| | | oCn.RollBack(); |
| | | MessageBox.Show("æ¡ç çæå¤±è´¥ï¼" + e1.Message); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //ç©æ |
| | | if (txtHMaterID.Text.Trim() != "") |
| | | } |
| | | |
| | | |
| | | private void DisplayTM() |
| | | { |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | | sFastSQL = sFastSQL + " and HMaterID like '%" + txtHMaterID.Text + "%'"; |
| | | } |
| | | //æºå° |
| | | if (txtHSourceID.Text.Trim() != "") |
| | | { |
| | | sFastSQL = sFastSQL + " and HSourceID like '%" + txtHSourceID.Text + "%'"; |
| | | } |
| | | //夿å¼å§æ¥æ |
| | | if (dtpHBeginDate.Checked) |
| | | { |
| | | sFastSQL = sFastSQL + " and æ¥æ>='" + dtpHBeginDate.Value.ToShortDateString() + "'"; |
| | | } |
| | | //å¤æç»ææ¥æ |
| | | if (dtpHEndDate.Checked) |
| | | { |
| | | sFastSQL = sFastSQL + " and æ¥æ<='" + dtpHEndDate.Value.ToShortDateString() + "'"; |
| | | } |
| | | if (sFastSQL.Trim() == "") |
| | | { |
| | | MessageBox.Show("没æè¾å
¥æ¡ä»¶!"); |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,æ¡ç ä¸åå¨ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | sDlgWhere = sFastSQL; |
| | | Display(); |
| | | sDlgWhere = ""; |
| | | // |
| | | grdList.DataSource = DSet.Tables[0].DefaultView; |
| | | //å»ç» |
| | | int FrCol = 0; |
| | | string s = "æ¯"; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdList, this.Name + "grdList", s, FrCol); |
| | | //ç»çº¿ |
| | | //GraphLine(); |
| | | // |
| | | } |
| | | |
| | | //private void button5_Click(object sender, EventArgs e) |
| | | //{ |
| | | // //夿æ¯å¦å·²ç»çææ¡ç |
| | | // for (int j = 0; j < grdMain.SelectedRows.Count; j++) |
| | | // { |
| | | // if (DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("HBarCode")].Value) == "") |
| | | // { |
| | | // MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååé¢è§ï¼"); |
| | | // return; |
| | | // } |
| | | |
| | | // //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | // if (ReportPrintBegin()) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | // //éæ©æå°æ¨¡æ¿ |
| | | // BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | // oFrm.sBillName = ModName; |
| | | // oFrm.sBillModel = ModCaption; |
| | | // oFrm.ShowDialog(); |
| | | // if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | // { |
| | | // Sub_SetReport(oFrm.sOpenTmp); |
| | | // Report.PrintPreview(false); |
| | | // Thread.Sleep(1000); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | //private bool ReportPrintBegin() |
| | | //{ |
| | | // string sRelQty = ""; |
| | | |
| | | // if (oBar.Set_BPrintQty(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("HBarCode")].Value), ref sRelQty)) |
| | | // { |
| | | // MessageBox.Show("æ¡ç å·²ç»æå°è¿ï¼ä¸å¯é夿å°ï¼"); |
| | | // return true; |
| | | // } |
| | | // else |
| | | // { |
| | | // return false; |
| | | // } |
| | | //} |
| | | |
| | | private void button1_Click(object sender, EventArgs e) |
| | | { |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | string sBarCode = ""; |
| | | string sRelQty = ""; |
| | | for (int i = 0; i < grdSub.SelectedRows.Count; i++) |
| | | { |
| | | sBarCode = sBarCode + "," + DBUtility.ClsPub.isStrNull(grdSub.Rows[grdSub.SelectedRows[i].Index].Cells[Fun_GetCol("HBarcode")].Value); |
| | | } |
| | | //if (oBar.Set_BPrintQty(sBarCode.Substring(1), ref sRelQty)) |
| | | //{ |
| | | // MessageBox.Show(sRelQty); |
| | | // return; |
| | | //} |
| | | |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | //DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = ModCaption; |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(false); |
| | | //oBar.Set_PrintQty(DBUtility.ClsPub.isStrNull(grdMain.Rows[CurRows].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value)); |
| | | Thread.Sleep(1000); |
| | | } |
| | | |
| | | //æ¹éæ´æ°æ¡ç æå°æ¬¡æ° |
| | | oBar.Set_EPrintQty(sBarCode.Substring(1)); |
| | | } |
| | | |
| | | private void cmdHSaveBill1_Click(object sender, EventArgs e) |
| | | { |
| | | Display1(); |
| | | } |
| | | |
| | | private void Display1() |
| | | { |
| | | ClsCN SubCn = new ClsCN(); |
| | | DataSet DSet; |
| | | string sSql = ""; |
| | | string sFastSQL = ""; |
| | | //ç产订åå· |
| | | //if (txtHICMOBillNo.Text.Trim() != "") |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and HICMOBillNo like '%" + txtHICMOBillNo.Text + "%'"; |
| | | //} |
| | | string HICMOBillNo = ""; |
| | | HICMOBillNo = txtHICMOBillNo1.Text.Trim().ToString(); |
| | | //ç©æ |
| | | //if (txtHMaterID.Text.Trim() != "") |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and HMaterName like '%" + txtHMaterID.Text + "%'"; |
| | | //} |
| | | string HMaterName = ""; |
| | | HMaterName = txtHMaterID1.Text.Trim().ToString(); |
| | | //夿å¼å§æ¥æ |
| | | //if (dtpHBeginDate.Checked) |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and æ¥æ>='" + dtpHBeginDate.Value.ToShortDateString() + "'"; |
| | | //} |
| | | string HBeginDate = ""; |
| | | HBeginDate = dtpHBeginDate1.Value.ToShortDateString(); |
| | | |
| | | //å¤æç»ææ¥æ |
| | | //if (dtpHEndDate.Checked) |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and æ¥æ<='" + dtpHEndDate.Value.ToShortDateString() + "'"; |
| | | //} |
| | | string HEndDate = ""; |
| | | HEndDate = dtpHEndDate1.Value.ToShortDateString(); |
| | | //if (sFastSQL.Trim() == "") |
| | | //{ |
| | | // MessageBox.Show("没æè¾å
¥æ¡ä»¶!"); |
| | | // return; |
| | | //} |
| | | |
| | | //è¿æ»¤æ¡ä»¶ |
| | | |
| | | // |
| | | DSet = SubCn.RunProcReturn("exec h_p_KSTMCX '" + HICMOBillNo + "' , '" + HMaterName + "' ,'" + HBeginDate + "', '" + HEndDate + "'", "h_p_KSTMCX", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,请å¨è¿æ»¤æ¡ä¸ç¹å»ãæ¢å¤ãæé®,å°è¯å次æ¥è¯¢ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | // |
| | | grdSub.DataSource = DSet.Tables[0].DefaultView; |
| | | //å»ç» |
| | | //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | //string s = frmCondition.cmbHComplete.Text; |
| | | //DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name, s, FrCol); |
| | | //ç»çº¿ |
| | | GraphLine(); |
| | | |
| | | |
| | | // |
| | | } |
| | | |
| | | private void cmdHSourceID_Click(object sender, EventArgs e) |
| | | { |
| | | DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View(); |
| | | if (oSource.RefreshView()) |
| | | { |
| | | this.txtHSourceID.Text = oSource.oModel.HName; |
| | | this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString(); |
| | | } |
| | | else |
| | | { |
| | | this.txtHSourceID.Text = ""; |
| | | } |
| | | } |
| | | |
| | | private void cmdHEmpID_Click(object sender, EventArgs e) |
| | | { |
| | | DAL.ClsGy_Employee_View oEmp = new DAL.ClsGy_Employee_View(); |
| | | if (oEmp.RefreshView()) |
| | | { |
| | | this.txtHEmpID.Text = oEmp.oModel.HName; |
| | | this.txtHEmpID.Tag = oEmp.oModel.HItemID.ToString(); |
| | | } |
| | | else |
| | | { |
| | | this.txtHEmpID.Text = ""; |
| | | } |
| | | } |
| | | |
| | | private void cmdHMaterID_Click(object sender, EventArgs e) |
| | | { |
| | | DAL.ClsGy_Material_View oMater = new DAL.ClsGy_Material_View(); |
| | | if (oMater.RefreshView()) |
| | | { |
| | | this.txtHMaterID.Text = oMater.oModel.HName; |
| | | this.txtHMaterID.Tag = oMater.oModel.HItemID.ToString(); |
| | | } |
| | | else |
| | | { |
| | | this.txtHMaterID.Text = ""; |
| | | } |
| | | } |
| | | |
| | | private void cmdHMaterID1_Click(object sender, EventArgs e) |
| | | { |
| | | DAL.ClsGy_Material_View oMater = new DAL.ClsGy_Material_View(); |
| | | if (oMater.RefreshView()) |
| | | { |
| | | this.txtHMaterID1.Text = oMater.oModel.HName; |
| | | this.txtHMaterID1.Tag = oMater.oModel.HItemID.ToString(); |
| | | } |
| | | else |
| | | { |
| | | this.txtHMaterID1.Text = ""; |
| | | } |
| | | } |
| | | |
| | | private void txtHMiniQty_TextChanged(object sender, EventArgs e) |
| | | { |
| | | //double HMiniQty = 0; |
| | | //double HBQty = 0; |
| | | //HMiniQty = DBUtility.ClsPub.isDoule(txtHMiniQty.Text.Trim()); |
| | | //HBQty = |
| | | |
| | | |
| | | } |
| | | |
| | | private void txtHBQty_TextChanged(object sender, EventArgs e) |
| | | { |
| | | double HICMOQty = 0; |
| | | double HMiniQty = 0; |
| | | double HBQty = 0; |
| | | |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < grdMain.SelectedRows.Count; i++) |
| | | { |
| | | txtHICMOQty.Text = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | } |
| | | HICMOQty = DBUtility.ClsPub.isDoule(txtHICMOQty.Text.Trim()); |
| | | HMiniQty = DBUtility.ClsPub.isDoule(txtHMiniQty.Text.Trim()); |
| | | if (HMiniQty == 0) |
| | | { |
| | | HBQty = 0; |
| | | } |
| | | else |
| | | { |
| | | HBQty = HICMOQty / HMiniQty; |
| | | } |
| | | HBQty = Math.Ceiling(HBQty); |
| | | txtHBQty.Text = DBUtility.ClsPub.isStrNull(HBQty); |
| | | } |
| | | |
| | | private void button5_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | for (int i = 0; i < grdList.SelectedRows.Count; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isStrNull(grdList.SelectedRows[i].Cells[Fun_GetColList("æ¡ç ç¼å·")].Value) == "") |
| | | { |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååé¢è§ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | if (ReportPrintBegin()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = ModCaption; |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | private bool ReportPrintBegin() |
| | | { |
| | | string sRelQty = ""; |
| | | |
| | | if (oBar.Set_BPrintQty(DBUtility.ClsPub.isStrNull(grdList.Rows[0].Cells[Fun_GetColList("æ¡ç ç¼å·")].Value), ref sRelQty)) |
| | | { |
| | | MessageBox.Show("æ¡ç å·²ç»æå°è¿ï¼ä¸å¯é夿å°ï¼"); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | private void button6_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | if (DBUtility.ClsPub.isStrNull(grdList.Rows[0].Cells[Fun_GetColList("æ¡ç ç¼å·")].Value) == "") |
| | | { |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååé¢è§ï¼"); |
| | | return; |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | if (ReportPrintBegin()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = ModCaption; |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | private void cz_Click(object sender, EventArgs e) |
| | | { |
| | | txtHBQty.Text = ""; |
| | | txtHEmpID.Text = ""; |
| | | txtHICMOBillNo.Text = ""; |
| | | txtHICMOBillNo1.Text = ""; |
| | | txtHICMOQty.Text = ""; |
| | | txtHMaterID.Text = ""; |
| | | txtHMaterID1.Text = ""; |
| | | txtHMiniQty.Text = ""; |
| | | txtHSourceID.Text = ""; |
| | | cmbHBarCodeType.Items.Clear(); |
| | | grdList.DataSource = null; |
| | | grdSub.DataSource = null; |
| | | grdMain.DataSource = null; |
| | | } |
| | | } |
| | | } |