| | |
| | | public string ERPMode = ""; //ERP模å¼ï¼WISEãCLOUDï¼ |
| | | public string CampanyName = ""; //客æ·å®å¶ååç§° |
| | | public string SourceQtyCtl = ""; //è¶
æºåæ°éæ§å¶ |
| | | //------------------------------------------------------------------------- |
| | | public long PrintQty = 0; //å
许æ¡ç æå°æ¬¡æ° |
| | | public string PrintQtyCtl = ""; //æ¡ç æå°æ¬¡æ°æ§å¶ |
| | | public string UpdatePrintQtyCtl = ""; //æ¡ç æå°æ¬¡æ°æ´æ° |
| | | //------------------------------------------------------------------------- |
| | | #region åºå®ä»£ç |
| | | |
| | | //æ¸
空çé¢ |
| | |
| | | ERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode; |
| | | CampanyName = oSystemParameter.omodel.WMS_CampanyName; |
| | | SourceQtyCtl = oSystemParameter.omodel.BarCode_SourceQtyCtl; |
| | | PrintQty = oSystemParameter.omodel.BarCode_PrintQty; |
| | | PrintQtyCtl = oSystemParameter.omodel.BarCode_PrintQtyCtl; |
| | | UpdatePrintQtyCtl = oSystemParameter.omodel.BarCode_UpdatePrintQtyCtl; |
| | | } |
| | | |
| | | cmbHWorksNumber.Items.Clear(); |
| | |
| | | #region //æå°è®¾ç½® |
| | | |
| | | GridppReport Report; |
| | | int CurRows = 0; |
| | | string sBarCodeItemID = ""; //æ¡ç èªå¢å |
| | | |
| | | //é¢è§ |
| | | int CurRows = 0; |
| | | private void yl_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | |
| | | } |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | //æå° |
| | | private void dy_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].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.Print(true); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | ////æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | //private bool ReportPrintBegin() |
| | | //{ |
| | | // string sRelQty = ""; |
| | | |
| | | // if (oBar.Set_BPrintQty(DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value), ref sRelQty)) |
| | | // { |
| | | // MessageBox.Show("æ¡ç å·²ç»æå°è¿ï¼ä¸å¯é夿å°ï¼"); |
| | | // return true; |
| | | // } |
| | | // else |
| | | // { |
| | | // return false; |
| | | // } |
| | | //} |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | private bool ReportPrintBegin() |
| | | { |
| | | string sRelQty = ""; |
| | | |
| | | if (oBar.Set_BPrintQty(DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value), ref sRelQty)) |
| | | string sHRemark = ""; |
| | | if (PrintQtyCtl == "Y") |
| | | { |
| | | MessageBox.Show("æ¡ç å·²ç»æå°è¿ï¼ä¸å¯é夿å°ï¼"); |
| | | return true; |
| | | if (oBar.Set_CheckPrintQty_SD(HInterID, PrintQty, ref sHRemark)) |
| | | { |
| | | MessageBox.Show(sHRemark); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | private void ReportPrintEnd() |
| | | { |
| | | try |
| | | { |
| | | oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show("æå°å¤±è´¥!æå°ç»æ ï¼" + e.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | for (int i = 0; i < grdList.Rows.Count; i++) |
| | | { |
| | | grdList.Rows[i].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); |
| | | Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd); |
| | | } |
| | | |
| | | |
| | | private void Sub_SetReportView(string sOpenTmp) |
| | | { |
| | | //å¤æè¡æ° |
| | | for (int i = 0; i < grdList.Rows.Count; i++) |
| | | { |
| | | grdList.Rows[i].Cells[0].Value = ""; |
| | | } |
| | | for (int i = 0; i < grdList.SelectedRows.Count; i++) |
| | | { |
| | | grdList.Rows[grdList.SelectedRows[i].Index].Cells[0].Value = "*"; |
| | | } |
| | | // |
| | | Report = new GridppReport(); |
| | |
| | | } |
| | | } |
| | | |
| | | private Int32 Fun_GetCol(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdList); |
| | | } |
| | | |
| | | //å¡«å
¥åæ®è¡¨ä½ä¿¡æ¯ |
| | | private void ReportFetchRecordByDataTable() |
| | | { |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | private void dy_Click(object sender, EventArgs e) |
| | | ////æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | //private void ReportPrintEnd() |
| | | //{ |
| | | // try |
| | | // { |
| | | // oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // MessageBox.Show("æå°å¤±è´¥!æå°ç»æ ï¼" + e.Message); |
| | | // } |
| | | //} |
| | | |
| | | //æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | private void ReportPrintEnd() |
| | | { |
| | | if (UpdatePrintQtyCtl == "Y") |
| | | { |
| | | oBar.Set_UpdatePrintQty_SD(HInterID); |
| | | } |
| | | } |
| | | |
| | | //è¯æå° |
| | | private void sdy_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value) == "") |
| | | { |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååæå°ï¼"); |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååé¢è§ï¼"); |
| | | return; |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | if (ReportPrintBegin()) |
| | | if (ReportPrintBegin_SDY()) |
| | | { |
| | | return; |
| | | } |
| | |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | //循ç¯éä¸è¡ |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(true); |
| | | Sub_SetReportView(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | private bool ReportPrintBegin_SDY() |
| | | { |
| | | string sHRemark = ""; |
| | | sBarCodeItemID = ""; |
| | | for (int i = 0; i < grdList.SelectedRows.Count; i++) |
| | | { |
| | | sBarCodeItemID = sBarCodeItemID + "," + DBUtility.ClsPub.isLong(grdList.Rows[grdList.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; |
| | | } |
| | | } |
| | | |
| | | private void Sub_SetReportView(string sOpenTmp) |
| | | { |
| | | //å¤æè¡æ° |
| | | for (int i = 0; i < grdList.Rows.Count; i++) |
| | | { |
| | | grdList.Rows[i].Cells[0].Value = ""; |
| | | } |
| | | for (int i = 0; i < grdList.SelectedRows.Count; i++) |
| | | { |
| | | grdList.Rows[grdList.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); |
| | | Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd_SDY); |
| | | } |
| | | |
| | | //æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | private void ReportPrintEnd_SDY() |
| | | { |
| | | if (UpdatePrintQtyCtl == "Y") |
| | | { |
| | | oBar.Set_UpdatePrintQty(sBarCodeItemID); |
| | | } |
| | | } |
| | | |
| | | private Int32 Fun_GetCol(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdList); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void sdy_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].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_SetReportView(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | //çæå¤ç®±ç |
| | | private void wxm_Click(object sender, EventArgs e) |