| | |
| | | using Pub_Class; |
| | | using gregn6Lib; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace WarM |
| | |
| | | public const Int16 HMaterMould2 = 8; |
| | | public const Int16 HBatchNo2 = 9; |
| | | |
| | | public const string ModName = ""; //åæ®ç±»å |
| | | public const string ModName = "3302"; //åæ®ç±»å |
| | | public const string ModCaption = "æ¡ç æç "; //åæ®åç§° |
| | | public const string ModRightName = "Gy_BarCodeBill_ChaiMa"; |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; //åæ®ç¶æï¼æ°å¢ï¼ä¿®æ¹ï¼æµè§ï¼æ´æ°åä»·ï¼åæ´ï¼ |
| | |
| | | ////éèå |
| | | grdMain.Columns[HTagCol].Visible = false; |
| | | grdMain.Columns[HInterID].Visible = false; |
| | | |
| | | //ç½®ç° |
| | | grdMain.Columns[HSnoCol].ReadOnly = true; |
| | | grdMain.Columns[HBarCode].ReadOnly = true; |
| | | grdMain.Columns[HQty].ReadOnly = true; |
| | | grdMain.Columns[HMaterCol].ReadOnly = true; |
| | | grdMain.Columns[HMaterName].ReadOnly = true; |
| | | grdMain.Columns[HMaterMould].ReadOnly = true; |
| | | grdMain.Columns[HBatchNo].ReadOnly = true; |
| | | //intoDate(); |
| | | //æ ¼å¼åç½æ ¼ |
| | | //DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid_Mater); |
| | |
| | | ////éèå |
| | | grdMain_Pay.Columns[HTagCol].Visible = false; |
| | | grdMain_Pay.Columns[HInterID].Visible = false; |
| | | //ç½®ç° |
| | | grdMain_Pay.Columns[HSnoCol].ReadOnly = true; |
| | | grdMain_Pay.Columns[HBarCode].ReadOnly = true; |
| | | grdMain_Pay.Columns[HQty].ReadOnly = true; |
| | | grdMain_Pay.Columns[HMaterCol].ReadOnly = true; |
| | | grdMain_Pay.Columns[HMaterName].ReadOnly = true; |
| | | grdMain_Pay.Columns[HMaterMould].ReadOnly = true; |
| | | grdMain_Pay.Columns[HBatchNo].ReadOnly = true; |
| | | //设置å¯ç¼è¾å |
| | | string sAllowCol = HNum2.ToString(); |
| | | //设置å计å |
| | |
| | | { |
| | | this.Close(); |
| | | } |
| | | |
| | | GridppReport Report; |
| | | private void yl_Click(object sender, EventArgs e) |
| | | { |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = "æ¡ç æ¡£æ¡å表"; |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | private void dy_Click(object sender, EventArgs e) |
| | | { |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | string sBarCode = ""; |
| | | string sRelQty = ""; |
| | | int i = 0; |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | |
| | | if (ClsPub.isLong(grdMain_Pay.Rows[0].Cells[HSnoCol2].Value) == 0) |
| | | { |
| | | MessageBox.Show("请å
çææç æ¡ç ï¼"); |
| | | } |
| | | |
| | | while (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0) |
| | | { |
| | | sBarCode = sBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HBarCode2].Value); |
| | | i++; |
| | | } |
| | | |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = "æ¡ç æ¡£æ¡å表"; |
| | | 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 Sub_SetReport(string sOpenTmp) |
| | | { |
| | | //å¤æè¡æ° |
| | | for (int i = 0; i < grdMain_Pay.Rows.Count; i++) |
| | | { |
| | | grdMain_Pay.Rows[i].Cells[0].Value = ""; |
| | | } |
| | | for (int i = 0; i < grdMain_Pay.SelectedRows.Count; i++) |
| | | { |
| | | grdMain_Pay.Rows[grdMain_Pay.SelectedRows[i].Index].Cells[0].Value = "*"; |
| | | } |
| | | // |
| | | Report = new GridppReport(); |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | } |
| | | //å¡«å
¥åæ®è¡¨å¤´ä¿¡æ¯ |
| | | private void ReportBeforePostRecord()//your report?kao |
| | | { |
| | | try |
| | | { |
| | | //Report.FieldByName("ç©æä»£ç ").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("ç©æä»£ç ")].Value.ToString(); |
| | | //Report.FieldByName("ç©æåç§°").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("ç©æåç§°")].Value.ToString(); |
| | | //Report.FieldByName("è§æ ¼åå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("è§æ ¼åå·")].Value.ToString(); |
| | | //Report.FieldByName("èªå®ä¹è§æ ¼").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("èªå®ä¹è§æ ¼")].Value.ToString(); |
| | | //Report.FieldByName("æ¡ç ç¼å·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value.ToString(); |
| | | //Report.FieldByName("æ°é").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æ°é")].Value.ToString(); |
| | | //Report.FieldByName("æ¹æ¬¡").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æ¹å·")].Value.ToString(); |
| | | //Report.FieldByName("æºååå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æºååå·")].Value.ToString(); |
| | | //Report.FieldByName("éå®è®¢åå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("éå®è®¢åå·")].Value.ToString(); |
| | | //Report.FieldByName("éè´è®¢åå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("éè´è®¢åå·")].Value.ToString(); |
| | | //Report.FieldByName("ä¾åºå").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("徿¥åä½")].Value.ToString(); |
| | | //Report.FieldByName("ç产车é´").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("ç产车é´")].Value.ToString(); |
| | | //Report.FieldByName("夿³¨").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("夿³¨")].Value.ToString(); |
| | | //Report.FieldByName("æ»ææ°").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æ»ææ°")].Value.ToString(); |
| | | //Report.FieldByName("æå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æå·")].Value.ToString(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show("æå°å¤±è´¥!表头ï¼" + e.Message); |
| | | } |
| | | //CurRows = CurRows + 1; |
| | | } |
| | | private void ReportFetchRecordByDataTable() |
| | | { |
| | | try |
| | | { |
| | | DataTable ds = new DataTable(); |
| | | BLL.Utility.FillRecordToReport_Sel(Report, grdMain_Pay, ds, Fun_GetCol("åºå·")); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show("æå°å¤±è´¥!表ä½ï¼" + e.Message); |
| | | } |
| | | } |
| | | private Int32 Fun_GetCol(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain_Pay); |
| | | } |
| | | } |
| | | } |