using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CoreFS.CA06;
using Core.StlMes.Client.ZGMil.Entity;
using System.Collections;
using Core.Mes.Client.Comm.Server;
using Core.Mes.Client.Comm.Tool;
using Core.Mes.Client.Comm.Control;
using Infragistics.Win.UltraWinGrid;
using Core.Mes.Client.Comm.Format;
using Infragistics.Win.UltraWinEditors;
using Infragistics.Win;
using Core.StlMes.Client.ZGMil.NodeResultQuery;
using Core.StlMes.Client.ZGMil.ResultConrtrol;
using Core.StlMes.Client.ZGMil.Common;
namespace Core.StlMes.Client.ZGMil.Signature
{
public partial class FrmInOnlineStore : FrmBase
{
private string[] plineCodes = { };
public FrmInOnlineStore()
{
InitializeComponent();
}
string Group = "";
private string Departm = "";//部门
private string PlineCode = "";//产线
private string _UserName = ""; //签名 姓名
private string _UserID = ""; //签名 签名ID
private string proPlanId = "";//轧管订单编号
private string gxPlanNo = "";//工序排产序号
///
/// 重写基类方法
///
///
///
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "DoQuery":
QuerySinglePlan();
break;
case"DoQueryMat":
QueryMat();
break;
case"DoQueryMatB":
QueryMatButess();
break;
case"DoQueryInList":
DoQueryInList();
break;
case"cancelInList":
cancelInList();
break;
case "DoSave":
DoSave();
break;
case "DoSaveShort":
DoSaveShort();
break;
case "DoDecision":
DoDecision();
break;
case "cancelDoDecision":
cancelDoDecision();
break;
case "DoBeside":
doBeside();
break;
case "cancelDoBeside":
cancelDoBeside();
break;
case"Print":
printPipe();
break;
case"OfflineXX":
OfflineXX();
break;
case "insertProssWt":
insertProssWt();
break;
case"adjustWgt":
adjustWgt();
break;
case "QuXiang":
QuXiang();
break;
case "Export":
ExportData();
break;
case "Close":
this.Close();
break;
}
}
///
/// 短尺交库
///
private void DoSaveShort()
{
FrmShortRuler QADefect = new FrmShortRuler("", this.ob);
QADefect.ShowDialog();
if (QADefect.DialogResult == DialogResult.OK)
{
ArrayList shortList = QADefect.shortList;
int acount = QADefect.acount;
DoSave(shortList, acount);
}
}
///
/// 短尺交库
///
///
private void DoSave(ArrayList shortList,int acountNum)
{
string strInbound = "800701";//入库类型
string strInMemo = "";
string surplusFlag = "";//是否余材标识
string sampleFlag = "";//是否减取样长度标识
int k = 0;
int b = 0;
this.ultraGrid3.UpdateData();
this.ultraGrid2.UpdateData();
DataTable dte = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortMilState", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
int acount = int.Parse(dte.Rows[0]["acount"].ToString2());
int acount2 = int.Parse(dte.Rows[0]["acount2"].ToString2());
if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" && acount > 0 && acount2 <= 0)
{
MessageUtil.ShowTips("有样管未交库,请先交样管!");
return;
}
if (!textMemo.Text.Trim().ToString().Equals(""))
{
if (!StringUtil.IsNumber(textMemo.Text.Trim().ToString()))
{
MessageUtil.ShowTips("请输入正确的短尺长度!");
return;
}
}
DataTable dtMemo = PipeManageClass.getComTypeInfo(strInbound, ob);
if (dtMemo.Rows.Count >= 1)
{
strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
}
NativeMethodNew na = new NativeMethodNew(this.ob);
string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
ArrayList list = new ArrayList();
DataTable ds = null;
ds = getStoreNo(plinCode); //取对应产线产出库
if (ds == null)
{
MessageUtil.ShowTips("无轧管在线库基础信息,请维护!");
return;
}
string storageNo = ds.Rows[0]["STORAGE_NO"].ToString();
//选择250中间库,168中间库则去中间库;
if (this.cmbStorage.Value.ToString2().Equals("BZJ1") || this.cmbStorage.Value.ToString2().Equals("BZJ2"))
{
storageNo = this.cmbStorage.Value.ToString2();
}
DataTable dtDept = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryDept", new object[] { plinCode }, ob);
string Deptid = dtDept.Rows[0]["DEPARTMENT_CODE"].ToString();
string Department = dtDept.Rows[0]["DEPARTMENT_DESC"].ToString();
list.Add(storageNo);
list.Add(storageNo + "10101");
list.Add(ds.Rows[0]["STORAGE_TYPE_NO"].ToString());
list.Add(ds.Rows[0]["STORAGE_TYPE_NAME"].ToString());
list.Add(this.UserInfo.GetUserName());
list.Add(Deptid);
list.Add(Department);
list.Add(Deptid);
list.Add(Department);
list.Add(this.UserInfo.GetUserOrder());
list.Add(this.UserInfo.GetUserGroup());
ArrayList parm = new ArrayList();
if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.Trim() == "待处理")
{
MessageUtil.ShowTips("待处理品不允许进行入库!");
return;
}
if (this.cmbStorage.Value.ToString2() == "")
{
MessageUtil.ShowTips("请选择去向,再进行交库!");
return;
}
MilPlanEntity3 mi = (MilPlanEntity3)this.ultraGrid3.ActiveRow.ListObject;
mi.PlineCode = plinCode;
if (plinCode == "C009")
{
mi.PlineName = "258机组";
}
else if (plinCode == "C008")
{
mi.PlineName = "250机组";
}
else if (plinCode == "C010")
{
mi.PlineName = "168机组";
}
else if (plinCode == "C017")
{
mi.PlineName = "460机组";
}
else if (plinCode == "C072")
{
mi.PlineName = "天淮508机组";
}
if (mi.MaterialDesc.Equals(""))
{
mi.MaterialDesc = this.ultraGrid1.ActiveRow.Cells["OUTWL_DESC"].Text.ToString();
}
string milPlanTity = JSONFormat.Format(mi);
int s = 0;
int m = 0;
int n = 0;
int z = 0;
int y = 0;
int p = 0;
int num = 0;
int x = 0;
int totalNum = 0;
foreach (UltraGridRow uRow in ultraGrid2.Rows)
{
if (uRow.Cells["BATCH_NO"].Text == "")
{
s = s + 1;
}
}
if (s > 0)
{
MessageUtil.ShowTips("未进行分批,不允许交库!");
return;
}
foreach (UltraGridRow row1 in ultraGrid2.Rows)
{
if (Convert.ToBoolean(row1.Cells["CHK"].Value) == true)
{
if (row1.Cells["ACT_LEN"].Value.ToString2() != "")
{
if (double.Parse(row1.Cells["ACT_LEN"].Value.ToString2()) > 0)
{
}
else
{
m = m + 1;
}
}
else
{
m = m + 1;
}
if (row1.Cells["ACT_COUNT"].Value.ToString2() != "")
{
if (int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2()) > 0)
{
}
else
{
n = n + 1;
}
}
else
{
n = n + 1;
}
if (row1.Cells["ACT_WEIGHT"].Value.ToString2() != "")
{
if (double.Parse(row1.Cells["ACT_WEIGHT"].Value.ToString2()) > 0)
{
}
else
{
z = z + 1;
}
}
else
{
z = z + 1;
}
if (row1.Cells["BATCH_NO"].Value.ToString2() == "")
{
y = y + 1;
}
if (row1.Cells["THACT_COUNT"].Text.ToString3() != "")
{
if (int.Parse(row1.Cells["ACT_COUNT"].Text.ToString3()) + int.Parse(row1.Cells["INSTORECOUNT"].Text.ToString3()) > int.Parse(row1.Cells["THACT_COUNT"].Text.ToString3()))
{
x = x + 1;
}
}
ArrayList parm1 = new ArrayList();
parm1.Add(row1.Cells["ACT_LEN"].Value.ToString2());
parm1.Add(row1.Cells["ACT_COUNT"].Value.ToString2());
parm1.Add(row1.Cells["ACT_WEIGHT"].Value.ToString2());
parm1.Add(row1.Cells["BATCH_NO"].Value.ToString2());
if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" || this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "样管")
{
parm1.Add("40740401");//探伤结果
parm1.Add("40740601");//表检结果
}
else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "判废")
{
parm1.Add("");//探伤结果
parm1.Add("");//表检结果
}
parm1.Add(row1.Cells["THACT_COUNT"].Value.ToString3());
parm.Add(parm1);
totalNum = totalNum + int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2());
num++;
}
}
IQueryable checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
int offlinePro = checkMagRows.GroupBy(a => a.GetValue("BATCH_NO")).Count();
if (checkMagRows.Count() > 1)
{
if (offlinePro == 1)
{
MessageUtil.ShowTips("批号一样,长度不一样请分开交库!");
return;
}
}
if (num <= 0)
{
MessageUtil.ShowTips("请勾选产出信息!");
return;
}
if (m > 0)
{
MessageUtil.ShowTips("长度不能为空,必须大于零!");
return;
}
if (n > 0)
{
MessageUtil.ShowTips("支数不能为空,必须大于零!");
return;
}
if (!acountNum.Equals(int.Parse(this.ultraGrid2.ActiveRow.Cells["ACT_COUNT"].Text.ToString3())))
{
MessageUtil.ShowTips("请确认短尺交库的支数!");
return;
}
if (z > 0)
{
MessageUtil.ShowTips("重量不能为空,必须大于零!");
return;
}
if (y > 0)
{
MessageUtil.ShowTips("批号不能为空,请选择!");
return;
}
if (x > 0)
{
MessageUtil.ShowTips("输入的实际支数加已在线库支数不能大于理论支数!");
return;
}
if (this.surplusChk.Checked)
{
surplusFlag = "1";
}
else
{
surplusFlag = "0";
}
if (this.sampleLen.Checked)
{
sampleFlag = "1";
}
else
{
sampleFlag = "0";
}
if (mi.Target.ToString().Equals("A") && surplusFlag == "1")
{
MessageUtil.ShowTips("A字头不允许进行无合同交库!");
return;
}
string contractNo = this.ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text.Trim();
string target = "";
string pckFlag = "";//打捆标志
string matRturnFlag = "";//交货材料要求标志
string testType = "";//双探类别
string testGrade = "";//等级
DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlan", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
target = dd.Rows[0]["TARGET"].ToString();
if (target.Equals("A"))
{
DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryOrderAsk", new object[] { contractNo }, ob);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
if (dt.Rows[i]["ASK_SUB_ITME_VAL_DESC"].ToString().Contains("打捆"))
{
k = k + 1;
}
else if (dt.Rows[i]["ASK_ITME"].ToString().Equals("121009"))
{
b = b + 1;
}
}
}
if (k > 0 && b > 0)
{
if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆、交货材料是否满足要求?") == DialogResult.No)
{
return;
}
pckFlag = "1";
matRturnFlag = "1";
}
else if (k > 0 && b < 1)
{
if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆是否满足要求?") == DialogResult.No)
{
return;
}
pckFlag = "1";
matRturnFlag = "0";
}
else if (b > 0 && k < 1)
{
if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求交货材料是否满足要求?") == DialogResult.No)
{
return;
}
pckFlag = "0";
matRturnFlag = "1";
}
else
{
pckFlag = "0";
matRturnFlag = "0";
}
if (doQueryPk(this.ultraGrid8.ActiveRow.Cells["ORD_LN_DLY_PK"].Value.ToString()))
{
DataTable dtest = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryEntrustT", new object[] { BaseMethod.getJudgeStoveNo(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text), proPlanId, gxPlanNo }, ob);
if (dtest.Rows.Count > 0)
{
testType = "UT";
testGrade = dtest.Rows[0][0].ToString();
}
else
{
MessageUtil.ShowTips("此炉是需要进行双探的管子,需走离线委外加工!");
return;
}
}
}
DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
string portCount = portDt.Rows[0][0].ToString3();//理论支数
DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
string matCount = matDt.Rows[0][0].ToString3();//已交库支
DataTable instoreDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
string pipeLXCount = instoreDt.Rows[0][0].ToString3(); //交库点离线支
if (totalNum + int.Parse(matCount) + int.Parse(pipeLXCount) > int.Parse(portCount))
{
MessageUtil.ShowTips("总交库支数已大于产出支数,请核对支数再交库!");
return;
}
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "doPipeIn";
ccp.ServerParams = new object[] { milPlanTity, list, parm, strInbound, strInMemo, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim(), surplusFlag, sampleFlag, pckFlag, matRturnFlag, testType, testGrade, shortList };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("交库成功!"))
{
QuerySinglePlan();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 调整库去向
///
private void QuXiang()
{
UltraGridRow uRow = this.ultraGrid8.ActiveRow;
if (uRow == null) return;
string jugeNo = BaseMethod.getJudgeStoveNo(uRow.Cells["JUDGE_STOVE_NO"].Text.ToString());
string lotno = uRow.Cells["LOT_NO"].Text.Trim();
if (this.cmbStorage.Value.ToString2() == "")
{
MessageUtil.ShowTips("请选择去向,再进行调整库去向!");
return;
}
if (MessageUtil.ShowYesNoAndQuestion("是否确认调整库去向?") == DialogResult.No)
{
return;
}
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "updateQuXiang";
ccp.ServerParams = new object[] { jugeNo, lotno, PlineCode, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim() };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("调整成功!"))
{
QuerySinglePlan();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 下线点离线
///
private void OfflineXX()
{
UltraGridRow uRow = this.ultraGrid8.ActiveRow;
if (uRow == null) return;
string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.Trim();
string lotno = uRow.Cells["LOT_NO"].Text.Trim();
string nodeStaus = uRow.Cells["NODE_STATUS"].Text.Trim();
if(nodeStaus == "入库完成")
{
MessageUtil.ShowTips("入库完成了的炉信息不允许离线!");
return;
}
DataTable dtFlag = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmStraighteningResult.GetSingleJRLResult", new object[] { jugeNo, proPlanId, gxPlanNo }, this.ob);
if (dtFlag.Rows.Count > 0)
{
if (string.IsNullOrEmpty(dtFlag.Rows[0]["NODE_FUR_FLAG"].ToString()))
{
MessageBox.Show("未开始分切,不允许下线", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryJugeCount", new object[] { jugeNo }, ob);
DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmOffLine.doQueryOfflineEdCount", new object[] { jugeNo }, ob);
//工序状态:01-矫直1#,02-矫直2#,03-矫直3#,11-ET探伤,12-MT探伤,13-UT探伤
string Node = "XX";
//beforeQualifiedNum = this.rollingCard1.Value.SawQualifiedNum;
string qualifiedNum = ds.Rows[0][0].ToString();
string offineHas = dd.Rows[0][0].ToString();
//offineHead = string.IsNullOrEmpty(this.rollingCard1.Value.BacklineStraight) ? "0" : this.rollingCard1.Value.BacklineStraight;
string numb = (int.Parse(qualifiedNum) - int.Parse(offineHas)).ToString();
FrmXiaXianOffLine frm = new FrmXiaXianOffLine(Node, this.ob, PlineCode, jugeNo, lotno, numb, proPlanId, gxPlanNo);
frm.ShowDialog();
QuerySinglePlan();
}
///
/// 根据外径、壁厚调整重量
///
private void adjustWgt()
{
string dimer = this.txt_dimer.Text.Trim();
string height = this.txt_height.Text.Trim();
if (!StringUtil.IsDouble(dimer))
{
MessageUtil.ShowTips("外径应该为数字");
return;
}
if (!StringUtil.IsDouble(height))
{
MessageUtil.ShowTips("壁厚应该为数字");
return;
}
UltraGridRow uRow = this.ultraGrid8.ActiveRow;
if(uRow == null)
{
MessageUtil.ShowTips("炉计划为空,不能调整重量!");
return;
}
string jugeNo = uRow.Cells["JUDGE_NO"].Text;
string wgt = (0.02466 * Math.Abs((double.Parse(dimer) - double.Parse(height))) * double.Parse(height)/1000).ToString2();
if (MessageUtil.ShowYesNoAndQuestion("是否确认调整理论重量?") == DialogResult.No)
{
return;
}
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "adjustWgt";
ccp.ServerParams = new object[] { jugeNo, wgt };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("调整成功!"))
{
QuerySinglePlan();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 回报过磅重量
///
private void insertProssWt()
{
this.ultraGrid6.UpdateData();
UltraGridRow uRow = this.ultraGrid6.ActiveRow;
//string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
string departMentid = UserInfo.GetDeptid();
if (uRow == null)
{
MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
return;
}
if(uRow.Cells["ProductFlag"].Value.ToString() != "801402")
{
MessageUtil.ShowTips("只允许成品类回报过磅重量!");
return;
}
if (Double.Parse(uRow.Cells["PonderGrossWt"].Value.ToString3()) <= 0)
{
MessageUtil.ShowTips("请输入正确的过磅重量!");
return;
}
ArrayList list = new ArrayList();
list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
list.Add(uRow.Cells["PonderGrossWt"].Value.ToString3());
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "insertProssWt";
ccp.ServerParams = new object[] { list, departMentid };
ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("回报成功!"))
{
QueryMat();
MatZcMEntity2bindingSource.Clear();
MatZcMEntity2bindingSource.Clear();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 打印入库单
///
private void printPipe()
{
this.ultraGrid7.UpdateData();
string jugeAppleCode = "";
IQueryable checkRows = this.ultraGrid7.Rows.AsQueryable().Where(a=>a.GetValue("CHK") == "True");
if(checkRows.Count() == 0)
{
MessageUtil.ShowTips("请选择需要打印的判定数据信息!");
return;
}
foreach (UltraGridRow uRow in checkRows)
{
jugeAppleCode = uRow.Cells["JugdeApplyCode"].Value.ToString();
}
if (jugeAppleCode == "")
{
MessageUtil.ShowTips("未申请判定,不允许打印缴库单!");
return;
}
int jugeAppleM = checkRows.GroupBy(a => a.GetValue("JugdeApplyCode")).Count();
if (jugeAppleM > 1)
{
MessageUtil.ShowTips("只有同一申请单号的信息才允许同时打印!");
return;
}
string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilGodownEntryYM.cpt&format=pdf&JUGDE_APPLY_CODE=" + jugeAppleCode;
FrmExcel fre = new FrmExcel(this.ob, strurl);
fre.AutoSize = true;
fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
fre.WindowState = FormWindowState.Maximized;
fre.Show();
}
///
/// 结炉回退
///
private void cancelDoBeside()
{
this.ultraGrid1.UpdateData();
UltraGridRow uRow = this.ultraGrid1.ActiveRow;
if (uRow.Index < 0 || uRow == null)
{
MessageUtil.ShowTips("请选择需要结炉回退的主信息!");
return;
}
string jugeNo = uRow.Cells["JUDGE_NO"].Text.Trim();
string lotNo = uRow.Cells["LOT_NO"].Text.Trim();
//string planId = uRow.Cells["ID"].Text.Trim();
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryFApply", new object[] { jugeNo }, ob);//查询炉号是否有已申请判定的
if (int.Parse(ds.Rows[0][0].ToString()) > 0)
{
MessageUtil.ShowTips("该炉已申请判定,不允许进行结炉回退!");
return;
}
DataTable ds1 = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryFQY", new object[] { jugeNo }, ob);//查询炉号是否有已申请判定的
if (int.Parse(ds1.Rows[0][0].ToString()) > 0)
{
MessageUtil.ShowTips("该炉有复取样废管,不允许进行结炉回退!");
return;
}
if (MessageUtil.ShowYesNoAndQuestion("是否确认结炉回退?") == DialogResult.No)
{
return;
}
//int count = ServerHelper.SetData("com.steering.mes.signature.FrmInOnlineStore.cancelDoBeside", new object[] { jugeNo,lotNo,PlineCode, proPlanId, gxPlanNo }, ob);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "cancelDoBeside";
ccp.ServerParams = new object[] { jugeNo, lotNo, PlineCode, proPlanId, gxPlanNo };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("结炉回退成功!"))
{
QuerySinglePlan();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
//if (count > 0)
//{
// QuerySinglePlan();
// MessageUtil.ShowTips("回退成功!");
//}
}
///
/// 交库结炉(验证进程表数据与入库数据一致性(合格))
///
private void doBeside()
{
this.ultraGrid8.UpdateData();
UltraGridRow uRow = this.ultraGrid8.ActiveRow;
if (uRow.Index < 0 || uRow == null)
{
MessageUtil.ShowTips("请选择需要结炉的主信息!");
return;
}
NativeMethodNew na = new NativeMethodNew(this.ob);
string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.Trim();
string lotNo = uRow.Cells["LOT_NO"].Text.Trim();
if (MessageUtil.ShowYesNoAndQuestion("是否确认结炉?") == DialogResult.No)
{
return;
}
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "doBeside";
ccp.ServerParams = new object[] { jugeNo, lotNo, plinCode, _UserID, proPlanId, gxPlanNo };
ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("结炉成功!"))
{
QuerySinglePlan();
MilPlanEntity3bindingSource.Clear();
this.dataTable2.Clear();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 查询仓库信息
///
///
///
private DataTable getStoreNo(string plineCode)
{
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryStoreNo", new object[] { plineCode }, ob);
if (ds.Rows.Count > 0)
{
return ds;
}
else
{
return null;
}
}
///
/// 交库
///
private void DoSave()
{
string storeNo = "";
string location = "";
string storagetype = "";
string storagetypedesc = "";
string strInbound = "800701";//入库类型
string strInMemo = "";
string strGroupNo = "";//组号
string surplusFlag = "";//是否余材标识
string sampleFlag = "";//是否减取样长度标识
int k = 0;
int b = 0;
this.ultraGrid3.UpdateData();
DataTable dte = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortMilState", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
int acount = int.Parse(dte.Rows[0]["acount"].ToString2());
int acount2 = int.Parse(dte.Rows[0]["acount2"].ToString2());
if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" && acount > 0 && acount2 <= 0)
{
//if (MessageUtil.ShowYesNoAndQuestion("有样管未交库,是否确认继续非样管交库?") == DialogResult.No)
//{
// return;
//}
MessageUtil.ShowTips("有样管未交库,请先交样管!");
return;
}
if (!textMemo.Text.Trim().ToString().Equals(""))
{
if (!StringUtil.IsNumber(textMemo.Text.Trim().ToString()))
{
MessageUtil.ShowTips("请输入正确的短尺长度!");
return;
}
}
DataTable dtMemo = PipeManageClass.getComTypeInfo(strInbound, ob);
if (dtMemo.Rows.Count >= 1)
{
strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
}
NativeMethodNew na = new NativeMethodNew(this.ob);
//string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
ArrayList list = new ArrayList();
DataTable ds = null;
//选择250中间库,168中间库则去中间库;其它则是产出库
//if (this.ultraGrid8.ActiveRow.Cells["BACK_PLAN_FLAG"].Text.Equals("10")) //交库返线,取位置备份表仓库信息
//{
// ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryStoreNo", new object[] { plinCode, this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text }, ob);
//}
//else
//{
// ds = getStoreNo(plinCode); //取对应产线产出库
//}
ds = getStoreNo(plinCode); //取对应产线产出库
if (ds == null)
{
MessageUtil.ShowTips("无轧管在线库基础信息,请维护!");
return;
}
string storageNo = ds.Rows[0]["STORAGE_NO"].ToString();
//选择250中间库,168中间库则去中间库;
if (this.cmbStorage.Value.ToString2().Equals("BZJ1") || this.cmbStorage.Value.ToString2().Equals("BZJ2"))
{
storageNo = this.cmbStorage.Value.ToString2();
}
DataTable dtDept = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryDept", new object[] { plinCode }, ob);
string Deptid = dtDept.Rows[0]["DEPARTMENT_CODE"].ToString();
string Department = dtDept.Rows[0]["DEPARTMENT_DESC"].ToString();
list.Add(storageNo);
list.Add(storageNo + "10101");
list.Add(ds.Rows[0]["STORAGE_TYPE_NO"].ToString());
list.Add(ds.Rows[0]["STORAGE_TYPE_NAME"].ToString());
list.Add(this.UserInfo.GetUserName());
list.Add(Deptid);
list.Add(Department);
list.Add(Deptid);
list.Add(Department);
list.Add(this.UserInfo.GetUserOrder());
list.Add(this.UserInfo.GetUserGroup());
//list.Add(PipeManageClass.GetDepartIdBySectionId(this.UserInfo.GetDeptid(), this.ob));
//list.Add(PipeManageClass.GetDepartBySectionId(this.UserInfo.GetDeptid(), this.ob));
ArrayList parm = new ArrayList();
//foreach(UltraGridRow uRow in checkMagRows)
//{
// MilPlanEntity3 milPlanEntity = (MilPlanEntity3)uRow.ListObject;
// string milPlanTity = JSONFormat.Format(milPlanEntity);
// parm.Add(milPlanTity);
//}
//if (this.ultraGrid8.ActiveRow.Cells["LOT_NO"].Text.Trim() != "试轧料")
//{
if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.Trim() == "待处理")
{
MessageUtil.ShowTips("待处理品不允许进行入库!");
return;
}
//}
if (this.cmbStorage.Value.ToString2() == "")
{
MessageUtil.ShowTips("请选择去向,再进行交库!");
return;
}
MilPlanEntity3 mi = (MilPlanEntity3)this.ultraGrid3.ActiveRow.ListObject;
mi.PlineCode = plinCode;
if (plinCode == "C009")
{
mi.PlineName = "258机组";
}
else if (plinCode == "C008")
{
mi.PlineName = "250机组";
}
else if (plinCode == "C010")
{
mi.PlineName = "168机组";
}
else if (plinCode == "C017")
{
mi.PlineName = "460机组";
}
else if (plinCode == "C072")
{
mi.PlineName = "天淮508机组";
}
if (mi.MaterialDesc.Equals(""))
{
mi.MaterialDesc = this.ultraGrid1.ActiveRow.Cells["OUTWL_DESC"].Text.ToString();
}
string milPlanTity = JSONFormat.Format(mi);
int s = 0;
int m = 0;
int n = 0;
int z = 0;
int y = 0;
int p = 0;
int num = 0;
int x = 0;
int totalNum = 0;
//if (this.ultraGrid3.ActiveRow.Cells["GoType"].Text.Equals("成品") || this.ultraGrid3.ActiveRow.Cells["GoType"].Text.Equals("半成品"))
//{
// DataTable df = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQuerySampleNum", new object[] { mi.JudgeStoveNo.ToString(), plinCode, proPlanId, gxPlanNo }, ob);
// if (int.Parse(df.Rows[0][0].ToString()) <= 0)
// {
// MessageUtil.ShowTips("交库信息中无样管信息,不允许进行交库!");
// return;
// }
//}
foreach (UltraGridRow uRow in ultraGrid2.Rows)
{
if (uRow.Cells["BATCH_NO"].Text == "")
{
s = s + 1;
}
}
if (s > 0)
{
MessageUtil.ShowTips("未进行分批,不允许交库!");
return;
}
foreach (UltraGridRow row1 in ultraGrid2.Rows)
{
if (Convert.ToBoolean(row1.Cells["CHK"].Value) == true)
{
if (row1.Cells["ACT_LEN"].Value.ToString2() != "")
{
if (double.Parse(row1.Cells["ACT_LEN"].Value.ToString2()) > 0)
{
}
else
{
m = m + 1;
}
}
else
{
m = m + 1;
}
if (row1.Cells["ACT_COUNT"].Value.ToString2() != "")
{
if (int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2()) > 0)
{
}
else
{
n = n + 1;
}
}
else
{
n = n + 1;
}
if (row1.Cells["ACT_WEIGHT"].Value.ToString2() != "")
{
if (double.Parse(row1.Cells["ACT_WEIGHT"].Value.ToString2()) > 0)
{
}
else
{
z = z + 1;
}
}
else
{
z = z + 1;
}
if (row1.Cells["BATCH_NO"].Value.ToString2() == "")
{
y = y + 1;
}
//if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text != "")
//{
// if (row1.Cells["FLAW_STAUS"].Value.ToString2() == "" || row1.Cells["TESTING_STAUS"].Value.ToString2() == "")
// {
// p = p + 1;
// }
//}
//if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格")
//{
// if (!row1.Cells["FLAW_STAUS"].Text.ToString2().Contains("合格") || !row1.Cells["TESTING_STAUS"].Text.ToString2().Contains("合格"))
// {
// MessageUtil.ShowTips("合格品下,探伤、质检状态都应为合格!");
// return;
// }
//}
//else
//{
// if (row1.Cells["FLAW_STAUS"].Text.ToString2().Contains("合格") || row1.Cells["TESTING_STAUS"].Text.ToString2().Contains("合格"))
// {
// MessageUtil.ShowTips("不是合格品下,探伤、质检状态都不应为合格!");
// return;
// }
//}
if (row1.Cells["THACT_COUNT"].Text.ToString3() != "")
{
if (int.Parse(row1.Cells["ACT_COUNT"].Text.ToString3()) + int.Parse(row1.Cells["INSTORECOUNT"].Text.ToString3()) > int.Parse(row1.Cells["THACT_COUNT"].Text.ToString3()))
{
x = x + 1;
}
}
ArrayList parm1 = new ArrayList();
parm1.Add(row1.Cells["ACT_LEN"].Value.ToString2());
parm1.Add(row1.Cells["ACT_COUNT"].Value.ToString2());
parm1.Add(row1.Cells["ACT_WEIGHT"].Value.ToString2());
parm1.Add(row1.Cells["BATCH_NO"].Value.ToString2());
if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "合格" || this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "样管")
{
parm1.Add("40740401");//探伤结果
parm1.Add("40740601");//表检结果
}
else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text == "判废")
{
parm1.Add("");//探伤结果
parm1.Add("");//表检结果
}
parm1.Add(row1.Cells["THACT_COUNT"].Value.ToString3());
parm.Add(parm1);
totalNum = totalNum + int.Parse(row1.Cells["ACT_COUNT"].Value.ToString2());
num++;
}
}
IQueryable checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
int offlinePro = checkMagRows.GroupBy(a => a.GetValue("BATCH_NO")).Count();
if (checkMagRows.Count() > 1)
{
if (offlinePro == 1)
{
MessageUtil.ShowTips("批号一样,长度不一样请分开交库!");
return;
}
}
if (num <= 0)
{
MessageUtil.ShowTips("请勾选产出信息!");
return;
}
if (m > 0)
{
MessageUtil.ShowTips("长度不能为空,必须大于零!");
return;
}
if (n > 0)
{
MessageUtil.ShowTips("支数不能为空,必须大于零!");
return;
}
if (z > 0)
{
MessageUtil.ShowTips("重量不能为空,必须大于零!");
return;
}
if (y > 0)
{
MessageUtil.ShowTips("批号不能为空,请选择!");
return;
}
//if (p > 0)
//{
// MessageUtil.ShowTips("请选择探伤结果和表检结果!");
// return;
//}
if (x > 0)
{
MessageUtil.ShowTips("输入的实际支数加已在线库支数不能大于理论支数!");
return;
}
if (this.surplusChk.Checked)
{
surplusFlag = "1";
}
else
{
surplusFlag = "0";
}
if (this.sampleLen.Checked)
{
sampleFlag = "1";
}
else
{
sampleFlag = "0";
}
if(mi.Target.ToString().Equals("A") && surplusFlag == "1")
{
MessageUtil.ShowTips("A字头不允许进行无合同交库!");
return;
}
//DataTable dtSlample = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortSlample", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text }, ob);
//if (dtSlample.Rows.Count > 0)
//{
// MessageUtil.ShowTips("请先将样管交库!");
// return;
//}
string contractNo = this.ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text.Trim();
string target = "";
string pckFlag = "";//打捆标志
string matRturnFlag = "";//交货材料要求标志
string testType = "";//双探类别
string testGrade = "";//等级
DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlan", new object[] { this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Text, proPlanId, gxPlanNo }, ob);
target = dd.Rows[0]["TARGET"].ToString();
if (target.Equals("A"))
{
DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryOrderAsk", new object[] { contractNo }, ob);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
if (dt.Rows[i]["ASK_SUB_ITME_VAL_DESC"].ToString().Contains("打捆"))
{
k = k + 1;
}
else if (dt.Rows[i]["ASK_ITME"].ToString().Equals("121009"))
{
b = b + 1;
}
}
}
if (k > 0 && b > 0)
{
if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆、交货材料是否满足要求?") == DialogResult.No)
{
return;
}
pckFlag = "1";
matRturnFlag = "1";
}
else if (k > 0 && b < 1)
{
if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求打捆是否满足要求?") == DialogResult.No)
{
return;
}
pckFlag = "1";
matRturnFlag = "0";
}
else if (b > 0 && k < 1)
{
if (MessageUtil.ShowYesNoAndQuestion("该合同的附加要求交货材料是否满足要求?") == DialogResult.No)
{
return;
}
pckFlag = "0";
matRturnFlag = "1";
}
else
{
pckFlag = "0";
matRturnFlag = "0";
}
if (doQueryPk(this.ultraGrid8.ActiveRow.Cells["ORD_LN_DLY_PK"].Value.ToString()))
{
DataTable dtest = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryEntrustT", new object[] { BaseMethod.getJudgeStoveNo(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text), proPlanId, gxPlanNo }, ob);
if (dtest.Rows.Count > 0)
{
testType = "UT";
testGrade = dtest.Rows[0][0].ToString();
}
else
{
MessageUtil.ShowTips("此炉是需要进行双探的管子,需走离线委外加工!");
return;
}
}
}
DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
string portCount = portDt.Rows[0][0].ToString3();//理论支数
DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
string matCount = matDt.Rows[0][0].ToString3();//已交库支
DataTable instoreDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, ultraGrid8.ActiveRow.Cells["ID"].Text }, ob);
string pipeLXCount = instoreDt.Rows[0][0].ToString3(); //交库点离线支
if (totalNum + int.Parse(matCount) + int.Parse(pipeLXCount) > int.Parse(portCount))
{
MessageUtil.ShowTips("总交库支数已大于产出支数,请核对支数再交库!");
return;
}
if (MessageUtil.ShowYesNoAndQuestion("是否确认交库?") == DialogResult.No)
{
return;
}
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "doPipeIn";
ccp.ServerParams = new object[] { milPlanTity, list, parm, strInbound, strInMemo, this.cmbStorage.Value.ToString2(), this.cmbStorage.Text.Trim(), surplusFlag, sampleFlag, pckFlag, matRturnFlag, testType, testGrade, this.textMemo.Text.Trim(), this.textMemo2.Text.Trim() };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("交库成功!"))
{
QuerySinglePlan();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 查询是否需双探
///
///
private bool doQueryPk(string orderPk)
{
DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryProcessSeq", new object[] { orderPk }, ob);
if (ds.Rows.Count > 0)
{
if (ds.Rows[0]["PROCESS_SEQ"].ToString().Equals("F"))
{
return true;
}
}
return false;
}
///
/// 撤销交库
///
private void cancelInList()
{
this.ultraGrid4.UpdateData();
IQueryable checkMagRows = this.ultraGrid4.Rows.AsQueryable().Where(" CHK = 'True'");
if (checkMagRows.Count() == 0)
{
MessageUtil.ShowTips("请勾选需要撤销的入库记录!");
return;
}
ArrayList parm = new ArrayList();
foreach(UltraGridRow uRow in checkMagRows)
{
YdmZcInlistEntity inListEntity = (YdmZcInlistEntity)uRow.ListObject;
string inListTity = JSONFormat.Format(inListEntity);
parm.Add(inListTity);
}
if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No) return;
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "cancelPipeIn";
ccp.ServerParams = new object[] {parm };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("撤销成功!"))
{
DoQueryInList();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 申请判定
///
private void DoDecision()
{
this.ultraGrid7.UpdateData();
int m =0 ;
int n = 0;
IQueryable checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
if (checkMagRows.Count() == 0)
{
MessageUtil.ShowTips("请选择需要申请判定的主信息!");
return;
}
ArrayList parm = new ArrayList();
foreach(UltraGridRow uRow in checkMagRows)
{
if (uRow.Cells["QcmStaus"].Text.Trim() == "判废"||uRow.Cells["QcmStaus"].Text.Trim() == "待处理")
{
m= m+1;
}
if (uRow.Cells["JugdeApplyCode"].Text.Trim() != "")
{
n = n + 1;
}
MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
string matZcTity = JSONFormat.Format(matZcEntity);
parm.Add(matZcTity);
}
if (m > 0)
{
MessageUtil.ShowTips("废品/待处理的炉批组信息,不允许申请判定!");
return;
}
if(n>0)
{
MessageUtil.ShowTips("正在进行判定的炉批组信息,不允许重复申请判定!");
return;
}
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "doDecision";
ccp.ServerParams = new object[] { parm, this.ultraGrid6.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid6.ActiveRow.Cells["ProductFlag"].Value.ToString() };
ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("申请判定成功!"))
{
QueryMat();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 撤销申请判定
///
private void cancelDoDecision()
{
this.ultraGrid7.UpdateData();
IQueryable checkMagRows = this.ultraGrid7.Rows.AsQueryable().Where(" CHK = 'True'");
if (checkMagRows.Count() == 0)
{
MessageUtil.ShowTips("请选择需要撤销申请判定的主信息!");
return;
}
ArrayList parm = new ArrayList();
foreach(UltraGridRow uRow in checkMagRows)
{
MatZcMEntity matZcTity = (MatZcMEntity)uRow.ListObject;
string matTity = JSONFormat.Format(matZcTity);
parm.Add(matTity);
}
if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No) return;
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
ccp.MethodName = "cancelDoDecision";
ccp.ServerParams = new object[] { parm };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode != -1)
{
if (ccp.ReturnInfo.Equals("撤销成功!"))
{
QueryMat();
MessageUtil.ShowTips(ccp.ReturnInfo);
}
else
{
MessageUtil.ShowTips(ccp.ReturnInfo);
}
}
}
///
/// 查询入库实绩
///
private void DoQueryInList()
{
string plinCode = "";
string jugeNo = "";
string startTim = "";
string endTim = "";
//string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(),ob);
string departMentId = UserInfo.GetDeptid();
NativeMethodNew na = new NativeMethodNew(this.ob);
plinCode = na.GetPCode(this.UserInfo.GetDepartment());
if (this.chkHeatNo1.Checked && this.txtHeatNo1.Text.Trim() != "")
{
jugeNo = this.txtHeatNo1.Text.Trim();
}
if (chkTim1.Checked)
{
if (DateTime.Parse(StartTime1.Value.ToString()) > DateTime.Parse(EndTime1.Value.ToString()))
{
MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
return;
}
else
{
startTim = this.StartTime1.Value.ToString("yyyy-MM-dd");
endTim = this.EndTime1.Value.ToString("yyyy-MM-dd");
}
}
ArrayList list = new ArrayList();
list.Add(jugeNo);
list.Add(plinCode);
List listSource = EntityHelper.GetData(
"com.steering.mes.signature.FrmInOnlineStore.doQueryInList", new object[] { list, startTim, endTim, departMentId, plineCodes }, this.ob);
YdmZcInlistEntitybindingSource.DataSource = listSource;
}
///
/// 查询库存实绩
///
private void QueryMatButess()
{
string plinCode = "";
string jugeNo = "";
string startTim = "";
string endTim = "";
//string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(),ob);
string departMentId = UserInfo.GetDeptid();
NativeMethodNew na = new NativeMethodNew(this.ob);
plinCode = na.GetPCode(this.UserInfo.GetDepartment());
if (this.chkHeatNo3.Checked && this.txtHeatNo3.Text.Trim() != "")
{
jugeNo = this.txtHeatNo3.Text.Trim();
}
if (chkTim3.Checked)
{
if (DateTime.Parse(StartTime3.Value.ToString()) > DateTime.Parse(EndTime3.Value.ToString()))
{
MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
return;
}
else
{
startTim = this.StartTime3.Value.ToString("yyyy-MM-dd HH:mm:ss");
endTim = this.EndTime3.Value.ToString("yyyy-MM-dd HH:mm:ss");
}
}
ArrayList list = new ArrayList();
list.Add(jugeNo);
list.Add(plinCode);
List listSource = EntityHelper.GetData(
"com.steering.mes.signature.FrmInOnlineStore.doQueryMatButess", new object[] { list, startTim, endTim, departMentId, plineCodes }, this.ob);
MatZcMEntitybindingSource.DataSource = listSource;
}
///
/// 查询材料表
///
private void QueryMat()
{
string plinCode = "";
string jugeNo = "";
string startTim = "";
string endTim = "";
string departMentid = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
NativeMethodNew na = new NativeMethodNew(this.ob);
plinCode = na.GetPCode(this.UserInfo.GetDepartment());
if (this.chkHeatNo2.Checked && this.txtHeatNo2.Text.Trim() != "")
{
jugeNo = this.txtHeatNo2.Text.Trim();
}
if (chkTim2.Checked)
{
if (DateTime.Parse(StartTime2.Value.ToString()) > DateTime.Parse(EndTime2.Value.ToString()))
{
MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
return;
}
else
{
startTim = this.StartTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
endTim = this.EndTime2.Value.ToString("yyyy-MM-dd HH:mm:ss");
}
}
ArrayList list = new ArrayList();
list.Add(jugeNo);
list.Add(plinCode);
List listSource = EntityHelper.GetData(
"com.steering.mes.signature.FrmInOnlineStore.doQueryMat", new object[] { list, startTim, endTim, departMentid, plinCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString(), plineCodes }, this.ob);
MatZcMEntity1bindingSource.DataSource = listSource;
}
///
/// 查询炉顺序
///
private void QuerySinglePlan()
{
string plinCode = "";
string startTim = "";
string endTim = "";
string jugeNo = "";
string lotNo = "";
if(this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
{
jugeNo = this.txtJugeNo.Text.Trim();
}
if(chkTim.Checked)
{
if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
{
MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
return;
}
else
{
startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
}
}
if(this.chkLotNo.Checked&&this.txtLotNo.Text.Trim() !="")
{
lotNo = this.txtLotNo.Text.Trim();
}
NativeMethodNew na = new NativeMethodNew(this.ob);
plinCode = na.GetPCode(this.UserInfo.GetDepartment());
string nodeStaus = this.ultraOptionSet2.CheckedItem.DataValue.ToString();
ArrayList list = new ArrayList();
list.Add(jugeNo);
list.Add(lotNo);
list.Add(plinCode);
this.dtPlan.Clear();
this.dataTable1.Clear();
this.dataTable2.Clear();
this.MilPlanEntity3bindingSource.Clear();
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.querySinglePlan", new object[] { list, startTim, endTim, nodeStaus, plineCodes }, ob);
GridHelper.CopyDataToDatatable(ref ds, ref dtPlan, true);
}
///
/// 查询炉投入产出
///
private void QuerySingleJugStove(string jugeNo, string lotNo, string plinCode)
{
//string plinCode = "";
string startTim = "";
string endTim = "";
NativeMethodNew na = new NativeMethodNew(this.ob);
//plinCode = na.GetPCode(this.UserInfo.GetDepartment());
string nodeStaus = this.ultraOptionSet2.CheckedItem.DataValue.ToString();
//if(this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
//{
// jugeNo = this.txtJugeNo.Text.Trim();
//}
//if(chkTim.Checked)
//{
// if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
// {
// MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
// return;
// }
// else
// {
// startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
// endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
// }
//}
//if(this.chkLotNo.Checked&&this.txtLotNo.Text.Trim() !="")
//{
// lotNo = this.txtLotNo.Text.Trim();
//}
ArrayList list = new ArrayList();
list.Add(plinCode);
list.Add(jugeNo);
list.Add(lotNo);
list.Add(plinCode);
list.Add(jugeNo);
list.Add(lotNo);
list.Add(plinCode);
list.Add(jugeNo);
list.Add(lotNo);
list.Add(plinCode);
list.Add(jugeNo);
list.Add(lotNo);
list.Add(plinCode);
list.Add(jugeNo);
list.Add(lotNo);
list.Add(plinCode);
list.Add(jugeNo);
list.Add(lotNo);
dataSet1.Clear();
this.dataTable1.Clear();
DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQuerySingleJugStove", new object[] { list, startTim, endTim, nodeStaus }, ob);
GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
}
private void QueryMinMaxDS()
{
UltraGridRow uRow = this.ultraGrid8.ActiveRow;
DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryMinMaxD", new object[] { uRow.Cells["JUDGE_NO"].Value.ToString() }, ob);
DataTable dd = ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.doQueryMinMaxS", new object[] { uRow.Cells["JUDGE_NO"].Value.ToString() }, ob);
if (ds.Rows.Count > 0)
{
this.txt_dimer.Text = ds.Rows[0]["DIMATER"].ToString();
}
else
{
this.txt_dimer.Text = "0";
}
if (dd.Rows.Count > 0)
{
this.txt_height.Text = dd.Rows[0]["HEIGHT"].ToString();
}
else
{
this.txt_height.Text = "0";
}
}
private void FrmInOnlineStore_Load(object sender, EventArgs e)
{
DateTime now = DateTime.Now;
DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
this.StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
this.EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
this.StartTime1.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
this.EndTime1.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
this.StartTime2.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
this.EndTime2.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
this.StartTime3.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
this.EndTime3.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
EntityHelper.ShowGridCaption(ultraGrid3.DisplayLayout.Bands[0]);
EntityHelper.ShowGridCaption(ultraGrid4.DisplayLayout.Bands[0]);
EntityHelper.ShowGridCaption(ultraGrid6.DisplayLayout.Bands[0]);
EntityHelper.ShowGridCaption(ultraGrid5.DisplayLayout.Bands[0]);
EntityHelper.ShowGridCaption(ultraGrid7.DisplayLayout.Bands[0]);
//EntityHelper.ShowGridCaption(ultraGrid9.DisplayLayout.Bands[0]);
PipeManageClass.InitComboEditor2(cmbStorage, "com.steering.mes.signature.FrmInOnlineStore.getStoreNo", "STORAGE_NO",this.UserInfo.GetDeptid(), this.ob, false);
PipeManageClass.InitComboEditor(txt_UtGrade, "com.steering.mes.signature.FrmInOnlineStore.getTestGrade", "BASECODE", this.ob, false);
InitBindColumn();
NativeMethodNew na = new NativeMethodNew(this.ob);
Departm = UserInfo.GetDepartment();
PlineCode = na.GetPCode(Departm);//获取 用户 对应的产线
plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
//if (!PlineCode.Equals("C072"))
//{
// label7.Visible = false;
// textMemo.Visible = false;
//}
Sign();
}
private void InitBindColumn()
{
//材料状态
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
this.ultraGrid7.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
//材料类别
this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
this.ultraGrid7.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
//材料状态
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
this.ultraGrid6.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
//材料类别
this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
this.ultraGrid6.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
//材料状态
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
this.ultraGrid5.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
//材料类别
this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
this.ultraGrid5.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
//材料状态
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出待判");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150205", "材料缴库余材(销售组织缴库)");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
this.ultraGrid4.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("00", "合格");
this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("11", "待处理");
this.ultraGrid4.DisplayLayout.ValueLists[1].ValueListItems.Add("22", "废品");
this.ultraGrid4.DisplayLayout.ValueLists[2].ValueListItems.Add("0", "非样管");
this.ultraGrid4.DisplayLayout.ValueLists[2].ValueListItems.Add("1", "样管");
//string[] arr = new string[3] { "801501", "801502", "801503" };
//DataTable dt = ClsLoad.GetValueListDataTable(arr, this.ob);
//this.ultraGrid2.DisplayLayout.Bands[0].Columns["MAT_STATUS"].ValueList = ClsLoad.GeneralValuelist(ref dt, "BASECODE", "BASENAME");
}
private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
{
string goType = "";
NativeMethodNew na = new NativeMethodNew(this.ob);
string plinCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
//doQueryQaJugeStove(this.ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), plinCode);
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryGoType", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString() }, this.ob);
if (ds.Rows.Count > 0)
{
goType = ds.Rows[0][0].ToString();
}
doQueryQaInStore(this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString(), this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString(), plinCode, goType);
}
///
/// 签名
///
private void Sign()
{
ColUserName col = new ColUserName();
col.StationId = "12";
col.PlineCode = PlineCode;
col.ColGroup = UserInfo.GetUserGroup();
col.Ob = this.ob;
col.ShowDialog();
_UserID = col.getUserId();
_UserName = col.getUserName();
}
///
/// 查询表检炉批
///
private void doQueryQaJugeStove(string jugeStove,string plineCode)
{
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryQaStove", new object[] { jugeStove, plineCode }, ob);
GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
}
//private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
//{
// NativeMethodNew na = new NativeMethodNew(this.ob);
// string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
// doQueryQaInStore(this.ultraGrid2.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), this.ultraGrid2.ActiveRow.Cells["LOT_NO"].Value.ToString(), plinCode);
//}
///
/// 查询产出详细信息
///
///
///
///
private void doQueryQaInStore(string p, string p_2, string plinCode,string goType)
{
ArrayList parm = new ArrayList();
parm.Add(p);
parm.Add(p_2);
parm.Add(plinCode);
parm.Add(p);
parm.Add(p_2);
parm.Add(plinCode);
parm.Add(p);
parm.Add(p_2);
parm.Add(plinCode);
//parm.Add(p);
//parm.Add(p_2);
//parm.Add(plinCode);
//parm.Add(p);
//parm.Add(p_2);
//parm.Add(plinCode);
MilPlanEntity3bindingSource.Clear();
List listSource = EntityHelper.GetData(
"com.steering.mes.signature.FrmInOnlineStore.doQuerySurface", new object[] { parm,goType }, this.ob);
MilPlanEntity3bindingSource.DataSource = listSource;
}
private void ultraGrid3_AfterSelectChange(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs e)
{
foreach (UltraGridRow uRow in ultraGrid3.Selected.Rows)
{
if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
{
uRow.Cells["CHK"].Value = true;
}
}
}
private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
{
string judgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString();
string lotNo = this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString();
string length = this.ultraGrid3.ActiveRow.Cells["ActLen"].Value.ToString2();
string staus = this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString();
string id = this.ultraGrid3.ActiveRow.Cells["id"].Value.ToString();
string sampleFlag = "";
ArrayList list = new ArrayList();
list.Add(judgeStoveNo);
list.Add(lotNo);
if (this.sampleLen.Checked)
{
sampleFlag = "1";
}
else
{
sampleFlag = "0";
}
//doQueryNum(list, staus);
//getBacthNo(judgeStoveNo, lotNo,id);
getBacthNoInformation(judgeStoveNo, lotNo, id, this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString(), sampleFlag);
}
///
/// 查询炉次信息
///
private void getBacthNoInformation(string judgeStoveNo, string lotNo, string id, string flag, string sampleFlag)
{
this.dataTable2.Clear();
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBacthNoInformation", new object[] { judgeStoveNo, lotNo, id, flag, sampleFlag }, ob);
GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
DataTable portDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPortCount", new object[] { judgeStoveNo, lotNo, id }, ob);
string portCount = portDt.Rows[0][0].ToString3();
DataTable matDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeCount", new object[] { judgeStoveNo, lotNo, id }, ob);
string matCount = matDt.Rows[0][0].ToString3();
DataTable lxDt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryPipeLXCount", new object[] { judgeStoveNo, lotNo, id }, ob);
string lxCount = lxDt.Rows[0][0].ToString3();
this.ultraLabel3.Text = "炉号:" + judgeStoveNo + " " + "理论支数:" + portCount + " " + "已交库支数:" + matCount + " " + "离线支数:" + lxCount;
ultraLabel3.ForeColor = Color.Red;
}
///
/// 查询几大类的支数、长度、重量信息
///
///
///
private void doQueryNum(ArrayList list,string staus)
{
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryNum", new object[] { list, staus }, ob);
GridHelper.CopyDataToDatatable(ref ds, ref dataTable2, true);
}
UltraComboEditor bacthNo = new UltraComboEditor();
UltraComboEditor flawStaus = new UltraComboEditor();
UltraComboEditor testingStaus = new UltraComboEditor();
private void getBacthNo(string jugeNo,string lotNo,string id)
{
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryBacthNo", new object[] { jugeNo, lotNo, id }, ob);
PipeManageClass.InitComboEditor(bacthNo, ds, "BATCHCODE", false);
PipeManageClass.BindColumn(bacthNo, "BATCH_NO", this.Controls, this.ultraGrid2,0);
PipeManageClass.InitComboEditor(flawStaus, "com.steering.mes.signature.FrmInOnlineStore.doQueryFlawStaus", "BASECODE",this.ob, false);
PipeManageClass.BindColumn(flawStaus, "FLAW_STAUS", this.Controls, this.ultraGrid2, 0);
PipeManageClass.InitComboEditor(testingStaus, "com.steering.mes.signature.FrmInOnlineStore.doQueryTestingStaus", "BASECODE", this.ob, false);
PipeManageClass.BindColumn(testingStaus, "TESTING_STAUS", this.Controls, this.ultraGrid2, 0);
}
private void ultraGrid2_CellChange(object sender, CellEventArgs e)
{
this.ultraGrid2.UpdateData();
string isSampleFlag = "";
string stausFlag = "";
if (e.Cell.Column.Key == "ACT_LEN" || e.Cell.Column.Key == "ACT_COUNT")
{
//if (e.Cell.DataChanged)
//{
if (e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2() != "" && e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2() != "0" && e.Cell.Row.Cells["ACT_LEN"].Value.ToString2() != "" && double.Parse(e.Cell.Row.Cells["ACT_LEN"].Value.ToString2()) > 0)
{
if (this.ultraGrid3.ActiveRow != null)
{
if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.ToString() == "样管")
{
isSampleFlag = "1";
stausFlag = "0";
}
else if (this.ultraGrid3.ActiveRow.Cells["Astatus"].Text.ToString() == "合格")
{
isSampleFlag = "0";
stausFlag = "0";
}
else
{
isSampleFlag = "0";
stausFlag = "2";
}
DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryWgt", new object[] { this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString(), int.Parse(e.Cell.Row.Cells["ACT_COUNT"].Value.ToString2()), stausFlag, isSampleFlag }, ob);
e.Cell.Row.Cells["ACT_WEIGHT"].Value = ds.Rows[0]["ACT_WEIGHT"].ToString2();
}
else
{
MessageUtil.ShowTips("请选择炉批行信息!");
return;
}
}
//}
}
if (e.Cell.Column.Key == "CHK")
{
if (Convert.ToBoolean(e.Cell.Value))
{
for (int i = 0; i < e.Cell.Row.Cells.Count; i++)
{
e.Cell.Row.Cells[i].Activation = Activation.AllowEdit;
}
}
//else
//{
// e.Cell.Row.Delete();
//}
}
}
private void FrmInOnlineStore_Shown(object sender, EventArgs e)
{
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
{
toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
{
toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
{
toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
{
toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
{
toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
{
toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("Print"))
{
toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
{
toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("updateTarget"))
{
toolMenu.Toolbars[0].Tools["updateTarget"].InstanceProps.Visible = DefaultableBoolean.False;
}
}
private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
{
if (toolMenu == null) return;
if (ultraTabControl1.SelectedTab.Key == "1")
{
if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
{
toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
{
toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
{
toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
{
toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
{
toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
{
toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
{
toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
{
toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
{
toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
{
toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("Print"))
{
toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
{
toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
{
toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("Export"))
{
toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
{
toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
{
toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.True;
}
}
else if (ultraTabControl1.SelectedTab.Key == "2")
{
if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
{
toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
{
toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
{
toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
{
toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
{
toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
{
toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
{
toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
{
toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
{
toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
{
toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("Print"))
{
toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
{
toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
{
toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("Export"))
{
toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
{
toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
{
toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
}
}
else if (ultraTabControl1.SelectedTab.Key == "3")
{
if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
{
toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
{
toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
{
toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
{
toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
{
toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
{
toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
{
toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
{
toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
{
toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
{
toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("Print"))
{
toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
{
toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
{
toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("Export"))
{
toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
{
toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
{
toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
}
}
else if (ultraTabControl1.SelectedTab.Key == "4")
{
if (toolMenu.Toolbars[0].Tools.Exists("DoQuery"))
{
toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoSave"))
{
toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMat"))
{
toolMenu.Toolbars[0].Tools["DoQueryMat"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryMatB"))
{
toolMenu.Toolbars[0].Tools["DoQueryMatB"].InstanceProps.Visible = DefaultableBoolean.True;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoQueryInList"))
{
toolMenu.Toolbars[0].Tools["DoQueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelInList"))
{
toolMenu.Toolbars[0].Tools["cancelInList"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoDecision"))
{
toolMenu.Toolbars[0].Tools["DoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
{
toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoBeside"))
{
toolMenu.Toolbars[0].Tools["cancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("cancelDoDecision"))
{
toolMenu.Toolbars[0].Tools["cancelDoDecision"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("Print"))
{
toolMenu.Toolbars[0].Tools["Print"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("insertProssWt"))
{
toolMenu.Toolbars[0].Tools["insertProssWt"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("adjustWgt"))
{
toolMenu.Toolbars[0].Tools["adjustWgt"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("Export"))
{
toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("OfflineXX"))
{
toolMenu.Toolbars[0].Tools["OfflineXX"].InstanceProps.Visible = DefaultableBoolean.False;
}
if (toolMenu.Toolbars[0].Tools.Exists("QuXiang"))
{
toolMenu.Toolbars[0].Tools["QuXiang"].InstanceProps.Visible = DefaultableBoolean.False;
}
}
}
private void chkTim_CheckedChanged(object sender, EventArgs e)
{
this.StartTime.Enabled = this.EndTime.Enabled = this.chkTim.Checked;
}
private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
{
this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
}
private void chkLotNo_CheckedChanged(object sender, EventArgs e)
{
this.txtLotNo.Enabled = this.chkLotNo.Checked;
}
private void chkTim1_CheckedChanged(object sender, EventArgs e)
{
this.StartTime1.Enabled = this.EndTime1.Enabled = this.chkTim1.Checked;
}
private void chkHeatNo1_CheckedChanged(object sender, EventArgs e)
{
this.txtHeatNo1.Enabled = this.chkHeatNo1.Checked;
}
private void chkTim2_CheckedChanged(object sender, EventArgs e)
{
this.StartTime2.Enabled = this.EndTime2.Enabled = this.chkTim2.Checked;
}
private void chkHeatNo2_CheckedChanged(object sender, EventArgs e)
{
this.txtHeatNo2.Enabled = this.chkHeatNo2.Checked;
}
private void chkTim3_CheckedChanged(object sender, EventArgs e)
{
this.StartTime3.Enabled = this.EndTime3.Enabled = this.chkTim3.Checked;
}
private void chkHeatNo3_CheckedChanged(object sender, EventArgs e)
{
this.txtHeatNo3.Enabled = this.chkHeatNo3.Checked;
}
private void ultraGrid6_AfterRowActivate(object sender, EventArgs e)
{
UltraGridRow uRow = this.ultraGrid6.ActiveRow;
this.MatZcMEntity2bindingSource.Clear();
List listSource = EntityHelper.GetData(
"com.steering.mes.signature.FrmInOnlineStore.doQueryMatData", new object[] { uRow.Cells["HeatPlanNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
MatZcMEntity2bindingSource.DataSource = listSource;
}
private void ultraGrid7_AfterRowActivate(object sender, EventArgs e)
{
//查询转移信息
UltraGridRow uRow = this.ultraGrid7.ActiveRow;
List listSource = EntityHelper.GetData(
"com.steering.mes.signature.FrmInOnlineStore.doQueryMatDataOut", new object[] { uRow.Cells["HeatPlanNo"].Value.ToString(), this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
MatZcMEntity3bindingSource.DataSource = listSource;
}
private void ultraGrid8_AfterRowActivate(object sender, EventArgs e)
{
proPlanId = this.ultraGrid8.ActiveRow.Cells["PRO_PLAN_ID"].Text.ToString();
gxPlanNo = this.ultraGrid8.ActiveRow.Cells["GX_PLAN_NO"].Text.ToString();
PlineCode = this.ultraGrid8.ActiveRow.Cells["PLINE_CODE"].Text.ToString();
QuerySingleJugStove(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text, this.ultraGrid8.ActiveRow.Cells["LOT_NO"].Text, PlineCode);
//QueryMinMaxDS();
QueryThickDs(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text);
QueryMilPlanPrt(this.ultraGrid8.ActiveRow.Cells["JUDGE_STOVE_NO"].Text);
this.textMemo.Text = "";
}
///
/// 查询目标外径、控制壁厚
///
///
private void QueryThickDs(string p)
{
DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryThickDs", new object[] { p }, ob);
if (dt.Rows.Count > 0)
{
if (dt.Rows[0]["VARIETIES"].ToString().Contains("套管") || dt.Rows[0]["VARIETIES"].ToString().Contains("油管") || dt.Rows[0]["VARIETIES"].ToString().Contains("接箍"))
{
if (dt.Rows[0]["VARIETIES"].ToString().Contains("管线"))
{
this.txt_dimer.Text = Math.Round((double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3()) * 1.003),2).ToString();
}
else
{
this.txt_dimer.Text = Math.Round((double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3()) * 1.006),2).ToString();
//if (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) > 0)
//{
// this.txt_dimer.Text = (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) * 1.005).ToString();
//}
//else
//{
// this.txt_dimer.Text = (double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString()) * 1.005).ToString();
//}
}
}
else
{
this.txt_dimer.Text = (double.Parse(dt.Rows[0]["OUTDIAMETER"].ToString3())).ToString();
//if (double.Parse(dt.Rows[0]["AIMOUTDIAMETER"].ToString()) > 0)
//{
// this.txt_dimer.Text = dt.Rows[0]["AIMOUTDIAMETER"].ToString();
//}
//else
//{
// this.txt_dimer.Text = dt.Rows[0]["OUTDIAMETER"].ToString();
//}
}
this.txt_height.Text = dt.Rows[0]["CONTROL_THICKP"].ToString3();
}
else
{
this.txt_dimer.Text = "0";
this.txt_height.Text = "0";
}
}
private void QueryMilPlanPrt(string p)
{
DataTable dt = ServerHelper.GetData("com.steering.mes.signature.FrmInOnlineStore.doQueryMilPlanPrt", new object[] { p }, ob);
if (dt.Rows[0][0].ToString() == "0")
{
this.chkPrn.Checked = false;
}
else if (dt.Rows[0][0].ToString() == "1")
{
this.chkPrn.Checked = true;
}
}
private void sampleLen_CheckedChanged(object sender, EventArgs e)
{
string judgeStoveNo = this.ultraGrid1.ActiveRow.Cells["JUDGE_NO"].Value.ToString();
string lotNo = this.ultraGrid1.ActiveRow.Cells["LOT_NO"].Value.ToString();
string length = this.ultraGrid3.ActiveRow.Cells["ActLen"].Value.ToString2();
string staus = this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString();
string id = this.ultraGrid3.ActiveRow.Cells["id"].Value.ToString();
string sampleFlag = "";
if (this.sampleLen.Checked)
{
sampleFlag = "1";
}
else
{
sampleFlag = "0";
}
if (staus.Equals("样管"))
{
getBacthNoInformation(judgeStoveNo, lotNo, id, this.ultraGrid3.ActiveRow.Cells["Astatus"].Value.ToString(), sampleFlag);
}
}
private void chkPrn_CheckedChanged(object sender, EventArgs e)
{
UltraGridRow uRow = this.ultraGrid8.ActiveRow;
if(uRow == null)
{
MessageUtil.ShowTips("请选择对应炉进行勾选是否过磅!");
return;
}
string jugeNo = uRow.Cells["JUDGE_STOVE_NO"].Text.ToString();
string chkPrnFlag = "";
if (chkPrn.Checked)
{
chkPrnFlag = "1";
}
else
{
chkPrnFlag = "0";
}
int count = ServerHelper.SetData("com.steering.mes.signature.FrmInOnlineStore.doUpdatePrn", new object[] { jugeNo, chkPrnFlag }, ob);
if (count < 0)
{
MessageUtil.ShowTips("修改过磅标识异常!");
return;
}
}
///
/// 导出
///
private void ExportData()
{
if (this.ultraTabControl1.Tabs[1].Active)
{
GridHelper.ulGridToExcel(ultraGrid4, "交库实绩");
}
else if (this.ultraTabControl1.Tabs[3].Active)
{
GridHelper.ulGridToExcel(ultraGrid5, "库存实绩");
}
}
}
}