| | |
| | | <<<<<<< HEAD
|
| | | using System;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.ComponentModel;
|
| | | using System.Data;
|
| | |
| | | oWeb.Url = SCM.ClsPub1.WEBSURL;
|
| | | //
|
| | | frmCondition = new frmBillQueryCondition_Base();
|
| | | this.Text = ModCaption; |
| | | this.Text = ModCaption;
|
| | | oSumGrid.ogrdMain = grdSub; //åå§å new
|
| | | oSumGrid.oGridsum = grdSum;
|
| | | initGrid();
|
| | |
| | | cmbFQMB.Items.Add(this.Text);
|
| | | cmbFQMB.SelectedIndex = 0;
|
| | |
|
| | | if(DBUtility.ClsPub.CurUserName.ToLower()=="admin")
|
| | | if (DBUtility.ClsPub.CurUserName.ToLower() == "admin")
|
| | | {
|
| | | txtHDQQty.ReadOnly = false;
|
| | | txtHKSQty.ReadOnly = false;
|
| | |
| | | //æ¶é´æ§ä»¶
|
| | | private void timer1_Tick(object sender, EventArgs e)
|
| | | {
|
| | | timer1.Enabled=false;
|
| | | timer1.Enabled = false;
|
| | | Sub_ClearBill();
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | timer2.Enabled = false;
|
| | | //
|
| | | if (ClsIni.ReadIni("COMINFO", "txtPortName", DBUtility.ClsPub.AppPath + @"/HXERP.ini").Contains("æ²¡ææ¾å°")==false)
|
| | | if (ClsIni.ReadIni("COMINFO", "txtPortName", DBUtility.ClsPub.AppPath + @"/HXERP.ini").Contains("æ²¡ææ¾å°") == false)
|
| | | {
|
| | | txtPortName.Text = ClsIni.ReadIni("COMINFO", "txtPortName", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | txtBaudRate.Text = ClsIni.ReadIni("COMINFO", "txtBaudRate", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | |
| | | txtHSYQty.Text = oTable.Rows[0]["æªçææ¡ç æ°é"].ToString();
|
| | | txtHKSQty.Text = lblHNowQty.Text;
|
| | | txtHDQQty.Text = lblHNowQty.Text;
|
| | | if (DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text)>0)
|
| | | if (DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text) > 0)
|
| | | {
|
| | | txtHSJQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text), 1);
|
| | | }
|
| | |
| | | DisplayMain();
|
| | | //DisplaySub();
|
| | | }
|
| | | catch(Exception e)
|
| | | catch (Exception e)
|
| | | {
|
| | | MessageBox.Show("读å失败ï¼" + e.Message);
|
| | | }
|
| | |
| | | string sSql = "";
|
| | | string sWhere = "";
|
| | | //è¿æ»¤æ¡ä»¶
|
| | | sSql = " exec h_p_Sc_ICMOReportToBarCode_All '" + HSourceBillTypeID + "'," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString(); |
| | | sSql = " exec h_p_Sc_ICMOReportToBarCode_All '" + HSourceBillTypeID + "'," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString();
|
| | | //
|
| | | DSet = oWeb.getDataSetBySQL(sSql, "h_p_Sc_ICMOReportToBarCode_All", ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | //çæé¦è¡æ é¢
|
| | |
| | | return;
|
| | | }
|
| | | //
|
| | | if (DSet.Tables[0].Rows.Count>0)
|
| | | if (DSet.Tables[0].Rows.Count > 0)
|
| | | {
|
| | | grdMain.DataSource = DSet.Tables[0].DefaultView;
|
| | | }
|
| | |
| | | ClsPub1.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
|
| | | /////////////////////////////
|
| | | txtHRelationQty.Text = DBUtility.ClsPub.isDoule(DSet.Tables[2].Rows[0]["å
³èæ°é"], 1);
|
| | | if(DBUtility.ClsPub.isDoule(txtHSumQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text)>=0)
|
| | | if (DBUtility.ClsPub.isDoule(txtHSumQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text) >= 0)
|
| | | {
|
| | | txtHSYQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHSumQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text), 1);
|
| | | }
|
| | |
| | | string sWhere = "";
|
| | | //è¿æ»¤æ¡ä»¶
|
| | | sSql = " exec h_p_Sc_ICMOReportToBarCode_Sub '" + HSourceBillTypeID + "'," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString();
|
| | | |
| | |
|
| | | //
|
| | | DSet = oWeb.getDataSetBySQL(sSql, "h_p_Sc_ICMOReportToBarCode_Sub", ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | //çæé¦è¡æ é¢
|
| | |
| | |
|
| | | //é¢è§
|
| | | int CurRows = 0;
|
| | | |
| | |
|
| | | |
| | | |
| | |
|
| | | |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | if (oDept.RefreshView(sWhere))
|
| | | {
|
| | | this.txtHDeptID.Text = oDept.oModel.HName;
|
| | | this.txtHDeptID.Tag = oDept.oModel.HItemID.ToString(); |
| | | this.txtHDeptID.Tag = oDept.oModel.HItemID.ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | this.txtHDeptID.Text = ""; |
| | | this.txtHDeptID.Text = "";
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | // cmdHSaveBill.Enabled = true;
|
| | | // return false;
|
| | | //}
|
| | | if (DBUtility.ClsPub.isLong(txtHEmpID.Tag) == 0 || DBUtility.ClsPub.isLong(txtHEmpID2.Tag) == 0 ) |
| | | if (DBUtility.ClsPub.isLong(txtHEmpID.Tag) == 0 || DBUtility.ClsPub.isLong(txtHEmpID2.Tag) == 0)
|
| | | {
|
| | | MessageBox.Show("èå1æè
èå2没æéæ©ï¼");
|
| | | cmdHSaveBill.Enabled = true;
|
| | | return false;
|
| | | }
|
| | | if (DBUtility.ClsPub.isLong(txtHGroupID.Tag) == 0 )
|
| | | if (DBUtility.ClsPub.isLong(txtHGroupID.Tag) == 0)
|
| | | {
|
| | | MessageBox.Show("çç»æ²¡æéæ©ï¼");
|
| | | cmdHSaveBill.Enabled = true;
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | |
|
| | | //æ ¹æ®æºå çææ¡å½¢ç å¹¶ä¿å妿°æ®åº
|
| | | HNumber = DBUtility.ClsPub.isStrNull(txtHMaterName.Tag);
|
| | |
| | | sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
|
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
|
| | | sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
|
| | | =======
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.ComponentModel;
|
| | | using System.Data;
|
| | | using System.Drawing;
|
| | | using System.Text;
|
| | | using System.Windows.Forms;
|
| | | using gregn6Lib;
|
| | | using Pub_Class;
|
| | | using System.Threading;
|
| | | using System.IO.Ports;
|
| | |
|
| | | namespace SCM
|
| | | {
|
| | | public partial class Sc_ICMOReportToBarCode : Form
|
| | | {
|
| | | public Sc_ICMOReportToBarCode()
|
| | | {
|
| | | InitializeComponent();
|
| | | }
|
| | |
|
| | | public frmBillQueryCondition_Base frmCondition;
|
| | | public string ModCaption = "æåååå¨çº¿æ£éª";
|
| | | public string ModName = "Sc_ICMOReportToBarCode";
|
| | | public string HSourceBillTypeID = ""; //åæ®ç±»å
|
| | | public string HSourceBillType = ""; //åæ®ç±»ååç§°
|
| | | public string HSourceBillNo = "";
|
| | | public Int64 HSourceInterID = 0;
|
| | | public Int64 HSourceEntryID = 0;
|
| | | public int HTMCol = 0;
|
| | | public int HMaterIDCol = 1;
|
| | | Pub_Class.ClsGridListSum oSumGrid = new Pub_Class.ClsGridListSum();
|
| | | public Int32 iTopRow = 0;//ç»æ¨ªçº¿
|
| | | SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
|
| | | //
|
| | |
|
| | | #region åºå®ä»£ç
|
| | |
|
| | | //æ¸
空çé¢
|
| | | public void Sub_ClearBill()
|
| | | {
|
| | | //æ¸
空ç颿§ä»¶ for æ§ä»¶ |
| | | foreach (Control ct in gbUp.Controls)
|
| | | {
|
| | | switch (ct.GetType().Name)
|
| | | {
|
| | | case "ComboBox":
|
| | | ((ComboBox)ct).SelectedIndex = 0;
|
| | | break;
|
| | | case "TextBox":
|
| | | ((TextBox)ct).Text = "";
|
| | | break;
|
| | | case "DateTimePicker":
|
| | | ((DateTimePicker)ct).Value = DateTime.Today;
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | | //
|
| | | txtHMaker.Text = ClsPub.CurUserName;
|
| | | initGrid();
|
| | | }
|
| | |
|
| | | private void Sc_ICMOReportToBarCode_Load(object sender, EventArgs e)
|
| | | {
|
| | | //è®¾ç½®å¨æURL
|
| | | oWeb.Url = SCM.ClsPub1.WEBSURL;
|
| | | //
|
| | | frmCondition = new frmBillQueryCondition_Base();
|
| | | this.Text = ModCaption; |
| | | oSumGrid.ogrdMain = grdSub; //åå§å new
|
| | | oSumGrid.oGridsum = grdSum;
|
| | | initGrid();
|
| | | //cmbHBillType.SelectedIndex = 0;
|
| | | //cmbHSourceBillType.SelectedIndex = 0;
|
| | | cmbFQMB.Items.Add(this.Text);
|
| | | cmbFQMB.SelectedIndex = 0;
|
| | |
|
| | | if(DBUtility.ClsPub.CurUserName.ToLower()=="admin")
|
| | | {
|
| | | txtHDQQty.ReadOnly = false;
|
| | | txtHKSQty.ReadOnly = false;
|
| | | }
|
| | | }
|
| | |
|
| | | //åå§åç½æ ¼
|
| | | private void initGrid()
|
| | | {
|
| | | ClsPub1.initGridList(grdMain, this.Name);
|
| | | ClsPub1.initGridList(grdSub, this.Name + "grdSub");
|
| | | ClsPub1.initGridFst(grdEmp, this.Name + "grdEmp");
|
| | | grdMain.RowTemplate.Height = 30;
|
| | | grdMain.RowTemplate.MinimumHeight = 30;
|
| | | grdMain.RowsDefaultCellStyle.Font = new Font("å®ä½", 15);
|
| | | grdMain.ReadOnly = true;
|
| | |
|
| | | grdSub.RowTemplate.Height = 30;
|
| | | grdSub.RowTemplate.MinimumHeight = 30;
|
| | | grdSub.RowsDefaultCellStyle.Font = new Font("å®ä½", 15);
|
| | | grdSub.ReadOnly = true;
|
| | |
|
| | | grdEmp.RowTemplate.Height = 30;
|
| | | grdEmp.RowTemplate.MinimumHeight = 30;
|
| | | grdEmp.RowsDefaultCellStyle.Font = new Font("å®ä½", 15);
|
| | | grdEmp.ReadOnly = false;
|
| | | //DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name);
|
| | | //DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name + "grdSub");
|
| | | DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name);
|
| | | DBUtility.Xt_BaseBillFun.GetGrid(grdSub, this.Name + "grdSub");
|
| | | DBUtility.Xt_BaseBillFun.GetGrid(grdEmp, this.Name + "grdEmp");
|
| | | }
|
| | |
|
| | | //æ¶é´æ§ä»¶
|
| | | private void timer1_Tick(object sender, EventArgs e)
|
| | | {
|
| | | timer1.Enabled=false;
|
| | | Sub_ClearBill();
|
| | | }
|
| | |
|
| | | private void timer2_Tick(object sender, EventArgs e)
|
| | | {
|
| | | timer2.Enabled = false;
|
| | | //
|
| | | if (ClsIni.ReadIni("COMINFO", "txtPortName", DBUtility.ClsPub.AppPath + @"/HXERP.ini").Contains("æ²¡ææ¾å°")==false)
|
| | | {
|
| | | txtPortName.Text = ClsIni.ReadIni("COMINFO", "txtPortName", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | txtBaudRate.Text = ClsIni.ReadIni("COMINFO", "txtBaudRate", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | cmbParity.Text = ClsIni.ReadIni("COMINFO", "cmbParity", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | txtDataBits.Text = ClsIni.ReadIni("COMINFO", "txtDataBits", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | cmbStopBits.Text = ClsIni.ReadIni("COMINFO", "cmbStopBits", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | txtHSend0.Text = ClsIni.ReadIni("COMINFO", "txtHSend0", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | txtHSend.Text = ClsIni.ReadIni("COMINFO", "txtHSend", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | txtHSourceID.Text = ClsIni.ReadIni("COMINFO", "txtHSourceID", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | txtHSourceID.Tag = ClsIni.ReadIni("COMINFO", "txtHSourceIDTag", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | this.Text = this.Text + "-" + txtHSourceID.Text;
|
| | | }
|
| | |
|
| | | //åå§å串å£
|
| | | ComDevice = new SerialPort();
|
| | | ComDevice.DataReceived += new SerialDataReceivedEventHandler(Com_DataReceived);//ç»å®äºä»¶
|
| | | string[] PortNames = SerialPort.GetPortNames();
|
| | | //æå¼ä¸²å£
|
| | | OpenCom();
|
| | | }
|
| | |
|
| | | //éåº
|
| | | private void tc_Click(object sender, EventArgs e)
|
| | | {
|
| | | this.Close();
|
| | | }
|
| | |
|
| | | private void grdMain_Paint(object sender, PaintEventArgs e)
|
| | | {
|
| | | GraphicsGrid();
|
| | | }
|
| | |
|
| | | private void GraphicsGrid()
|
| | | {
|
| | | //ç»åºçº¿
|
| | | DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain);
|
| | | //ç»æ¨ªçº¿
|
| | | DBUtility.Xt_BaseBillFun.GraphicsRowGrid(grdMain, iTopRow, iTopRow + 50, Fun_GetCol("hmainid"));
|
| | | }
|
| | |
|
| | | private Int32 Fun_GetCol(string sCol)
|
| | | {
|
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain);
|
| | | }
|
| | |
|
| | | //ä¿åå宽
|
| | | private void bclk_Click(object sender, EventArgs e)
|
| | | {
|
| | | DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
|
| | | DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name + "grdSub");
|
| | | DBUtility.Xt_BaseBillFun.SaveGrid(grdEmp, this.Name + "grdEmp");
|
| | | }
|
| | |
|
| | | //é»è®¤å宽
|
| | | private void mrlk_Click(object sender, EventArgs e)
|
| | | {
|
| | | DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
|
| | | DBUtility.Xt_BaseBillFun.DefaultGridView(grdSub, this.Name + "grdSub");
|
| | | DBUtility.Xt_BaseBillFun.DefaultGridView(grdEmp, this.Name + "grdEmp");
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | |
|
| | | #region è¿åæºåä¿¡æ¯
|
| | |
|
| | | private void xd_Click(object sender, EventArgs e)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | private void Display(string SourceBillType, Int64 HSourceBillInterID, Int64 HSourceBillEntryID)
|
| | | {
|
| | | DataSet Ds;
|
| | | //ç产订å
|
| | | if (SourceBillType == "ç产订å")
|
| | | {
|
| | | //å¾å°ä¿¡æ¯
|
| | | Ds = oWeb.getDataSetBySQL("select * from h_v_IFCLD_ICMOList where hmainid=" + HSourceBillInterID + " and hsubid=" + HSourceBillEntryID, "h_v_IFCLD_ICMOList", ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | //åå
¥ä¿¡æ¯
|
| | | Sub_WriteInForm(Ds.Tables[0], 0);
|
| | | }
|
| | | //æ¶æéç¥å
|
| | | if (SourceBillType == "æ¶æéç¥å")
|
| | | {
|
| | | //å¾å°ä¿¡æ¯
|
| | | Ds = oWeb.getDataSetBySQL("select * from h_v_IF_POInStockList where hmainid=" + HSourceBillInterID + " and hsubid=" + HSourceBillEntryID, "h_v_IF_POInStockList", ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | //åå
¥ä¿¡æ¯
|
| | | Sub_WriteInForm(Ds.Tables[0], 0);
|
| | | }
|
| | | //çäº§æ±æ¥å
|
| | | if (SourceBillType == "çäº§æ±æ¥å")
|
| | | {
|
| | | //å¾å°ä¿¡æ¯
|
| | | Ds = oWeb.getDataSetBySQL("select * from h_v_IF_ICMOReportBillList where hmainid=" + HSourceBillInterID + " and hsubid=" + HSourceBillEntryID, "h_v_IF_POInStockList", ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | //åå
¥ä¿¡æ¯
|
| | | Sub_WriteInForm(Ds.Tables[0], 0);
|
| | | }
|
| | | }
|
| | |
|
| | | //æ ¹æ®TABLEåå
¥çé¢
|
| | | private void Sub_WriteInForm(DataTable oTable, int i)
|
| | | {
|
| | | try
|
| | | {
|
| | | txtHSourceBillNo.Text = oTable.Rows[0]["åæ®å·"].ToString();
|
| | | txtHMaterNumber.Text = oTable.Rows[0]["ç©æä»£ç "].ToString();
|
| | | txtHOldMaterNumber.Text = oTable.Rows[0]["æ§ç©æç¼ç "].ToString();
|
| | | txtHMaterNumber.Tag = oTable.Rows[0]["HMaterID"].ToString();
|
| | | txtHMaterName.Text = oTable.Rows[0]["ç©æåç§°"].ToString();
|
| | | txtHMaterName.Tag = oTable.Rows[0]["HMaterID"].ToString();
|
| | | txtHMaterModel.Text = oTable.Rows[0]["è§æ ¼åå·"].ToString();
|
| | | txtHUnitName.Text = oTable.Rows[0]["计éåä½"].ToString();
|
| | | txtHUnitName.Tag = oTable.Rows[0]["HUnitID"].ToString();
|
| | | txtHBatchNo.Text = oTable.Rows[0]["æ¹æ¬¡"].ToString();
|
| | | txtHSumQty.Text = oTable.Rows[0]["æ°é"].ToString();
|
| | | txtHRelationQty.Text = oTable.Rows[0]["å·²çææ¡ç æ°é"].ToString();
|
| | | txtHSYQty.Text = oTable.Rows[0]["æªçææ¡ç æ°é"].ToString();
|
| | | txtHKSQty.Text = lblHNowQty.Text;
|
| | | txtHDQQty.Text = lblHNowQty.Text;
|
| | | if (DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text)>0)
|
| | | {
|
| | | txtHSJQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text), 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | txtHSJQty.Text = "0";
|
| | | }
|
| | | DisplayMain();
|
| | | //DisplaySub();
|
| | | }
|
| | | catch(Exception e)
|
| | | {
|
| | | MessageBox.Show("读å失败ï¼" + e.Message);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void DisplayMain()
|
| | | {
|
| | | DataSet DSet;
|
| | | string sSql = "";
|
| | | string sWhere = "";
|
| | | //è¿æ»¤æ¡ä»¶ |
| | | sSql = " exec h_p_Sc_ICMOReportToBarCode_All '" + HSourceBillTypeID + "'," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString(); |
| | | //
|
| | | DSet = oWeb.getDataSetBySQL(sSql, "h_p_Sc_ICMOReportToBarCode_All", ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | //çæé¦è¡æ é¢
|
| | | if (DSet == null)
|
| | | {
|
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,å°è¯å次æ¥è¯¢ï¼" + DBUtility.ClsPub.sExeReturnInfo);
|
| | | return;
|
| | | }
|
| | | //
|
| | | if (DSet.Tables[0].Rows.Count>0)
|
| | | {
|
| | | grdMain.DataSource = DSet.Tables[0].DefaultView;
|
| | | }
|
| | | //å»ç»
|
| | | int FrCol = DBUtility.ClsPub.isInt(0);
|
| | | string s = "æ¯";
|
| | | ClsPub1.DisplayGrid(grdMain, this.Name, s, FrCol);
|
| | | //ç»çº¿ |
| | | //Total();
|
| | | ///////////////////////////////////////////
|
| | | if (DSet.Tables[1].Rows.Count > 0)
|
| | | {
|
| | | grdSub.DataSource = DSet.Tables[1].DefaultView;
|
| | | }
|
| | | //å»ç» |
| | | ClsPub1.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
|
| | | /////////////////////////////
|
| | | txtHRelationQty.Text = DBUtility.ClsPub.isDoule(DSet.Tables[2].Rows[0]["å
³èæ°é"], 1);
|
| | | if(DBUtility.ClsPub.isDoule(txtHSumQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text)>=0)
|
| | | {
|
| | | txtHSYQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHSumQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text), 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | txtHSYQty.Text = "0";
|
| | | }
|
| | | //////////////////////////
|
| | | }
|
| | |
|
| | | private void DisplaySub()
|
| | | {
|
| | | DataSet DSet;
|
| | | string sSql = "";
|
| | | string sWhere = "";
|
| | | //è¿æ»¤æ¡ä»¶ |
| | | sSql = " exec h_p_Sc_ICMOReportToBarCode_Sub '" + HSourceBillTypeID + "'," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString();
|
| | | |
| | | //
|
| | | DSet = oWeb.getDataSetBySQL(sSql, "h_p_Sc_ICMOReportToBarCode_Sub", ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | //çæé¦è¡æ é¢
|
| | | if (DSet == null)
|
| | | {
|
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,å°è¯å次æ¥è¯¢ï¼" + DBUtility.ClsPub.sExeReturnInfo);
|
| | | return;
|
| | | }
|
| | | //
|
| | | grdSub.DataSource = DSet.Tables[0].DefaultView;
|
| | |
|
| | |
|
| | | //å»ç»
|
| | | int FrCol = DBUtility.ClsPub.isInt(0);
|
| | | string s = "æ¯";
|
| | | ClsPub1.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
|
| | | //ç»çº¿ |
| | | //Total();
|
| | | }
|
| | |
|
| | |
|
| | | #endregion
|
| | |
|
| | |
|
| | | #region //æå°è®¾ç½®
|
| | |
|
| | | GridppReport Report;
|
| | | string sBarCode = "";
|
| | |
|
| | | //é¢è§
|
| | | int CurRows = 0;
|
| | | |
| | |
|
| | | |
| | | |
| | |
|
| | | |
| | |
|
| | | #endregion
|
| | |
|
| | |
|
| | | #region ç颿§ä»¶å¤ç
|
| | |
|
| | | private void cmdHDeptID_Click(object sender, EventArgs e)
|
| | | {
|
| | | SCM.ClsIF_Department_View oDept = new SCM.ClsIF_Department_View();
|
| | | string sWhere = "";
|
| | | if (oDept.RefreshView(sWhere))
|
| | | {
|
| | | this.txtHDeptID.Text = oDept.oModel.HName;
|
| | | this.txtHDeptID.Tag = oDept.oModel.HItemID.ToString(); |
| | | }
|
| | | else
|
| | | {
|
| | | this.txtHDeptID.Text = ""; |
| | | }
|
| | | }
|
| | |
|
| | | private void txtHDeptID_TextChanged(object sender, EventArgs e)
|
| | | {
|
| | | BLL.ClsPub_BLL.Sub_ClearText(txtHDeptID);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | |
|
| | | //éæ©æºå
|
| | | private void cmdHSourceBillNo_Click(object sender, EventArgs e)
|
| | | {
|
| | | Gy_SourceBillList_Touch oGy_SourceBillList_Touch = new Gy_SourceBillList_Touch();
|
| | | oGy_SourceBillList_Touch.HSourceBillType = HSourceBillType;//ç±»ååç§°
|
| | | oGy_SourceBillList_Touch.ShowDialog();
|
| | | if (oGy_SourceBillList_Touch.OKTag == 1)
|
| | | {
|
| | | //æ ¹æ®éä¸çæºåå
ç ååå
ç ï¼è¿åç¸åºä¿¡æ¯
|
| | | HSourceEntryID = oGy_SourceBillList_Touch.HSelEntryID;
|
| | | HSourceInterID = oGy_SourceBillList_Touch.HSelInterID;
|
| | | HSourceBillTypeID = oGy_SourceBillList_Touch.HSourceBillTypeID;
|
| | | HSourceBillNo = oGy_SourceBillList_Touch.HSourceBillNo;
|
| | | Display(HSourceBillType, oGy_SourceBillList_Touch.HSelInterID, oGy_SourceBillList_Touch.HSelEntryID);
|
| | | }
|
| | | else
|
| | | {
|
| | | HSourceEntryID = 0;
|
| | | HSourceInterID = 0;
|
| | | HSourceBillTypeID = "";
|
| | | HSourceBillNo = "";
|
| | | }
|
| | | }
|
| | |
|
| | | //
|
| | | private void cmdCancel_Click(object sender, EventArgs e)
|
| | | {
|
| | | CloseCom();
|
| | | this.Close();
|
| | | }
|
| | |
|
| | | private void label19_Click(object sender, EventArgs e)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public bool SaveBill(string sType)
|
| | | {
|
| | | try
|
| | | {
|
| | | int LSHlen = 2; //æµæ°´å·é¿åº¦
|
| | | int SumLen = 10; //æ»é¿åº¦
|
| | | string TM = ""; //æ¡ç
|
| | | string HNumber = ""; //ç©æä»£ç
|
| | | double HSumQty = 0; //äº§åæ°é
|
| | | double HMinQty = 0; //æå°å
è£
æ°
|
| | | int HBQty = 0; //ç®±æ°
|
| | | double HQty = 0; //æ°é
|
| | | string WeiShu = ""; //å°¾æ°
|
| | | int LSH = 0; //æµæ°´å·
|
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符
|
| | | string sDate = ""; //æ¥æ
|
| | | string sYear = ""; //å¹´
|
| | | string sPeriod = ""; //æ
|
| | | string sDay = ""; //æ¥
|
| | | string HBatchNo = ""; //æ¹æ¬¡
|
| | | int k = 0;
|
| | | int n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | string sTMNumber = ""; //æ¡ç èªå®ä¹åç¼
|
| | | DataSet Ds;
|
| | | //
|
| | | string HWei = ""; //å°¾æ°
|
| | | HBarCode = "";
|
| | | string HBarCodeType = "";
|
| | | Int64 HMaterID = 0;
|
| | | Int64 HAuxPropID = 0;
|
| | | Int64 HUnitID = 0;
|
| | | double HQty2 = 0;
|
| | | string HBatchNo2 = "";
|
| | | Int64 HSupID = 0;
|
| | | Int64 HGroupID = 0;
|
| | | int HPrintQty = 0;
|
| | | Int64 HBarcodeNo = 0; //æå·
|
| | | Int64 HBarcodeQtys = 0; //æ»ææ°
|
| | | Int64 HDeptID = 0;
|
| | | Int64 HWhID = 0;
|
| | | Int64 HSPID = 0;
|
| | | string HRemark = "";
|
| | | string HMaterName = "";
|
| | | string HMaterModel = "";
|
| | | string HPinfan = "";
|
| | | string HMTONo = "";
|
| | | Int64 HCusID = 0;
|
| | | string HCusType = "";
|
| | | DateTime HEndDate;
|
| | | string HWorkLineName = "";
|
| | | DateTime HBeginDate;
|
| | | string HSeOrderBillNo = "";
|
| | | string HJiaYe2 = "";
|
| | | string HPressModel = "";
|
| | | string HCusModel = "";
|
| | | string HMaterialModel = "";
|
| | | string HColor = "";
|
| | | string HLogo = "";
|
| | | string HPackageSize = "";
|
| | | double HMaterialJQty = 0;
|
| | | double HMaterialMQty = 0;
|
| | | string HCustomBatchNo = "";
|
| | | string HGBBarCode = "";
|
| | | string POOrderBillNo = "";
|
| | | //
|
| | | cmdHSaveBill.Enabled = false;
|
| | | //夿æ¯å¦åå¨ æºåä¿¡æ¯ï¼
|
| | | if (HSourceInterID <= 0 || HSourceEntryID <= 0 || DBUtility.ClsPub.isLong(txtHMaterName.Tag) <= 0 || DBUtility.ClsPub.isLong(txtHUnitName.Tag) <= 0)//夿æ¯å¦ææºå
|
| | | {
|
| | | MessageBox.Show("没æéåï¼");
|
| | | cmdHSaveBill.Enabled = true;
|
| | | return false;
|
| | | }
|
| | | if (DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text) >= 0)
|
| | | {
|
| | | txtHSJQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text), 1); //å®é
ç±³æ°= å½åç±³æ°-å¼å§ç±³æ°
|
| | | lblHRelQty.Text = txtHSJQty.Text;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (MessageBox.Show("å½åç±³æ°å°äºå¼å§ç±³æ°ï¼æ¯å¦ç¡®å®è¦æ¸
é¶å¼å§ç±³æ°", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
|
| | | {
|
| | | txtHKSQty.Text = "0";
|
| | | txtHSJQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHDQQty.Text), 1); //å®é
ç±³æ°= å½åç±³æ°-å¼å§ç±³æ°
|
| | | lblHRelQty.Text = txtHSJQty.Text;
|
| | | }
|
| | | }
|
| | | if (DBUtility.ClsPub.isDoule(txtHSJQty.Text) <= 0)
|
| | | {
|
| | | MessageBox.Show("å½åæ°éä¸è½å°äºçäº0ï¼");
|
| | | cmdHSaveBill.Enabled = true;
|
| | | return false;
|
| | | }
|
| | | //if (DBUtility.ClsPub.isDoule(txtHSYQty.Text) <= 0)
|
| | | //{
|
| | | // MessageBox.Show("å©ä½æ°éå·²ç»ä¸º0ï¼ä¸è½å¨è£åï¼");
|
| | | // cmdHSaveBill.Enabled = true;
|
| | | // return false;
|
| | | //}
|
| | | if (DBUtility.ClsPub.isLong(txtHEmpID.Tag) == 0 || DBUtility.ClsPub.isLong(txtHEmpID2.Tag) == 0 ) |
| | | {
|
| | | MessageBox.Show("èå1æè
èå2没æéæ©ï¼");
|
| | | cmdHSaveBill.Enabled = true;
|
| | | return false;
|
| | | }
|
| | | if (DBUtility.ClsPub.isLong(txtHGroupID.Tag) == 0 )
|
| | | {
|
| | | MessageBox.Show("çç»æ²¡æéæ©ï¼");
|
| | | cmdHSaveBill.Enabled = true;
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | | //æ ¹æ®æºå çææ¡å½¢ç å¹¶ä¿å妿°æ®åº
|
| | | HNumber = DBUtility.ClsPub.isStrNull(txtHMaterName.Tag);
|
| | | HBatchNo = DBUtility.ClsPub.isStrNull(txtHBatchNo.Text);
|
| | | sDate = dtpHDate.Value.ToShortDateString();
|
| | | sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
|
| | | sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
|
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
|
| | | sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
|
| | | >>>>>>> parent of d95a654 (nothing)
|
| | | sDay = sDay.Substring(sDay.Length - 2, 2);
|
| | |
|
| | | //æ¡ç åç¼ = ç»ç»ä»£ç + ç©æå
ç + å¹´ + æ + æ¥
|
| | |
| | | + ",'" + HPressModel + "','" + HCusModel + "','" + HMaterialModel + "','" + HColor + "','" + sDate + "'"
|
| | | + ",'" + HLogo + "','" + HPackageSize + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString() + ",'" + HCustomBatchNo + "'"
|
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HBeginDate.ToShortDateString() + "','" + HSeOrderBillNo + "','" + HGBBarCode + "'"
|
| | | + ",'" + POOrderBillNo + "'" + "," + DBUtility.ClsPub.isLong(txtHSourceID.Tag) |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','"+ txtHReasonList.Text + "','"+ HRemark + "')";
|
| | | + ",'" + POOrderBillNo + "'" + "," + DBUtility.ClsPub.isLong(txtHSourceID.Tag)
|
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + txtHReasonList.Text + "','" + HRemark + "')";
|
| | | oWeb.getRunProc(sSQLMul, ref DBUtility.ClsPub.sExeReturnInfo);
|
| | |
|
| | | |
| | |
|
| | | //å·æ°çé¢
|
| | | DisplayMain();
|
| | | //DisplaySub();
|
| | |
| | | {
|
| | | Report.Print(false);
|
| | | }
|
| | | |
| | |
|
| | | Thread.Sleep(500);
|
| | |
|
| | | if (HSourceBillType != "çäº§æ±æ¥å")
|
| | |
| | | private void Sub_SetReport(string sOpenTmp)
|
| | | {
|
| | | //å¤æè¡æ°
|
| | | |
| | |
|
| | | Report = new GridppReport();
|
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here .
|
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
|
| | |
| | | {
|
| | | if (!ComDevice.IsOpen)
|
| | | {
|
| | | |
| | |
|
| | | try
|
| | | {
|
| | | ComDevice.PortName = txtPortName.Text;
|
| | |
| | | default:
|
| | | break;
|
| | | }
|
| | | |
| | |
|
| | | ComDevice.DataBits = int.Parse(txtDataBits.Text);
|
| | | switch (cmbStopBits.SelectedItem.ToString())
|
| | | {
|
| | |
| | | default:
|
| | | break;
|
| | | }
|
| | | |
| | | ComDevice.Open(); |
| | |
|
| | | ComDevice.Open();
|
| | | lblComStatus.Text = "串å£ç¶æï¼å¼å¯";
|
| | | timer3.Enabled = true;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | MessageBox.Show("æå¼ä¸²å£å¤±è´¥ï¼" + ex.Message, "é误", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| | | MessageBox.Show("æå¼ä¸²å£å¤±è´¥ï¼" + ex.Message, "é误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (!ComDevice.IsOpen)
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | try
|
| | | {
|
| | | ComDevice.Close(); |
| | | ComDevice.Close();
|
| | | lblComStatus.Text = "串å£ç¶æï¼å
³é";
|
| | | timer3.Enabled = false;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | MessageBox.Show(ex.Message, "é误", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| | | MessageBox.Show(ex.Message, "é误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | //è®¾å¤æ¸
é¶
|
| | | private void cmdHSetZero_Click(object sender, EventArgs e)
|
| | | {
|
| | | cmdHSetZero.Enabled=false;
|
| | | cmdHSetZero.Enabled = false;
|
| | | byte[] sendData = strToHexByte(txtHSend0.Text);
|
| | | SendData(sendData);
|
| | | txtHSJQty.Text = "0";
|
| | |
| | | }
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// <summary>
|
| | | /// åéæ°æ®
|
| | | /// </summary>
|
| | | /// <param name="sender"></param>
|
| | | /// <param name="data"></param>
|
| | | public bool SendData(byte[] data)
|
| | | { |
| | | {
|
| | | if (ComDevice.IsOpen)
|
| | | {
|
| | | try
|
| | |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | MessageBox.Show(ex.Message, "é误", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| | | MessageBox.Show(ex.Message, "é误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| | | }
|
| | | finally
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | MessageBox.Show("䏲壿ªæå¼", "é误", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| | | MessageBox.Show("䏲壿ªæå¼", "é误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | // {
|
| | | // newStr = strArr[4];
|
| | | // }
|
| | | |
| | |
|
| | | // }
|
| | | // if (string.IsNullOrEmpty(newStr))
|
| | | // {
|
| | |
| | | if (strArr[4] != "00")
|
| | | {
|
| | | char[] bw = strArr[4].ToCharArray();
|
| | | if(bw[0]=='0')
|
| | | if (bw[0] == '0')
|
| | | {
|
| | | newStr = bw[1].ToString();
|
| | | }
|
| | |
| | | {
|
| | | newStr = strArr[4];
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | if (string.IsNullOrEmpty(newStr))
|
| | | {
|
| | |
| | | {
|
| | | newStr += strArr[5];
|
| | | }
|
| | | if (strArr[6] != "00"&&newStr=="00")
|
| | | if (strArr[6] != "00" && newStr == "00")
|
| | | {
|
| | | //newStr = $"0.{strArr[6]}";
|
| | | newStr = "0." + strArr[6];
|
| | | }
|
| | | if(strArr[6]!="00"&&newStr!="00")
|
| | | if (strArr[6] != "00" && newStr != "00")
|
| | | {
|
| | | //newStr += $".{strArr[6]}";
|
| | | newStr = newStr + "." + strArr[6];
|
| | |
| | |
|
| | |
|
| | | //å°å½åæ° åç±³ 转å为 ç±³
|
| | | double NewQty = DBUtility.ClsPub.isDoule(newStr) ;
|
| | | double NewQty = DBUtility.ClsPub.isDoule(newStr);
|
| | | if (NewQty <= 0)
|
| | | {
|
| | | newStr = "0";
|
| | |
| | | lblHRelQty.Text = txtHSJQty.Text;
|
| | | }
|
| | | else
|
| | | { |
| | | {
|
| | | txtHSJQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHDQQty.Text), 1); //å®é
ç±³æ°= å½åç±³æ°-å¼å§ç±³æ°
|
| | | lblHRelQty.Text = txtHSJQty.Text; |
| | | lblHRelQty.Text = txtHSJQty.Text;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | //å é¤éä¸çè¡æ°
|
| | | private void btnFQSH_Click(object sender, EventArgs e)
|
| | | {
|
| | |
| | | if (lngBillKey == 0)
|
| | | return;
|
| | | try
|
| | | { |
| | | {
|
| | | oWeb.getRunProc("Delete from Gy_BarCodeBill where HItemID=" + lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | oWeb.getRunProc("insert into System_log values(GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.CurUserName + "','å 餿¡ç ï¼" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡å½¢ç ")].Value) + "' ,'WMSç³»ç»','','å é¤')", ref DBUtility.ClsPub.sExeReturnInfo);
|
| | | |
| | |
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | private void cmdHSaveInfo_Click(object sender, EventArgs e)
|
| | | { |
| | | {
|
| | | ClsIni.WriteIni("COMINFO", "txtPortName", DBUtility.ClsPub.isStrNull(txtPortName.Text), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | ClsIni.WriteIni("COMINFO", "txtBaudRate", DBUtility.ClsPub.isStrNull(txtBaudRate.Text), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | ClsIni.WriteIni("COMINFO", "cmbParity", DBUtility.ClsPub.isStrNull(cmbParity.Text), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | |
| | | ClsIni.WriteIni("COMINFO", "txtHSend0", DBUtility.ClsPub.isStrNull(txtHSend0.Text), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | ClsIni.WriteIni("COMINFO", "txtHSend", DBUtility.ClsPub.isStrNull(txtHSend.Text), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | ClsIni.WriteIni("COMINFO", "txtHSourceID", DBUtility.ClsPub.isStrNull(txtHSourceID.Text), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | ClsIni.WriteIni("COMINFO", "txtHSourceIDTag", DBUtility.ClsPub.isStrNull(txtHSourceID.Tag), DBUtility.ClsPub.AppPath + @"/HXERP.ini"); |
| | | ClsIni.WriteIni("COMINFO", "txtHSourceIDTag", DBUtility.ClsPub.isStrNull(txtHSourceID.Tag), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
|
| | | }
|
| | |
|
| | | private void btnBLHB_Click(object sender, EventArgs e)
|
| | |
| | | txtHReasonList.Text = "";
|
| | | return false;
|
| | | }
|
| | | catch(Exception e1)
|
| | | catch (Exception e1)
|
| | | {
|
| | | MessageBox.Show(e1.Message);
|
| | | return false;
|
| | |
| | | MessageBox.Show("ä¿åä¸è¯åå 失败ï¼" + DBUtility.ClsPub.sExeReturnInfo);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | private void cmdHGroupID_Click(object sender, EventArgs e)
|
| | | {
|
| | | SCM.ClsIF_Group_View oGroup= new SCM.ClsIF_Group_View();
|
| | | SCM.ClsIF_Group_View oGroup = new SCM.ClsIF_Group_View();
|
| | | string sWhere = "";
|
| | | if (oGroup.RefreshView(sWhere))
|
| | | {
|