| | |
| | | //路径只读 |
| | | this.txtLj.ReadOnly = true; |
| | | this.txtPcm.ReadOnly = true; |
| | | |
| | | |
| | | SelectHProList(); |
| | | } |
| | | |
| | | private void btnLj_Click(object sender, EventArgs e) |
| | |
| | | { |
| | | try |
| | | { |
| | | string HProcID = this.cmbPro.SelectedValue.ToString(); |
| | | string sExeReturnInfo = ""; |
| | | string BillType = "7505"; |
| | | long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo); |
| | |
| | | staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID |
| | | from Sc_ProcessExchangeBillMain a with(nolock) |
| | | inner join Sc_ICMOBillStatus_Tmp staus with(nolock) on a.HInterID=staus.HSourceInterID |
| | | where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=186 ", "Sc_ProcessExchangeBillMain"); |
| | | where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID="+ HProcID, "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | ",getdate(),0,''," + HProcExchInterID + |
| | | "," + HProcExchEntryID + ",'" + HProcExchBillNo + "','',0,0" + |
| | | "," + dataTable.Rows[i]["CharacteristicID"].ToString() + ",'" + dataTable.Rows[i]["HQCStd"].ToString() + "','','"+ dataTable.Rows[i]["HQCStd"].ToString() + "','" + HLastResult + "'" + |
| | | ",'" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "',''" + ",0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "','','',0,'1',0,'"+ HLastResult + "'" + ") "); |
| | | ",'" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "',''" + ",0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "','','',0,'1',0,'"+ HLastResult + "'" + |
| | | ") "); |
| | | } |
| | | |
| | | //主表 |
| | |
| | | ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" + |
| | | ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" + |
| | | ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID" + |
| | | ") " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" + |
| | | "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" + |
| | | "," + HSourceID + "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HPlanQty + "," + HProcExchInterID + "," + HProcExchEntryID + |
| | | ",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'', " + HLastResults + |
| | | "," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + ",0,''" + |
| | | ") "); |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "',"+ HProcID + ") "); |
| | | |
| | | oCN.Commit(); |
| | | |
| | |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | //保存按钮灰掉 |
| | | this.btnSave.Enabled = true; |
| | | MessageBox.Show("保存失败!" + e.Message); |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | string HProcID = this.cmbPro.SelectedValue.ToString(); |
| | | string sExeReturnInfo = ""; |
| | | string BillType = "7520"; |
| | | long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo); |
| | |
| | | staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID |
| | | from Sc_ProcessExchangeBillMain a with(nolock) |
| | | inner join Sc_ICMOBillStatus_Tmp staus with(nolock) on a.HInterID=staus.HSourceInterID |
| | | where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=186 ", "Sc_ProcessExchangeBillMain"); |
| | | where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=" + HProcID, "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" + |
| | | ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" + |
| | | ") " + |
| | | ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID) " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" + |
| | | "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" + |
| | | "," + HSourceID + "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HPlanQty + "," + HProcExchInterID + "," + HProcExchEntryID + |
| | | ",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'', " + HLastResults + |
| | | "," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + ",0,''" + |
| | | ") "); |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "',"+ HProcID + ") "); |
| | | |
| | | oCN.Commit(); |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | string HProcID = this.cmbPro.SelectedValue.ToString(); |
| | | string sExeReturnInfo = ""; |
| | | string BillType = "7507"; |
| | | long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo); |
| | |
| | | staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID,staus.HProcID |
| | | from Sc_ProcessExchangeBillMain a with(nolock) |
| | | inner join Sc_ICMOBillStatus_Tmp staus with(nolock) on a.HInterID=staus.HSourceInterID |
| | | where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=186 ", "Sc_ProcessExchangeBillMain"); |
| | | where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=" + HProcID, "Sc_ProcessExchangeBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | string HProcExchBillNo = ds.Tables[0].Rows[0]["HProcExchBillNo"].ToString(); |
| | | string HQty = ds.Tables[0].Rows[0]["HQty"].ToString(); |
| | | string HMaterID = ds.Tables[0].Rows[0]["HMaterID"].ToString(); |
| | | string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString(); |
| | | HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString(); |
| | | string HQCSchemeID = dataTable.Rows[0]["HQCSchemeID"].ToString(); |
| | | int HLastResults = 1; |
| | | |
| | |
| | | ",HBarCode,HLBatchNo,HCusID,HSortBillNo,HContrctBatchNo" + |
| | | ",HProdAreaID,HProdTypeID,HProdStoveNo,HRecipeID,HDiameter1" + |
| | | ",HDiameter2,HRoutingInterID,HDrawingDireID,HPackTypeID" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty,HProcExchQty,HShiftsID,HErrTreatment" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty" + |
| | | ",HProcExchQty,HShiftsID,HErrTreatment" + |
| | | ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo" + |
| | | ") " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" + |
| | | "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" + |
| | |
| | | "," + HMaterID + "," + HProcID + "," + HSourceID + ",0,0,0,0,0,0,'" + HLastResults + "'" + |
| | | ",'','',0,'',''" + |
| | | ",0,0,'',0,0,0,0,'',0," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + "," + HPlanQty + "," + HQty + ",0,''" + |
| | | ") "); |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "') "); |
| | | |
| | | |
| | | oCN.Commit(); |
| | |
| | | { |
| | | try |
| | | { |
| | | DataSet ds = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillMain where HBillNo='" + HBillNo + "' ", "Sc_ProcessExchangeBillMain"); |
| | | string cmbPro = this.cmbPro.SelectedValue.ToString(); |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuerySub where 单据号='" + HBillNo + "' and HProcID='"+ cmbPro + "'", "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("查无数据!"); |
| | | ds = oCN.RunProcReturn("select * from h_v_QC_TakeSampleCheckBillList where 单据号='" + HBillNo + "' and HProcID='" + cmbPro + "'", "h_v_QC_TakeSampleCheckBillList"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("当前工序对应的单据,查无数据!"); |
| | | } |
| | | else |
| | | { |
| | | string HProjectNum = ds.Tables[0].Rows[0]["HProjectNum"].ToString(); |
| | | this.txtPcm.Text = HProjectNum.Split('-')[0]; |
| | | this.txtLzk.Text = ds.Tables[0].Rows[0]["工序流转卡号"].ToString(); |
| | | this.HTakeSampleCheckBillID.Text = ds.Tables[0].Rows[0]["hmainid"].ToString(); |
| | | this.HTakeSampleCheckBillNo.Text = ds.Tables[0].Rows[0]["单据号"].ToString(); |
| | | this.txtLzk.ReadOnly = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | string HProjectNum = ds.Tables[0].Rows[0]["HProjectNum"].ToString(); |
| | | this.txtPcm.Text = HProjectNum.Split('-')[0]; |
| | | this.HTakeSampleCheckBillID.Text = "0"; |
| | | this.HTakeSampleCheckBillNo.Text = ""; |
| | | this.txtLzk.ReadOnly = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //查询工序 |
| | | public void SelectHProList() |
| | | { |
| | | try |
| | | { |
| | | DataSet ds = oCN.RunProcReturn("select * from Gy_Process ", "Sc_ProcessExchangeBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("工序查无数据!"); |
| | | } |
| | | else |
| | | { |
| | | this.cmbPro.DataSource = ds.Tables[0]; |
| | | this.cmbPro.DisplayMember = "HName"; |
| | | this.cmbPro.ValueMember = "HItemID"; |
| | | this.cmbPro.SelectedIndex = 0; |
| | | this.cmbPro.DropDownStyle = ComboBoxStyle.DropDownList; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show(this, e.Message, "提示"); |
| | | } |
| | | } |
| | | |
| | | private void ReadCoordinateExcelFrom_Activated(object sender, EventArgs e) |
| | | { |
| | | //光标选中流转卡 |