| | |
| | | using DBUtility; |
| | | using System.Threading; |
| | | using System.IO; |
| | | using Pub_Class; |
| | | |
| | | namespace WarM |
| | | { |
| | |
| | | public const string ModRightNameCheck = ModRightName + "_Check"; |
| | | public const string ModRightNameClose = ModRightName + "_Close"; |
| | | public const string ModRightNameDelete = ModRightName + "_Delete"; |
| | | public const string ModRightNamePrint = ModRightName + "_Print"; //æå° |
| | | //DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //public Gy_ICBomBill oFrm; |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | public int selectRow = 0; |
| | | public int selectRow2 = 0; |
| | | public long PrintQty = 0; //å
许æ¡ç æå°æ¬¡æ° |
| | | public string PrintQtyCtl = ""; //æ¡ç æå°æ¬¡æ°æ§å¶ |
| | | public string UpdatePrintQtyCtl = ""; //æ¡ç æå°æ¬¡æ°æ´æ° |
| | | // |
| | | private void initGrid() |
| | | { |
| | |
| | | this.Text = ModCaption; |
| | | lblCaption.Text = ModCaption; |
| | | initGrid(); |
| | | Sub_GetSystemParameter(); |
| | | } |
| | | |
| | | //è·åç³»ç»åæ°ä¿¡æ¯ |
| | | private void Sub_GetSystemParameter() |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | ClsXt_SystemParameter oSystemParameter = new ClsXt_SystemParameter(); |
| | | if (oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo) == false) |
| | | { |
| | | MessageBox.Show("è·åç³»ç»åæ°å¤±è´¥ï¼åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | PrintQty = oSystemParameter.omodel.BarCode_PrintQty; |
| | | PrintQtyCtl = oSystemParameter.omodel.BarCode_PrintQtyCtl; |
| | | UpdatePrintQtyCtl = oSystemParameter.omodel.BarCode_UpdatePrintQtyCtl; |
| | | } |
| | | } |
| | | |
| | | private void grdMain_DblClick(object sender, EventArgs e) |
| | |
| | | #region //æå°è®¾ç½® |
| | | |
| | | GridppReport Report; |
| | | int CurRows = 0; |
| | | string sBarCodeItemID = ""; //æ¡ç èªå¢å |
| | | |
| | | //é¢è§ |
| | | int CurRows = 0; |
| | | private void yl_Click(object sender, EventArgs e) |
| | | { |
| | | //æå°é¢è§æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNamePrint, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | if (ReportPrintBegin()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | oFrm.sBillName = ModName; |
| | |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | //æå° |
| | | private void dy_Click(object sender, EventArgs e) |
| | | { |
| | | //æå°é¢è§æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNamePrint, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | 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.Print(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | private bool ReportPrintBegin() |
| | | { |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | string sHRemark = ""; |
| | | 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(); |
| | | } |
| | | sBarCodeItemID = sBarCodeItemID.Remove(0, 1); |
| | | |
| | | if (PrintQtyCtl=="Y") |
| | | { |
| | | if (oBar.Set_CheckPrintQty(sBarCodeItemID, PrintQty, ref sHRemark)) |
| | | { |
| | | MessageBox.Show(sHRemark); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd); |
| | | } |
| | | |
| | | //å¡«å
¥åæ®è¡¨å¤´ä¿¡æ¯ |
| | |
| | | } |
| | | //CurRows = CurRows + 1; |
| | | } |
| | | |
| | | //å¡«å
¥åæ®è¡¨ä½ä¿¡æ¯ |
| | | private void ReportFetchRecordByDataTable() |
| | | { |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | // |
| | | private void grdMain_Paint(object sender, PaintEventArgs e) |
| | | { |
| | | GraphicsGrid(); |
| | | } |
| | | |
| | | private void dy_Click(object sender, EventArgs e) |
| | | //æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | private void ReportPrintEnd() |
| | | { |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | string sBarCode = ""; |
| | | string sRelQty = ""; |
| | | for (int i = 0; i < grdMain.SelectedRows.Count; i++) |
| | | if (UpdatePrintQtyCtl == "Y") |
| | | { |
| | | sBarCode = sBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | oBar.Set_UpdatePrintQty(sBarCodeItemID); |
| | | } |
| | | //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 dy2_Click(object sender, EventArgs e) |
| | | { |
| | | //éæ©æå°æ¨¡æ¿ |
| | |
| | | i++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | // |
| | | private void grdMain_Paint(object sender, PaintEventArgs e) |
| | | { |
| | | GraphicsGrid(); |
| | | } |
| | | |
| | | private void yc_Click(object sender, EventArgs e) |
| | |
| | | private void zf_Click(object sender, EventArgs e) |
| | | { |
| | | //Sub_AbandonCheck(); |
| | | if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | private void fzf_Click(object sender, EventArgs e) |
| | | { |
| | | //this.Sub_CheckBill(); |
| | | if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |