| | |
| | | using System; |
| | | using gregn6Lib; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace WarM.ä»åºç®¡ç |
| | | namespace WarM |
| | | { |
| | | public partial class Gy_BarCodeBill_ChaiMa : Form |
| | | { |
| | |
| | | { |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | //å®ä¹å |
| | | public const Int16 HTagCol = 0; |
| | | public const Int16 HBarCode = 1; |
| | | public const Int16 HQty = 2; |
| | | public const Int16 HNum = 3; |
| | | public const Int16 HMaterCol = 4; |
| | | public const Int16 HMaterName = 5; |
| | | public const Int16 HMaterMould = 6; |
| | | public const Int16 HBatchNo = 7; |
| | | // |
| | | private void txtHBillNo_TextChanged(object sender, EventArgs e) |
| | | { |
| | | public const Int16 HSnoCol = 1; |
| | | public const Int16 HInterID = 2; |
| | | public const Int16 HBarCode = 3; |
| | | public const Int16 HQty = 4; |
| | | public const Int16 HNum = 5; |
| | | public const Int16 HMaterCol = 6; |
| | | public const Int16 HMaterName = 7; |
| | | public const Int16 HMaterMould = 8; |
| | | public const Int16 HBatchNo =9; |
| | | //======================================================================= |
| | | public const Int16 HTagCol2 = 0; |
| | | public const Int16 HSnoCol2 = 1; |
| | | public const Int16 HInterID2 = 2; |
| | | public const Int16 HBarCode2 = 3; |
| | | public const Int16 HQty2 = 4; |
| | | public const Int16 HNum2 = 5; |
| | | public const Int16 HMaterCol2 = 6; |
| | | public const Int16 HMaterName2 = 7; |
| | | public const Int16 HMaterMould2 = 8; |
| | | public const Int16 HBatchNo2 = 9; |
| | | |
| | | public const string ModName = "3302"; //åæ®ç±»å |
| | | public const string ModCaption = "æ¡ç æç "; //åæ®åç§° |
| | | public const string ModRightName = "Gy_BarCodeBill_ChaiMa"; |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; //åæ®ç¶æï¼æ°å¢ï¼ä¿®æ¹ï¼æµè§ï¼æ´æ°åä»·ï¼åæ´ï¼ |
| | | ClsGridViewSum oSumGrid_Mater = new ClsGridViewSum(); |
| | | ClsGridViewSum oSumGrid_Pay = new ClsGridViewSum(); |
| | | public DAL.ClsGy_BarCodeBill_ChaiMa BillNew = new DAL.ClsGy_BarCodeBill_ChaiMa(); //对åºåæ®ç±» |
| | | public DAL.ClsGy_BarCodeBill_ChaiMa BillOld = new DAL.ClsGy_BarCodeBill_ChaiMa(); //对åºåæ®ç±» |
| | | |
| | | //æ¸
空çé¢ |
| | | public void Sub_ClearBill() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp); |
| | | // |
| | | txtHMaker.Text = DBUtility.ClsPub.CurUserName; |
| | | initGrid(); |
| | | initGrid_Pay(); |
| | | oSumGrid_Mater.NoCol = HSnoCol; |
| | | oSumGrid_Pay.NoCol = HSnoCol2; |
| | | } |
| | | |
| | | #region çªä½å¤çæ¹æ³ |
| | | //åå§å页ç¾1æ°æ® |
| | | private void intoDate() |
| | | { |
| | | try |
| | | { |
| | | DataSet Ds; |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Ds = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_ChaiMa", "h_v_Gy_BarCodeBill_ChaiMa"); |
| | | grdMain.DataSource = Ds.Tables[0].DefaultView; |
| | | |
| | | } |
| | | catch (Exception ex ) |
| | | { |
| | | MessageBox.Show(ex.Message.ToString()); |
| | | } |
| | | |
| | | } |
| | | |
| | | //åå§å页ç¾1 |
| | | private void initGrid() |
| | | { |
| | | grdMain.ColumnCount = 10; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name + "1"); |
| | | grdMain.Columns[HSnoCol].HeaderText = "åºå·"; |
| | | grdMain.Columns[HInterID].HeaderText = "HInterID"; |
| | | grdMain.Columns[HBarCode].HeaderText = "æ¡ç ç¼å·"; |
| | | grdMain.Columns[HQty].HeaderText = "æ¡ç æ°é"; |
| | | grdMain.Columns[HNum].HeaderText = "æåæ°é"; |
| | | grdMain.Columns[HMaterCol].HeaderText = "ç©æä»£ç "; |
| | | grdMain.Columns[HMaterName].HeaderText = "ç©æåç§°"; |
| | | grdMain.Columns[HMaterMould].HeaderText = "è§æ ¼åå·"; |
| | | grdMain.Columns[HBatchNo].HeaderText = "æ¹å·"; |
| | | //============================================================================= |
| | | |
| | | ////éèå |
| | | 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); |
| | | } |
| | | |
| | | //åå§å页ç¾2 |
| | | private void initGrid_Pay() |
| | | { |
| | | grdMain_Pay.ColumnCount = 10; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain_Pay, this.Name + "1"); |
| | | grdMain_Pay.Columns[HSnoCol2].HeaderText = "åºå·"; |
| | | grdMain_Pay.Columns[HInterID2].HeaderText = "HInterID"; |
| | | grdMain_Pay.Columns[HBarCode2].HeaderText = "æ¡ç ç¼å·"; |
| | | grdMain_Pay.Columns[HQty2].HeaderText = "æ¡ç æ°é"; |
| | | grdMain_Pay.Columns[HNum2].HeaderText = "æåæ°é"; |
| | | grdMain_Pay.Columns[HMaterCol2].HeaderText = "ç©æä»£ç "; |
| | | grdMain_Pay.Columns[HMaterName2].HeaderText = "ç©æåç§°"; |
| | | grdMain_Pay.Columns[HMaterMould2].HeaderText = "è§æ ¼åå·"; |
| | | grdMain_Pay.Columns[HBatchNo2].HeaderText = "æ¹å·"; |
| | | //============================================================================= |
| | | ////éèå |
| | | 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(); |
| | | //设置å计å |
| | | string sTotalCol = HTagCol2.ToString() + "0"; |
| | | //æ ¼å¼åç½æ ¼ |
| | | //DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid_Pay); |
| | | } |
| | | |
| | | // åºæ¬ä¸å |
| | | |
| | | private void grdMain_RowHeadersWidthChanged(object sender, EventArgs e) |
| | | { |
| | | DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid_Mater); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | //页é¢å è½½ |
| | | private void Gy_BarCodeBill_ChaiMa_Load(object sender, EventArgs e) |
| | | { |
| | | txtHBillNo.Text = ""; |
| | | txtNum.Text = ""; |
| | | txtHMaker.Text = DBUtility.ClsPub.CurUserName; |
| | | Sub_ClearBill(); |
| | | } |
| | | |
| | | ////æ°æ®éªè¯ |
| | | //private bool Sub_AllowSave() |
| | | //{ |
| | | // for (int i = 0; i <= grdMain_Pay.RowCount - 1; i++) |
| | | // { |
| | | // if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0) |
| | | // { |
| | | // if (ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HNum2].Value) ==null) |
| | | // { |
| | | // MessageBox.Show("请å°è¡¨æ ¼æåæ°éå¡«å宿´", "æç¤º"); |
| | | // return false; |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // return true; |
| | | // } |
| | | // } |
| | | // return true; |
| | | //} |
| | | |
| | | //çææé® |
| | | private void xz_Click(object sender, EventArgs e) |
| | | { |
| | | this.SeverDate(); |
| | | } |
| | | private bool SeverDate() |
| | | { |
| | | Int32 i; |
| | | bool bResult; |
| | | BillNew = new DAL.ClsGy_BarCodeBill_ChaiMa(); |
| | | //if (Sub_AllowSave()) |
| | | //{ |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string HBillNo = txtHBillNo.Text; |
| | | DataSet Ds; |
| | | double sum = 0.00000000; |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Ds = oCn.RunProcReturn("select top 1* from Gy_BarCodeBill where HBarCode='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa"); |
| | | for (i = 0; i <= grdMain_Pay.RowCount - 1; i++) |
| | | { |
| | | if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0) |
| | | { |
| | | Model.ClsGy_BarCodeEdit_Model model = new Model.ClsGy_BarCodeEdit_Model(); |
| | | //åºå®èµå¼======================================== |
| | | model.HEntryID = i + 1; |
| | | model.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | model.HBarCode = DBUtility.ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HBarCode].Value); |
| | | model.HQty = DBUtility.ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HNum2].Value); |
| | | model.HQty = DBUtility.ClsPub.isInt(grdMain_Pay.Rows[i].Cells[HNum2].Value); |
| | | model.HBatchNo = DBUtility.ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HBatchNo].Value); |
| | | model.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"].ToString()); |
| | | model.HUnitID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HUnitID"].ToString()); |
| | | model.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"].ToString()); |
| | | model.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"].ToString()); |
| | | model.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"].ToString()); |
| | | model.HBarCodeType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCodeType"].ToString()); |
| | | model.HItemSubID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HItemSubID"].ToString()); |
| | | model.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"].ToString()); |
| | | model.HSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceInterID"].ToString()); |
| | | model.HSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceEntryID"].ToString()); |
| | | model.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"].ToString()); |
| | | model.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"].ToString()); |
| | | model.HUseFlag = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUseFlag"].ToString()); |
| | | model.HInitQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HInitQty"].ToString()); |
| | | model.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInitQty"].ToString()); |
| | | model.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"].ToString()); |
| | | model.HSTOCKORGID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSTOCKORGID"].ToString()); |
| | | model.HOWNERID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOWNERID"].ToString()); |
| | | model.HBarCodeDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HBarCodeDate"].ToString()); |
| | | model.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"].ToString()); |
| | | model.HMZ = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HMZ"].ToString()); |
| | | |
| | | model.HMakeDate = DateTime.Now; |
| | | model.HMaker = ClsPub.CurUserName; |
| | | |
| | | if (model.HQty <= 0 || model.HQty.ToString() == "") |
| | | { |
| | | MessageBox.Show("页2第" + ClsPub.isStrNull(i + 1) + "è¡ï¼æåæ°éå¿
须大äº0ï¼"); |
| | | return false; |
| | | } |
| | | sum += model.HQty; |
| | | BillNew.DetailColl_Mater.Add(model); |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | if (sum > DBUtility.ClsPub.isDoule(grdMain.Rows[0].Cells[HQty].Value)) |
| | | { |
| | | MessageBox.Show("页2æåæ°éä¹åå¿
é¡»å°äºæ¡ç æ°éï¼"); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | //ä¿å |
| | | bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo, HBillNo); |
| | | //æç¤º |
| | | if (bResult == true) |
| | | { |
| | | MessageBox.Show("åæ®åç宿¯!åæ®å·:" + this.txtHBillNo.Text.Trim(), "æç¤º"); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("ä¿å失败!åå :" + ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | //ç¡®å®æé® |
| | | private void button1_Click(object sender, EventArgs e) |
| | | { |
| | | if (DBUtility.ClsPub.isStrNull(txtHBillNo.Text) != ""&& DBUtility.ClsPub.isStrNull(txtNum.Text) != "") |
| | | { |
| | | string HBillNo = txtHBillNo.Text; |
| | | int HNumCan = int.Parse(txtNum.Text); |
| | | DataSet Ds; |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Ds = oCn.RunProcReturn("select top 1* from h_v_Gy_BarCodeBill_ChaiMa where æ¡ç ç¼å·='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("æ¡ç ç¼å·ä¸åå¨", "æç¤º"); |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[0].Cells[HTagCol].Value = "*"; |
| | | grdMain.Rows[0].Cells[HSnoCol].Value = 1; |
| | | grdMain.Rows[0].Cells[HInterID].Value = Ds.Tables[0].Rows[0]["HInterID"].ToString(); |
| | | grdMain.Rows[0].Cells[HBarCode].Value = Ds.Tables[0].Rows[0]["æ¡ç ç¼å·"].ToString(); |
| | | grdMain.Rows[0].Cells[HQty].Value = Ds.Tables[0].Rows[0]["æ¡ç æ°é"].ToString(); |
| | | grdMain.Rows[0].Cells[HNum].Value = 0; |
| | | grdMain.Rows[0].Cells[HMaterCol].Value = Ds.Tables[0].Rows[0]["ç©æä»£ç "].ToString(); |
| | | grdMain.Rows[0].Cells[HMaterName].Value = Ds.Tables[0].Rows[0]["ç©æåç§°"].ToString(); |
| | | grdMain.Rows[0].Cells[HMaterMould].Value = Ds.Tables[0].Rows[0]["è§æ ¼åå·"].ToString(); |
| | | grdMain.Rows[0].Cells[HBatchNo].Value = Ds.Tables[0].Rows[0]["æ¹å·"].ToString(); |
| | | for (int i = 0; i < HNumCan; i++) |
| | | { |
| | | int Code = 65 + i; |
| | | System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding(); |
| | | byte[] byteArray = new byte[] { (byte)Code }; |
| | | string A = asciiEncoding.GetString(byteArray); |
| | | string No = Ds.Tables[0].Rows[0]["æ¡ç ç¼å·"].ToString(); |
| | | grdMain_Pay.Rows[i].Cells[HTagCol2].Value = "*"; |
| | | grdMain_Pay.Rows[i].Cells[HSnoCol2].Value = HSnoCol2+i; |
| | | grdMain_Pay.Rows[i].Cells[HInterID2].Value = Ds.Tables[0].Rows[0]["HInterID"].ToString(); |
| | | grdMain_Pay.Rows[i].Cells[HBarCode2].Value = No + A; |
| | | grdMain_Pay.Rows[i].Cells[HQty2].Value = Ds.Tables[0].Rows[0]["æ¡ç æ°é"].ToString(); |
| | | grdMain_Pay.Rows[i].Cells[HMaterCol2].Value = Ds.Tables[0].Rows[0]["ç©æä»£ç "].ToString(); |
| | | grdMain_Pay.Rows[i].Cells[HMaterName2].Value = Ds.Tables[0].Rows[0]["ç©æåç§°"].ToString(); |
| | | grdMain_Pay.Rows[i].Cells[HMaterMould2].Value = Ds.Tables[0].Rows[0]["è§æ ¼åå·"].ToString(); |
| | | grdMain_Pay.Rows[i].Cells[HBatchNo2].Value = Ds.Tables[0].Rows[0]["æ¹å·"].ToString(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("è¯·å¡«åæ¡ç ç¼å·åæåæ¡æ°", "æç¤º"); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void tc_Click(object sender, EventArgs e) |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | | } |