| | |
| | | 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);
|
| | |
| | | else if (sType == "Sample")
|
| | | {
|
| | | sTMNumber = HNumber + ";" + DBUtility.ClsPub.isStrNull(txtHBatchNo.Text) + "B";
|
| | | txtHCheckerResult.Text = "";
|
| | | }
|
| | | else
|
| | | {
|
| | | sTMNumber = HNumber + ";" + DBUtility.ClsPub.isStrNull(txtHBatchNo.Text);
|
| | | txtHCheckerResult.Text = "";
|
| | | }
|
| | | //sTMNumber = HNumber + ";" + DBUtility.ClsPub.isStrNull(txtHBatchNo.Text);
|
| | |
|
| | |
| | | + ",'" + 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);
|
| | |
| | | Report.FieldByName("ç»å").AsString = ClsPub.isStrNull(txtHEmpID.Text) + ";" + ClsPub.isStrNull(txtHEmpID2.Text) + ";" + ClsPub.isStrNull(txtHEmpID3.Text);
|
| | | Report.FieldByName("æ°é").AsString = ClsPub.isStrNull(txtHSJQty.Text);
|
| | | Report.FieldByName("æ§ç©æç¼ç ").AsString = ClsPub.isStrNull(txtHOldMaterNumber.Text);
|
| | | Report.FieldByName("ä¸è¯åå ").AsString = ClsPub.isStrNull(txtHCheckerResult.Text);
|
| | | //Report.FieldByName("æºååå·").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HSourceBillNoCol].Value);
|
| | | //Report.FieldByName("éå®è®¢åå·").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HSeOrderBillNo2Col].Value);
|
| | | //Report.FieldByName("ç产车é´").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HDeptName2Col].Value);
|
| | |
| | | {
|
| | | 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 = "";
|
| | | txtHReasonList.Text = oGy_BadReasonList.txtHBadReason.Text;
|
| | | txtHCheckerResult.Text = "";
|
| | | txtHCheckerResult.Text = oGy_BadReasonList.txtHBadReason.Text;
|
| | | if (SaveBadReasonBill())
|
| | | {
|
| | | MessageBox.Show("ä¿åä¸è¯åå æåï¼");
|
| | |
| | | txtHReasonList.Text = "";
|
| | | return false;
|
| | | }
|
| | | catch(Exception e1)
|
| | | catch (Exception e1)
|
| | | {
|
| | | MessageBox.Show(e1.Message);
|
| | | return false;
|
| | |
| | | {
|
| | | txtHReasonList.Text = "";
|
| | | txtHReasonList.Text = oGy_BadReasonList.txtHBadReason.Text;
|
| | | txtHCheckerResult.Text = "";
|
| | | txtHCheckerResult.Text = oGy_BadReasonList.txtHBadReason.Text;
|
| | | oGy_BadReasonList = null;
|
| | | if (SaveBill("SaveDown"))
|
| | | {
|
| | |
| | | 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))
|
| | | {
|