| | |
| | | GridppReport Report; |
| | | int CurRows = 0; |
| | | string sBarCodeItemID = ""; //æ¡ç èªå¢å |
| | | string HBarCodeType = ""; //æ¡ç ç±»å |
| | | |
| | | //é¢è§ |
| | | private void yl_Click(object sender, EventArgs e) |
| | |
| | | //æå°é¢è§æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNamePrint, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | if (ReportPrintBegin()) |
| | | { |
| | | MessageBox.Show("æéæ¡ç ä¸åå¨å·²æå°çãè¶
èåå
æ ç¾ãæ¡ç ï¼ä¸å
è®¸åæ¬¡æå°ï¼"); |
| | | return; |
| | | } |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | if (ReportPrintBegin()) |
| | | { |
| | | MessageBox.Show("æéæ¡ç ä¸åå¨å·²æå°çãè¶
èåå
æ ç¾ãæ¡ç ï¼ä¸å
è®¸åæ¬¡æå°ï¼"); |
| | | return; |
| | | } |
| | | |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | private bool ReportPrintBegin() |
| | | { |
| | | sBarCodeItemID = ""; |
| | | for (int i = 0; i < grdMain.SelectedRows.Count; i++) |
| | | { |
| | | sBarCodeItemID = sBarCodeItemID + "," + DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[Fun_GetCol("HItemID")].Value).ToString(); |
| | | |
| | | if(HBarCodeType != "è¶
èåå
æ ç¾" && DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[Fun_GetCol("æ¡ç ç±»å")].Value)== "è¶
èåå
æ ç¾") |
| | | { |
| | | HBarCodeType = "è¶
èåå
æ ç¾"; |
| | | } |
| | | } |
| | | sBarCodeItemID = sBarCodeItemID.Remove(0, 1); |
| | | |
| | | if (HBarCodeType == "è¶
èåå
æ ç¾") |
| | | { |
| | | DataSet DS; |
| | | DS = oCn.RunProcReturn("select top 1 1 from Gy_BarCodeBill_Cus with(nolock) where HPrintQty >=1 and HBarCodeType = 'è¶
èåå
æ ç¾' and HItemID in (" + sBarCodeItemID + ")", "Gy_BarCodeBill_Cus"); |
| | | if (DS == null || DS.Tables[0].Rows.Count == 0) |
| | | { |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | Report.PrintBegin += new _IGridppReportEvents_PrintBeginEventHandler(ReportPrintBegin2); |
| | | Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //æå°å¼å§å夿 |
| | | private void ReportPrintBegin2() |
| | | { |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | if (ReportPrintBegin()) |
| | | { |
| | | MessageBox.Show("æ¡ç å·²æå°ï¼ä¸å
è®¸åæ¬¡æå°ï¼"); |
| | | Report.AbortPrint(); |
| | | } |
| | | } |
| | | |
| | | //æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | private void ReportPrintEnd() |
| | | { |