| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Judge.Commons;
- using Core.StlMes.Client.Judge.Forms;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Judge.Controls
- {
- public partial class QcmJhyPhySplineCtrl : UserControl
- {
- private Dal _d;
- private string _frmFlag = "";
- public QcmJhyPhySplineCtrl(string frmFlag, string deptId, Control container, OpeBase ob)
- {
- InitializeComponent();
- _frmFlag = frmFlag;
- if (frmFlag == "phy")
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["sampleId"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["lotNo"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["lotNoGroup"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["judgeStoveNo"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["processDesc"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["descCount"].Hidden = true;
- }
- else
- {
- if (frmFlag == "bc")
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["processDesc"].Hidden = true;
- }
- }
- if (deptId == "phy")
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["chk"].Hidden = false;
- }
- else
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["chk"].Hidden = true;
- }
- container.Controls.Add(this);
- this.Dock = DockStyle.Top;
- _d = new Dal(ob);
- ClsBaseInfo.SetComboItemHeight(ultraComboEditor1);
- ValueList listResult = new ValueList();
- listResult.ValueListItems.Add("0", "系统判定");
- listResult.ValueListItems.Add("1", "人工判定");
- ultraGrid1.DisplayLayout.Bands[0].Columns["resultSource"].ValueList = listResult;
- ValueList listResample = new ValueList();
- listResample.ValueListItems.Add("0", "否");
- listResample.ValueListItems.Add("1", "是");
- ultraGrid1.DisplayLayout.Bands[0].Columns["applyResample"].ValueList = listResample;
- ValueList listCycles = new ValueList();
- listCycles.ValueListItems.Add("0", "否");
- listCycles.ValueListItems.Add("1", "是");
- ultraGrid1.DisplayLayout.Bands[0].Columns["cyclesFlag"].ValueList = listCycles;
- ultraGrid1.DisplayLayout.Bands[0].Override.AllowDelete = DefaultableBoolean.False;
- ValueList listCraftSource = new ValueList();
- listCraftSource.ValueListItems.Add("0", "生产样");
- listCraftSource.ValueListItems.Add("1", "首日检");
- ultraGrid1.DisplayLayout.Bands[0].Columns["craftSource"].ValueList = listCraftSource;
- ultraGrid1.DisplayLayout.Bands[0].Override.AllowDelete = DefaultableBoolean.False;
- ValueList listIsMain = new ValueList();
- listIsMain.ValueListItems.Add("0", "否");
- listIsMain.ValueListItems.Add("1", "是");
- ultraGrid1.DisplayLayout.Bands[0].Columns["isMain"].ValueList = listIsMain;
- ultraGrid1.DisplayLayout.Bands[0].Override.AllowDelete = DefaultableBoolean.False;
- }
- public void QueryLg(string ordLnPk, string ordLnDlyPk, string craftSeq, string mscPline, string stoveNo, string lgJudgeStoveNo, string cic, string zcApplyCode,
- string zcJudgeStoveNo, string zcBatchNo, string zcIsAllScrap, bool clearData)
- {
- CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledTubePhyJudge.getConsignDetailLg",
- ordLnPk, craftSeq, stoveNo, lgJudgeStoveNo, cic, zcApplyCode, zcJudgeStoveNo, zcBatchNo, zcIsAllScrap);
- if (ccp.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo.ToString2());
- }
- DataTable dt = JsonHelper.toTable(ccp.ReturnObject.ToString2());
- if (dt.Rows.Count == 0) return;
- GridHelper.CopyDataToDatatable(dt, dataTable1, clearData);
- foreach (DataRow dr in dataTable1.Rows)
- {
- if (dr["ordLnPk"].ToString() != "") continue;
- dr["ordLnPk"] = ordLnPk;
- dr["ordLnDlyPk"] = ordLnDlyPk;
- dr["craftSeq"] = craftSeq;
- dr["mscPline"] = mscPline;
- dr["stoveNo"] = stoveNo;
- }
- GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "stdMemo");
- ultraGrid1.DisplayLayout.Bands[0].Columns["oldJudgeStoveNo"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["oldBatchNo"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["isMain"].Hidden = true;
- foreach (var row in ultraGrid1.Rows)
- {
- GridEdite(row);
- if (row.GetValue("resultSource") == "")
- {
- row.Cells["chk"].Value = DBNull.Value;
- row.Cells["chk"].Activation = Activation.ActivateOnly;
- row.Update();
- }
- else
- {
- //if (row.GetValue("resultSource") == "0")
- //{
- // if (row.GetValue("nkResult") != "" && row.GetValue("jfResult") != "")
- // {
- // row.Cells["chk"].Value = DBNull.Value;
- // row.Cells["chk"].Activation = Activation.ActivateOnly;
- // row.Update();
- // }
- //}
- }
- }
- }
- public static string GetLgJudgeStoveNo(string loadJudgeStoveNo, OpeBase ob)
- {
- string lgJudgeStoveNo = loadJudgeStoveNo;
- Dal d = new Dal(ob);
- DataRow drLgJudge = d.GetRowByXmlId("QcmLgJudgeDAL.queryByJudgeStoveNo", loadJudgeStoveNo, "B");
- if (drLgJudge == null)
- {
- DataRow drGpChange = d.GetRowByXmlId("JdgQcmGpJudgeChange.getJudgeStoveNo", loadJudgeStoveNo, "B");
- if (drGpChange != null)
- {
- lgJudgeStoveNo = drGpChange["judgeStoveNo"].ToString();
- }
- }
- return lgJudgeStoveNo;
- }
- public void QueryColligate(string applyCode, string stoveNo, string judgeStoveNo, string batchNo, string mscPline, string cic, string pic,
- string ordLnPk, string ordLnDlyPk, string craftSeq, string proOrdLnPk, string zcIsAllScap, string[] phyCodeMins,
- string zcApplyCode, string zcJudgeStoveNo, string zcBatchNo, bool clearData)
- {
- CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledTubePhyJudge.getConsignDetailColligate", applyCode, judgeStoveNo, batchNo,
- mscPline, cic, pic, ordLnPk, ordLnDlyPk, craftSeq, proOrdLnPk, phyCodeMins.ToList(), zcIsAllScap, zcApplyCode, zcJudgeStoveNo,
- zcBatchNo, _frmFlag );
- if (ccp.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo.ToString2());
- return;
- }
- DataTable dt = JsonHelper.toTable(ccp.ReturnObject.ToString2());
- if (dt == null || dt.Rows.Count == 0) return;
- dt.DefaultView.Sort = "processCode, craftSource desc, judgeStoveNo, batchNo, isMain desc, oldJudgeStoveNo, oldBatchNo, phyNameMin, sampleNo";
- DataTable dtSort = dt.DefaultView.ToTable();
- GridHelper.CopyDataToDatatable(dtSort, dataTable1, clearData);
- foreach (DataRow dr in dataTable1.Rows)
- {
- if (dr["ordLnPk"].ToString() != "") continue;
- dr["ordLnPk"] = ordLnPk;
- dr["ordLnDlyPk"] = ordLnDlyPk;
- dr["craftSeq"] = craftSeq;
- dr["mscPline"] = mscPline;
- }
- ForUltraGrid(zcIsAllScap, ordLnDlyPk);//处理表格
- }
- public void QueryPhy(string checkNo, string ordLnPk, string ordLnDlyPk, string processCode, string craftSeq, string mscPline,
- string cic, string pic, string craftProcess, string[] phyCodeMins)
- {
- CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledTubePhyJudge.getConsignDetailPhy", checkNo, ordLnPk,
- processCode, craftSeq, mscPline, cic, pic, craftProcess, phyCodeMins.ToList());
- if (ccp.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo.ToString2());
- return;
- }
- DataTable dt = JsonHelper.toTable(ccp.ReturnObject.ToString2());
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- if (dt.Rows.Count == 0) return;
- dataTable1.DefaultView.Sort = "processCode, craftSource desc, judgeStoveNo, batchNo, isMain desc, oldJudgeStoveNo, oldBatchNo, phyNameMin, sampleNo";
- DataTable dtSort = dataTable1.DefaultView.ToTable();
- GridHelper.CopyDataToDatatable(dtSort, dataTable1, true);
- foreach (DataRow dr in dataTable1.Rows)
- {
- if (dr["ordLnPk"].ToString() != "") continue;
- dr["ordLnPk"] = ordLnPk;
- dr["ordLnDlyPk"] = ordLnDlyPk;
- dr["craftSeq"] = craftSeq;
- dr["mscPline"] = mscPline;
- }
- ForUltraGrid("", "");//处理表格
- }
- private void ForUltraGrid(string isAllScrap, string zcOrdLnDlyPk)
- {
- // if (isAllScrap == "4" || _frmFlag == "phy" || zcOrdLnDlyPk.StartsWith("ZZB"))
- // {
- // ultraGrid1.DisplayLayout.Bands[0].Columns["chk"].Hidden = false;
- // }
- // else
- // {
- // ultraGrid1.DisplayLayout.Bands[0].Columns["chk"].Hidden = true;
- // }
- bool isGroup = false;//是否组炉炉号 (有检验编号以P开头的就是)
- foreach (var row in ultraGrid1.Rows)
- {
- GridEdite(row);
- if (row.GetValue("sampleId").StartsWith("P"))
- {
- isGroup = true;
- }
- //if (row.GetValue("resultSource") == "")
- //{
- // row.Cells["chk"].Value = DBNull.Value;
- // row.Cells["chk"].Activation = Activation.ActivateOnly;
- // row.Update();
- //}
- //else
- //{
- // if (row.GetValue("resultSource") == "0" && !row.GetValue("phyNameMin").Contains("冲击试验"))
- // {
- // if (row.GetValue("nkResult") != "" && row.GetValue("jfResult") != "")
- // {
- // row.Cells["chk"].Value = DBNull.Value;
- // row.Cells["chk"].Activation = Activation.ActivateOnly;
- // row.Update();
- // }
- // }
- //}
- }
- if (isGroup)
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["oldJudgeStoveNo"].Hidden = false;
- ultraGrid1.DisplayLayout.Bands[0].Columns["oldBatchNo"].Hidden = false;
- ultraGrid1.DisplayLayout.Bands[0].Columns["isMain"].Hidden = false;
- }
- else
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["oldJudgeStoveNo"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["oldBatchNo"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["isMain"].Hidden = true;
- }
- GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "stdMemo");
- }
- //public void Query(string lotNo, string lotNoGroup, string stoveNo, string judgeStoveNo, string batchNo, string ordLnPk, string ordLnDlyPk, string craftSeq,
- // string mscPline, string processCode, string pic, string[] phyCodeMins, string cic, string deptId, string steelStandrad, string craftSource,
- // string produccode, string steelcode, string plineCode, string processOrdLnPk, string craftProcess, DataRow zcApply)
- //{
- // string gpType = "";
- // DataTable dt = _d.GetTableByXmlId("QcmJhyPhyresultDAL.QueryPhyMinByBatchNo", ordLnPk, craftSeq, mscPline, processCode, pic,
- // judgeStoveNo, batchNo, lotNo, lotNoGroup, "0", phyCodeMins.Length, phyCodeMins, "", "0", plineCode, processOrdLnPk,
- // gpType, craftProcess);
- // GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- // DataRow drLgPline = _d.GetRowByXmlId("QcmGpJugdeApplyDAL.getPlineByStoveNo", stoveNo);
- // if (drLgPline != null)
- // {
- // if (drLgPline["plineCode"].ToString() == "C063" || drLgPline["plineCode"].ToString() == "C064")
- // {
- // gpType = "1";
- // }
- // else
- // {
- // gpType = "0";
- // }
- // }
- // DataTable dtFd = _d.GetTableByXmlId("QcmJhyPhyresultDAL.QueryPhyMinByBatchNo", ordLnPk, craftSeq, mscPline, processCode, pic,
- // judgeStoveNo, batchNo, lotNo, lotNoGroup, "1", phyCodeMins.Length, phyCodeMins, "", "0", plineCode,
- // processOrdLnPk, gpType, craftProcess);
- // GridHelper.CopyDataToDatatable(dtFd, dataTable1, false);
- // //处理预备硬度
- // for (int i = dataTable1.Rows.Count - 1; i >= 0; i--)
- // {
- // if (dataTable1.Rows[i]["nkResult"].ToString() == "" && dataTable1.Rows[i]["phyNameMin"].ToString().Contains("洛氏硬度")
- // && produccode == "S000046" && steelcode == "C209")
- // {
- // var drsYb = dataTable1.Select("phyNameMin like '%预备硬度%'");
- // if (drsYb.Length > 0)
- // {
- // dataTable1.Rows.Remove(dataTable1.Rows[i]);
- // }
- // }
- // }
- // if(deptId == "002001007010" || deptId == "phy")
- // {
- // DataRow drChemCnt = _d.GetRowByXmlId("CraftOrdDesignStdCic.getChemCnt", ordLnPk, craftSeq, "0", mscPline, processCode);
- // if (drChemCnt["count"].ToString() != "0" )
- // {
- // DataRow drCraftStd = _d.GetRowByXmlId("JdgCraftOrdDesignStd.getProductCnt", ordLnPk, craftSeq, "0");
- // DataTable dtChem = _d.GetTableByXmlId("QcmJhyElementsDAL.getPhyMinByBatchNo", ordLnPk, craftSeq, judgeStoveNo,
- // batchNo, processCode, cic, 0, drCraftStd["rateN"].ToString(), plineCode, processOrdLnPk, gpType);
- // GridHelper.CopyDataToDatatable(dtChem, dataTable1, false);
- // }
- // DataRow drChemCntFd = _d.GetRowByXmlId("CraftOrdDesignStdCic.getChemCnt", ordLnPk, craftSeq, "1", mscPline, processCode);
- // if (drChemCntFd["count"].ToString() != "0")
- // {
- // DataRow drCraftStdFd = _d.GetRowByXmlId("JdgCraftOrdDesignStd.getProductCnt", ordLnPk, craftSeq, "1");
- // DataTable dtChemFd = _d.GetTableByXmlId("QcmJhyElementsDAL.getPhyMinByBatchNo", ordLnPk, craftSeq, judgeStoveNo,
- // batchNo, processCode, cic, 1, drCraftStdFd["rateN"].ToString(), plineCode, processOrdLnPk, gpType);
- // GridHelper.CopyDataToDatatable(dtChemFd, dataTable1, false);
- // }
- // }
- // //如果有按炉、按生产批取样的试样组找不到,则查询热处理前的数据
- // //DataTable dtRcl = dataTable1.Clone();
- // //foreach();
- // DataTable dtRcl = _d.GetTableByXmlId("QcmJhyPhyresultDAL.QueryPhyMinByBatchNo", ordLnPk, craftSeq, mscPline, processCode, pic,
- // judgeStoveNo, batchNo, lotNo, lotNoGroup, "0", 0, new string[] { }, "", "1", plineCode, processOrdLnPk,
- // gpType, craftProcess);
- // var groupPhyMin = dataTable1.Select("sampleNo is null").GroupBy(a=>a["phyCodeMin"].ToString());
- // DataTable tmpRcl = dtRcl.Clone();
- // foreach (var phyMin in groupPhyMin)
- // {
- // DataRow[] drRcls = dtRcl.Select("phyCodeMin = '"+ phyMin.Key +"'");
- // bool addRcl = false;
- // foreach (var drRcl in drRcls)
- // {
- // if (drRcl["sampleNo"].ToString() == "") continue;
- // tmpRcl.Rows.Add(drRcl.ItemArray);
- // addRcl = true;
- // }
- // if (addRcl)
- // {
- // DataRow[] dr1s = dataTable1.Select("phyCodeMin = '"+ phyMin.Key +"'");
- // foreach (DataRow dr1 in dr1s)
- // {
- // dataTable1.Rows.Remove(dr1);
- // }
- // }
- // }
- // GridHelper.CopyDataToDatatable(tmpRcl, dataTable1, false);
- // //处理成品利库的炉号
- // if (zcApply != null)
- // {
- // if (zcApply["isAllScrap"].ToString() == "4")
- // {
- // DataTable dtZcJudge = _d.GetTableByXmlId("JdgQcmZcChemPhyDetail.getByBatchNoApplyCode", zcApply["judgeStoveNo"].ToString(),
- // zcApply["batchNo"].ToString(), zcApply["jugdeApplyCode"].ToString(), processCode);
- // foreach (DataRow dr in dataTable1.Rows)
- // {
- // DataRow[] drZcJudges = dtZcJudge.Select("checkNo = '" + dr["sampleId"].ToString() + "' and sampleNo = '" + dr["sampleNo"].ToString() + "' and phyCodeMin = '" + dr["phyCodeMin"].ToString() + "'");
- // if (drZcJudges.Length > 0)
- // {
- // dr["resultSource"] = drZcJudges[0]["resultSource"].ToString();
- // dr["nkResult"] = drZcJudges[0]["nkResult"].ToString();
- // dr["jfResult"] = drZcJudges[0]["jfResult"].ToString();
- // }
- // else
- // {
- // dr["resultSource"] = "";
- // dr["nkResult"] = "";
- // dr["jfResult"] = "";
- // }
- // }
- // }
- // }
- // dataTable1.DefaultView.Sort = "processCode, craftSource desc, judgeStoveNo, batchNo, isMain desc, oldJudgeStoveNo, oldBatchNo, phyNameMin, sampleNo";
- // DataTable dtSort = dataTable1.DefaultView.ToTable();
- // GridHelper.CopyDataToDatatable(dtSort, dataTable1, true);
- // //是否组炉炉号 (有检验编号以P开头的就是)
- // bool isGroup = false;
- // foreach (var row in ultraGrid1.Rows)
- // {
- // GridEdite(row);
- // if (row.GetValue("sampleId").StartsWith("P"))
- // {
- // isGroup = true;
- // }
- // if (row.GetValue("resultSource") == "")
- // {
- // row.Cells["chk"].Value = DBNull.Value;
- // row.Cells["chk"].Activation = Activation.ActivateOnly;
- // row.Update();
- // }
- // else
- // {
- // if (row.GetValue("resultSource") == "0" && !row.GetValue("phyNameMin").Contains("冲击试验"))
- // {
- // if (row.GetValue("nkResult") != "" && row.GetValue("jfResult") != "")
- // {
- // row.Cells["chk"].Value = DBNull.Value;
- // row.Cells["chk"].Activation = Activation.ActivateOnly;
- // row.Update();
- // }
- // }
- // }
- // }
- // if (isGroup)
- // {
- // ultraGrid1.DisplayLayout.Bands[0].Columns["oldJudgeStoveNo"].Hidden = false;
- // ultraGrid1.DisplayLayout.Bands[0].Columns["oldBatchNo"].Hidden = false;
- // ultraGrid1.DisplayLayout.Bands[0].Columns["isMain"].Hidden = false;
- // }
- // else
- // {
- // ultraGrid1.DisplayLayout.Bands[0].Columns["oldJudgeStoveNo"].Hidden = true;
- // ultraGrid1.DisplayLayout.Bands[0].Columns["oldBatchNo"].Hidden = true;
- // ultraGrid1.DisplayLayout.Bands[0].Columns["isMain"].Hidden = true;
- // }
- // if ((_frmFlag == "phy" || zcApply != null && zcApply["isAllScrap"].ToString() == "4") && deptId == "phy")
- // {
- // ultraGrid1.DisplayLayout.Bands[0].Columns["chk"].Hidden = false;
- // }
- // else
- // {
- // ultraGrid1.DisplayLayout.Bands[0].Columns["chk"].Hidden = true;
- // }
- // GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "stdMemo");
- //}
- //private void RemoveLgChem(DataTable dtLgChem)
- //{
- // DataRow[] drs601 = dtLgChem.Select("sampleNo like '601F%'", "sampleNo");
- // for(int i = drs601.Length - 2; i >= 0; i--)
- // {
- // dtLgChem.Rows.Remove(drs601[i]);
- // }
- // DataRow[] drs602 = dtLgChem.Select("sampleNo like '602F%'", "sampleNo");
- // for (int i = drs602.Length - 2; i >= 0; i--)
- // {
- // dtLgChem.Rows.Remove(drs602[i]);
- // }
- //}
- //public void Query(DataTable dtConsign, string craftSource, string[] phyCodeMins)
- //{
- // dataTable1.Clear();
- // DataRow drConsign2 = dtConsign.Rows[0];
- // string checkNo = drConsign2["checkNo"].ToString();
- // string judgeStoveNo = drConsign2["judgeStoveNo"].ToString();
- // string steelStandrad = drConsign2["steelStandrad"].ToString();
- // string processCode = drConsign2["processCode"].ToString();
- // string ordLnDlyPk = drConsign2["ordLnDlyPk"].ToString();
- // string craftSeq = drConsign2["craftSeq"].ToString();
- // string cic = drConsign2["cic"].ToString();
- // string pic = drConsign2["pic"].ToString();
- // string craftProcessCode = drConsign2["likuProcessCode"].ToString();
- // foreach (DataRow drConsign in dtConsign.Rows)
- // {
- // string batchNo = drConsign["batchNo"].ToString();
- // DataTable dt = _d.GetTableByXmlId("QcmJhyPhyresultDAL.QueryPhyMinByCheckNo", checkNo, judgeStoveNo, batchNo,
- // phyCodeMins.Length, phyCodeMins, craftSource, craftProcessCode);
- // GridHelper.CopyDataToDatatable(dt, dataTable1, false);
- // }
- // ////获取组炉子炉号信息
- // //if (drConsign2["zpMLh"].ToString() != "")
- // //{
- // // string[] stoveBatchNos = drConsign2["zpColl"].ToString().Split(',');
- // // string stoveBatchNoM = drConsign2["zpMLh"].ToString();
- // // foreach (string stoveBatchNo in stoveBatchNos)
- // // {
- // // if (stoveBatchNo == stoveBatchNoM) continue;
- // // string judgeStoveNoSub = stoveBatchNo.Split('+')[0];
- // // string batchNoSub = stoveBatchNo.Split('+')[1];
- // // DataRow drConsignSub = _d.GetRowByXmlId("JdgQcmZcCheckconsign.getByBatchNoOrdLnDlyPk",
- // // judgeStoveNoSub, batchNoSub, "0", processCode, ordLnDlyPk);
- // // string checkNoSub = drConsignSub["checkNo"].ToString();
- // // DataTable dt = _d.GetTableByXmlId("QcmJhyPhyresultDAL.QueryPhyMinByCheckNo", checkNoSub, judgeStoveNoSub, batchNoSub,
- // // phyCodeMins.Length, phyCodeMins, craftSource);
- // // foreach (DataRow dr in dt.Rows)
- // // {
- // // dr["pic"] = pic;
- // // }
- // // GridHelper.CopyDataToDatatable(dt, dataTable1, false);
- // // }
- // //}
- // //是否组炉炉号 (有检验编号以P开头的就是)
- // bool isGroup = false;
- // foreach (var row in ultraGrid1.Rows)
- // {
- // GridEdite(row);
- // if (row.GetValue("sampleId").StartsWith("P"))
- // {
- // isGroup = true;
- // }
- // if (row.GetValue("resultSource") == "")
- // {
- // row.Cells["chk"].Value = DBNull.Value;
- // row.Cells["chk"].Activation = Activation.ActivateOnly;
- // row.Update();
- // }
- // else
- // {
- // if (row.GetValue("resultSource") == "0" && !row.GetValue("phyNameMin").Contains("冲击试验"))
- // {
- // if (row.GetValue("nkResult") != "" && row.GetValue("jfResult") != "")
- // {
- // row.Cells["chk"].Value = DBNull.Value;
- // row.Cells["chk"].Activation = Activation.ActivateOnly;
- // row.Update();
- // }
- // }
- // }
- // }
- // if (isGroup)
- // {
- // ultraGrid1.DisplayLayout.Bands[0].Columns["oldJudgeStoveNo"].Hidden = false;
- // ultraGrid1.DisplayLayout.Bands[0].Columns["oldBatchNo"].Hidden = false;
- // ultraGrid1.DisplayLayout.Bands[0].Columns["isMain"].Hidden = false;
- // }
- // else
- // {
- // ultraGrid1.DisplayLayout.Bands[0].Columns["oldJudgeStoveNo"].Hidden = true;
- // ultraGrid1.DisplayLayout.Bands[0].Columns["oldBatchNo"].Hidden = true;
- // ultraGrid1.DisplayLayout.Bands[0].Columns["isMain"].Hidden = true;
- // }
- // GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "stdMemo");
- //}
- public void ClearData()
- {
- this.dataTable1.Clear();
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- var row = ultraGrid1.ActiveRow;
- PopupTextBox popupTextBox = new PopupTextBox(row.GetValue("stdMemo"), 4000);
- popupTextBox.TxtInfo.ReadOnly = true;
- popupTextBox.UltraPanel1.Visible = false;
- popupTextBox.Show();
- }
- private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
- {
- Color red = Color.FromArgb(255, 106, 106);
- Color yellow = Color.FromArgb(255, 246, 143);
- Color blue = Color.FromArgb(135, 206, 250);
- if (e.Row.GetValue("jfResult") == "0")
- {
- e.Row.Cells["jfResult"].Appearance.BackColor = red;
- }
- else if (e.Row.GetValue("jfResult") == "")
- {
- e.Row.Cells["jfResult"].Appearance.BackColor = yellow;
- }
- if (e.Row.GetValue("nkResult") == "0")
- {
- e.Row.Cells["nkResult"].Appearance.BackColor = red;
- }
- else if (e.Row.GetValue("nkResult") == "")
- {
- e.Row.Cells["nkResult"].Appearance.BackColor = yellow;
- }
- if (e.Row.GetValue("sampleId").StartsWith("F"))
- {
- e.Row.Cells["sampleId"].Appearance.BackColor = blue;
- }
- }
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- e.Cell.Row.Update();
- GridEdite(e.Cell.Row);
- }
- private void GridEdite(UltraGridRow row)
- {
- if (row.GetValue("chk") == "True")
- {
- foreach (UltraGridCell cell in row.Cells)
- {
- if (cell.Column.CellActivation == Activation.AllowEdit)
- {
- cell.Activation = Activation.AllowEdit;
- }
- }
- }
- else
- {
- foreach (UltraGridCell cell in row.Cells)
- {
- if (cell.Column.Key == "chk") continue;
- if (cell.Column.CellActivation == Activation.AllowEdit)
- {
- cell.Activation = Activation.ActivateOnly;
- }
- }
- }
- }
- private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- LotNoGroupInfoQueryFrm frm = new LotNoGroupInfoQueryFrm(ultraGrid1.GetActiveRowValue("lotNo"), _d.Ob);
- frm.ShowDialog();
- }
- }
- }
|