| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
- using Core.StlMes.Client.PlnSaleOrd.工序排产;
- using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.PlnSaleOrd
- {
- public partial class FrmJgProps : FrmBase
- {
- /// <summary>
- /// 订单编号
- /// </summary>
- private string _ProPlanId = "";
- /// <summary>
- /// 排产序号
- /// </summary>
- private string _GxPlanNo = "";
- /// <summary>
- /// 产线
- /// </summary>
- private string _PlineCode = "";
- /// <summary>
- /// 颜色
- /// </summary>
- private Color _color = new Color();
- private ArrayList _EntityList = null;
- public FrmJgProps()
- {
- this.IsLoadUserView = true;
- InitializeComponent();
- }
- private void FrmJgProps_Load(object sender, EventArgs e)
- {
- if (CustomInfo == null) { CustomInfo = ""; }
- BaseHelper.setUltraGridColumnMaxInput(ultraGridJg, new string[] { "GroupBlWtS","GroupWtS" });
- BaseHelper.InitCellPosition(ultraGridJg, new string[] { "JgGroupId", "GxPlanNo", "PlanSeqNo", "MinD", "MinH", "AimlengthBl", "AimCutLen", "LengthMin",
- "LengthMax", "GroupNumS", "SingleCutNun", "GroupBlNumS", "GroupBlWtS", "MatchnumJg", "MatchwtBl","MatchnumBl","BatchedWt","BatchedNum" ,
- "BatchedNumOut","RealBatchedWt","RealBatchedNum","ProducedNum","GroupWtS"});
- if (CustomInfo == "0") { splitContainer1.Panel2Collapsed = true; } else { BaseHelper.ForbidSort(ultraGridJg); }
- BaseHelper.GridColumnCount(ultraGridJg, new string[] { "GroupNumS", "GroupBlNumS" });
- BaseHelper.InitCellPositionMiddle(ultraGridJg, new string[] { "IsRepairPln", "IfMonitorJg", "IsPlanOk", "IfStoveIssued" });
- PlanHelper.InitDropPline("H", "", comPline, this.ob);
- PlanHelper.InitEditPline("H", "", ultraGridJg, this);
- PlanHelper.InitRepairType(ultraGridJg, this);
- BaseHelper.setOtherColumnReadOnly(ultraGridJg, new string[] { "CHC", "PlanTimeB", "RepairType", "PlanUsetime", "PlineCode" });
- BaseHelper.setColumnBackColor(ultraGridJg, new string[] { "PlineCode" });
- BaseHelper.setUltraGridColumnColor(ultraGridJg, new string[] { "CraftFileNo" }, Color.GreenYellow);
- _color = ultraGridJg.DisplayLayout.Override.RowSelectorAppearance.BackColor;
- InitColumnStyle();
- InitTime();
- EntityHelper.ShowGridCaption<PlnZyJgReadyEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- BaseHelper.setOtherColumnReadOnly(ultraGrid1, new string[] { "CHC" });
- BaseHelper.setUltraGridColumnMaxInput(ultraGrid1, new string[] { "PlanBlWt", "Singleweight", "UseBlWt" });
- BaseHelper.setUltraGridColumnBits(ultraGrid1, new string[] { "SingleCutNun", "PlanBlNum", "PlanJgNum", "UseBlNum", "OutJgNum" });
- BaseHelper.InitCellPosition(ultraGrid1, new string[] { "GxProSeq", "GxPlanNo","PlanBlWt", "Diameter", "SingleCutNun","PlanBlNum","PlanJgNum","Aimlength","CheckJVal","Outdiameter","Wallthick",
- "LengthMax","LengthMin","AimCutLen","AimlengthBl","MinH","MinD","UseBlNum", "UseBlWt", "OutJgNum"});
- BaseHelper.GridColumnSum(ultraGrid1, new string[] { "UseBlWt" });
- BaseHelper.GridColumnCount(ultraGrid1, new string[] { "OutJgNum", "UseBlNum" });
- BaseHelper.SetGroupBySum(ultraGrid1, new string[] { "PlanBlWt", "PlanBlNum", "PlanJgNum" }, "HeatPlanNo");
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query"://查询
- Query();
- break;
- case "Capacity"://产线能力维护
- Capacity();
- break;
- case "AddRepairPlan"://检修计划
- AddRepairPlan();
- break;
- case "DeleteRepairPlan"://删除检修计划
- DeleteRepairPlan();
- break;
- case "PlineChange"://产线调整
- PlineChange();
- break;
- case "TimeChange"://时间调整
- TimeChange();
- break;
- case "StatusChange"://状态调整
- StatusChange();
- break;
- case "InitData"://耗时初始化
- InitData();
- break;
- case "Spit"://拆分订单
- Spit();
- break;
- case "Merge"://合并订单
- Merge();
- break;
- case "Issued"://确认
- Issued("0");
- break;
- case "CancelIssued"://取消确认
- Issued("1");
- break;
- case "Confirm"://炉计划下发
- Issued("2");
- break;
- case "UinConfirm"://取消炉计划下发
- Issued("3");
- break;
- case "Export": //导出
- GridHelper.ulGridToExcel(ultraGridJg, "接箍排产信息");
- break;
- case "Close": //关闭
- this.Close();
- break;
- case "SetPlanFinish"://设置合同完成
- SetPlanFinish();
- break;
- case "Notice":
- tabNotice();
- break;
- default:
- break;
- }
- }
- /// <summary>
- /// 标识监制信息
- /// </summary>
- private void tabNotice()
- {
- this.ultraGridJg.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridJg.Rows.AsQueryable().Where(" CHC = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要操作的监制信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PlnGxJgPropSEntity plnOrderZgsTity = (PlnGxJgPropSEntity)row.ListObject;
- string plnOrderZgsEntity = JSONFormat.Format(plnOrderZgsTity);
- parmList.Add(plnOrderZgsEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
- ccp.MethodName = "tabNoticeH";
- ccp.ServerParams = new object[] { parmList, UserInfo.GetUserName(), "H" };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("标识监制成功!"))
- {
- Query();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 设置完成
- /// </summary>
- private void SetPlanFinish()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.SetPlanFinish(list, UserInfo.GetUserName(), "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- void Query()
- {
- string plineCode = "";//产线
- if (chcPline.Checked && comPline.Value != null) { plineCode = comPline.Value.ToString(); }
- if (!CustomInfo.Equals("0") && comPline.Text.Equals(""))
- {
- MessageUtil.ShowWarning("请选择产线!", ultraGridJg);
- return;
- }
- WaitingForm2 wf3 = new WaitingForm2("正在刷新,请稍候....");
- try
- {
- this.Cursor = Cursors.WaitCursor;
- string[] statusArray = contorlPlanStatus1.statusArr;
- string jgCode = "";//接箍码
- if (chcJgCode.Checked) { jgCode = txtJgCode.Text.Trim(); }
- string proPlanId = ""; //订单编号
- if (chcProPlanId.Checked) { proPlanId = txtProPlanId.Text.Trim(); }
- string planTimeB1 = "";
- string planTimeB2 = "";
- if (chcPlanTimeB.Checked && txtPlanTimeB2.Value != null && txtPlanTimeB1.Value != null)
- {
- planTimeB1 = DateTime.Parse(txtPlanTimeB1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
- planTimeB2 = DateTime.Parse(txtPlanTimeB2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
- }
- string planTimeE1 = "";
- string planTimeE2 = "";
- if (chcPlanTimeE.Checked && txtPlanTimeE2.Value != null && txtPlanTimeE1.Value != null)
- {
- planTimeE1 = DateTime.Parse(txtPlanTimeE1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
- planTimeE2 = DateTime.Parse(txtPlanTimeE2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
- }
- string orderSeq = "";
- if (chkOrder.Checked) { orderSeq = txtOrder.Text.ToString().Trim(); }
- List<PlnGxJgPropSEntity> listSource = EntityHelper.GetData<PlnGxJgPropSEntity>
- ("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlanOrderH",
- new object[] { plineCode, proPlanId, jgCode, statusArray, planTimeB1, planTimeB2, planTimeE1, planTimeE2, orderSeq }, this.ob);
- plnGxJgPropSEntityBindingSource.DataSource = listSource;
- if ((!_ProPlanId.Equals("") && !_GxPlanNo.Equals("")) || _EntityList != null)
- foreach (UltraGridRow ugr in ultraGridJg.Rows)
- {
- if (!_ProPlanId.Equals("") && !_GxPlanNo.Equals(""))
- {
- if (ugr.Cells["ProPlanId"].Text.Trim().Equals(_ProPlanId) && ugr.Cells["GxPlanNo"].Text.Trim().Equals(_GxPlanNo))
- {
- ugr.Activate();
- break;
- }
- }
- if (_EntityList != null)
- {
- for (int i = 0; i < _EntityList.Count; i++)
- {
- PlnGxJgPropSEntity entity = (PlnGxJgPropSEntity)_EntityList[i];
- if (ugr.Cells["ProPlanId"].Text.Trim().Equals(entity.ProPlanId) && ugr.Cells["GxPlanNo"].Text.Trim().Equals(entity.GxPlanNo))
- {
- ugr.Appearance.BackColor = Color.Wheat;
- ugr.Activate();
- }
- }
- }
-
- }
- foreach (UltraGridRow ugr in ultraGridJg.Rows)
- {
- if (ugr.Cells["IsNoticeEp"].Text.Equals("已通知"))
- {
- ugr.Cells["IsNoticeEp"].Appearance.BackColor = Color.GreenYellow;
- ugr.Activate();
- }
- }
- _ProPlanId = "";
- _GxPlanNo = "";
- _EntityList = null;
- if (comPline.Value != null)
- {
- _PlineCode = comPline.Value.ToString();
- }
- }
- finally
- {
- wf3.Close();
- this.Cursor = Cursors.Default;
- }
- }
- private void chcPline_CheckedChanged(object sender, EventArgs e)
- {
- if (chcPline.Checked) { comPline.ReadOnly = false; } else { comPline.ReadOnly = true; }
- if (chcProPlanId.Checked) { txtProPlanId.ReadOnly = false; } else { txtProPlanId.ReadOnly = true; }
- if (chcJgCode.Checked) { txtJgCode.ReadOnly = false; } else { txtJgCode.ReadOnly = true; }
- if (chcPlanTimeB.Checked) { txtPlanTimeB1.ReadOnly = false; txtPlanTimeB2.ReadOnly = false; } else { txtPlanTimeB1.ReadOnly = true; txtPlanTimeB2.ReadOnly = true; }
- if (chcPlanTimeE.Checked) { txtPlanTimeE1.ReadOnly = false; txtPlanTimeE2.ReadOnly = false; } else { txtPlanTimeE1.ReadOnly = true; txtPlanTimeE2.ReadOnly = true; }
- if (chkOrder.Checked) { txtOrder.ReadOnly = false; } else { txtOrder.ReadOnly = true; }
- }
- private void InitColumnStyle()
- {
- //ultraGridJg.DisplayLayout.Bands[0].Columns["Liku"].CellAppearance.BackColor = Color.FromArgb(255, 255, 128);
- // ultraGridJg.DisplayLayout.Bands[0].Columns["StockNum"].CellAppearance.BackColor = Color.FromArgb(255, 255, 128);
- //ultraGridJg.DisplayLayout.Bands[0].Columns["Liku"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
- ultraGridJg.DisplayLayout.Bands[0].Columns["PlanTimeB"].Format = "yyyy-MM-dd HH:mm:ss";
- ultraGridJg.DisplayLayout.Bands[0].Columns["PlanTimeB"].MaskInput = "yyyy-mm-dd hh:mm:ss";
- ultraGridJg.DisplayLayout.Bands[0].Columns["PlanTimeB"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime;
- //ultraGridJg.DisplayLayout.Bands[0].Columns["CraftFileLv2G"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- ultraGridJg.DisplayLayout.Bands[0].Columns["CraftFileNo"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- }
- private void InitTime()
- {
- DateTime now = DateTime.Now;
- DateTime d1 = new DateTime(now.Year, now.Month, 1);
- DateTime d2 = d1.AddMonths(1).AddSeconds(-1);
- txtPlanTimeB1.Value = d1;
- txtPlanTimeB2.Value = d2;
- txtPlanTimeE1.Value = d1;
- txtPlanTimeE2.Value = d2;
- }
- /// <summary>
- /// 拆分
- /// </summary>
- void Spit()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.SpitPlanOrder(list, "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 合并
- /// </summary>
- void Merge()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.MergePlanOrder(list, "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 时间调整
- /// </summary>
- void TimeChange()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.TimeChange(list, "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- ///状态调整
- /// </summary>
- void StatusChange()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.StatusChange(list, "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 检修计划
- /// </summary>
- void AddRepairPlan()
- {
- if (comPline.Value == null || comPline.Value.ToString().Equals(""))
- {
- MessageUtil.ShowTips("请选择产线!");
- return;
- }
- FrmJxjh frmJxjh = new FrmJxjh(this.ob, comPline.Value.ToString(), "H");
- frmJxjh.ShowDialog();
- Query();
- }
- /// <summary>
- /// 初始化
- /// </summary>
- void InitData()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.InitData(list, "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 产线能力维护
- /// </summary>
- void Capacity()
- {
- UltraGridRow ugr = ultraGridJg.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- if (ugr.Cells["IsRepairPln"].Text.Equals("Y"))
- {
- MessageUtil.ShowWarning("检修计划没有产线能力!",ultraGridJg);
- return;
- }
- FrmBaseMaterialHPl frmBaseMaterialEPl = new FrmBaseMaterialHPl(ugr.Cells["BlWlId"].Text, ugr.Cells["OutwlId"].Text, ugr.Cells["PlineCode"].Value.ToString(), this.ob, "");
- frmBaseMaterialEPl.ShowDialog();
- }
- private void ultraGridJg_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- PlanHelper.ControlCellEdit(e.Row);
- }
- private void ultraGridJg_MouseDown(object sender, MouseEventArgs e)
- {
- //查询界面,不能排序
- if (CustomInfo.Equals("0"))
- { return; }
- try
- { ultraGridJg.UpdateData(); }
- catch (Exception)
- {
- MessageUtil.ShowWarning("数据异常,请刷新数据!"); return;
- }
- if (e.Button == MouseButtons.Right)
- {
- //移动行
- ArrayList entityList = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- if (entityList == null || entityList.Count == 0)
- {
- return;
- }
- //定位行
- UIElement myUIElement = ultraGridJg.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
- UltraGridCell myCell = (UltraGridCell)myUIElement.GetContext(typeof(UltraGridCell));
- if (myCell == null) { return; }
- UltraGridRow ugr = myCell.Row;
- if (ugr == null) { return; }
- PlnGxJgPropSEntity entityD = (PlnGxJgPropSEntity)ugr.ListObject;
- bool flag = ProducHelper.SortPlanOrder(entityList, entityD, "H", CustomInfo, this.ob);
- if (flag)
- {
- _EntityList = entityList;
- Query();
- }
- }
- }
- string proPlanId = "";
- string gxPlanNo ="";
- private void ultraGridJg_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugrAc = ultraGridJg.ActiveRow;
- if (ugrAc == null)
- {
- return;
- }
- foreach (UltraGridRow ugr in ultraGridJg.Rows)
- {
- if (ugr.Cells["ProPlanId"].Text.Equals(ugrAc.Cells["ProPlanId"].Text))
- {
- ugr.RowSelectorAppearance.BackColor = Color.LightGreen;
- }
- else
- {
- ugr.RowSelectorAppearance.BackColor = _color;
- }
- if (ugr.Cells["PlanUsetime"].Value == null || ugr.Cells["PlanUsetime"].Value.ToString().Equals("") || Convert.ToDouble(ugr.Cells["PlanUsetime"].Value.ToString()) <= 0)
- {
- ugr.Cells["PlanUsetime"].Appearance.BackColor = Color.MistyRose;
- }
- if (ugr.Cells["ExeStatus"].Value.ToString().Equals("生产中"))
- {
- ugr.Cells["PlanTimeB"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
- }
- if (ugr.Cells["IsRepairPln"].Text.Equals("Y"))
- {
- ugr.Cells["PlanUsetime"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
- ugr.Cells["RepairType"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
- }
- }
- proPlanId = ugrAc.Cells["ProPlanId"].Text;
- gxPlanNo = ugrAc.Cells["GxPlanNo"].Text;
- if (CustomInfo == "0") return;
- QueryZyReadyF(proPlanId, gxPlanNo);
- }
- /// <summary>
- /// 查询虚拟炉计划
- /// </summary>
- /// <param name="proPlanId"></param>
- /// <param name="gxPlanNo"></param>
- private void QueryZyReadyF(string proPlanId, string gxPlanNo)
- {
- List<PlnZyJgReadyEntity> listSource = EntityHelper.GetData<PlnZyJgReadyEntity>
- ("com.steering.pss.plnsaleord.planStove.FrmPlanStoveH.queryPlanStovePlanId", new object[] { proPlanId, gxPlanNo }, this.ob);
- plnZyJgReadyEntityBindingSource.DataSource = listSource;
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- //没有实际炉计划,主炉计划变颜色
- if (ugr.Cells["HeatPlanSqe"].Value.ToString().Equals(""))
- {
- //ugr.RowSelectorAppearance.BackColor = Color.GreenYellow;
- ugr.Appearance.BackColor = Color.Orange;
- }
- }
- }
- private void ultraGridJg_CellChange(object sender, CellEventArgs e)
- {
- try
- {
- ultraGridJg.UpdateData();
- if (e.Cell.Column.Key.Equals("PlineCode"))
- {
- IQueryable<UltraGridRow> chcRows = ultraGridJg.Rows.AsQueryable().Where(a => a.GetValue("CHC") == "True");
- if (CustomInfo.Equals("0"))
- {
- e.Cell.Row.Cells["PlineName"].Value = e.Cell.Text;
- }
- else
- {
- if (chcRows != null && chcRows.Count() > 0)
- {
- foreach (UltraGridRow ugr in chcRows)
- {
- ugr.Cells["PlineCode"].Value = e.Cell.Value.ToString();
- ugr.Cells["PlineName"].Value = e.Cell.Text;
- }
- }
- }
- }
- }
- catch (Exception)
- {
- }
- }
- /// <summary>
- /// 产线调整
- /// </summary>
- private void PlineChange()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.PlineChange(list, "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- private void ultraGridJg_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGridJg.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHC"].Value = true;
- }
- }
- }
- /// <summary>
- /// 删除检修计划
- /// </summary>
- public void DeleteRepairPlan()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.DeleteRepairPlan(list, "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 确认(取消)
- /// </summary>
- private void Issued(string isFlag)
- {
- ArrayList list = ProducHelper.GetChcRows<PlnGxJgPropSEntity>(ultraGridJg);
- bool flag = ProducHelper.issuedPlanOrder(list, UserInfo.GetUserName(), isFlag, "H", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnGxJgPropSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnGxJgPropSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- private void ultraGridJg_ClickCellButton(object sender, CellEventArgs e)
- {
- UltraGridRow row = ultraGridJg.ActiveRow;
- if (e.Cell.Column.Key.Equals("CraftFileNo"))
- {
- string filePath = row.GetValue("CraftPath");
- dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob, filePath);
- askDown.Show();
- }
- //else if (e.Cell.Column.Key.Equals("CraftFileLv2G"))
- //{
- // string craftFileLv2G = row.GetValue("CraftFileLv2G");
- // dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob, craftFileLv2G);
- // askDown.Show();
- //}
- //else if (e.Cell.Column.Key.Equals("Liku"))
- //{
- // if (CustomInfo.Equals("2")) { return; }
- // string exeStatus = e.Cell.Row.Cells["ExeStatus"].Text.Trim();
- // if (!exeStatus.Equals("计划") && !exeStatus.Equals("生产中"))
- // {
- // MessageUtil.ShowWarning("不是计划、生产中订单,不能利库!");
- // return;
- // }
- // if (e.Cell.Row.Cells["IsRepairPln"].Text.Equals("Y"))
- // {
- // MessageUtil.ShowWarning("检修计划,不能利库!");
- // return;
- // }
- // string materialNo = e.Cell.Row.Cells["InwlId"].Text.Trim();//投入物料
- // string plineCode = e.Cell.Row.Cells["PlineCode"].Text.Trim();//产线
- // string proPlanId = e.Cell.Row.Cells["ProPlanId"].Text.Trim();//订单编号
- // string gxPlanNo = e.Cell.Row.Cells["GxPlanNo"].Text.Trim();//排产序号
- // Core.StlMes.Client.PlnSaleOrd.炉计划.FrmMaterialChoose frmMaterialChoose = new Core.StlMes.Client.PlnSaleOrd.炉计划.FrmMaterialChoose(materialNo, "E", proPlanId, gxPlanNo, UserInfo.GetUserName(), this.ob);
- // frmMaterialChoose.ShowDialog();
- // Query();
- //}
- }
-
- private int splitterDistance = 0;
- private void ultraExpandableGroupBox1_ExpandedStateChanged(object sender, EventArgs e)
- {
- if (ultraExpandableGroupBox1.Expanded == false)
- {
- this.splitContainer1.SplitterDistance = splitContainer1.Size.Height - 26;
- }
- else
- {
- this.splitContainer1.SplitterDistance = splitterDistance == 0 ? splitContainer1.Size.Height / 2 : splitterDistance;
- }
- }
- #region 炉计划操作
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- //case "Update"://修改判定炉号,备注
- // doUpdate();
- // break;
- //case "Issued"://下发
- // Issuedlu("0");
- // break;
- //case "IssuedU"://撤销
- // Issuedlu("1");
- // break;
- case "Delete"://删除炉计划
- doDelete();
- break;
- case "DeleteStatr"://删除剩余炉计划
- doDeleteStatr();
- break;
- //case "Print"://打印
- // doPrint();
- // break;
- default:
- break;
- }
- }
- /// <summary>
- /// 删除炉计划
- /// </summary>
- private void doDelete()
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- int countM = 0;
- int countC = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- if (!item.Cells["Planstatus"].Text.ToString().Equals("计划"))
- {
- MessageUtil.ShowTips("选中该炉计划不是计划状态,不能删除!");
- return;
- }
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list1.Add(item.Cells["HeatPlanSqe"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选炉计划信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是删除炉计划?") == DialogResult.No) return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveH";
- ccp.MethodName = "doDeleteLu";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) ;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- QueryZyReadyF(proPlanId, gxPlanNo);
- }
- }
- private void doDeleteStatr()
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- int countM = 0;
- int countC = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- if (item.Cells["Planstatus"].Text.ToString().Equals("计划"))
- {
- MessageUtil.ShowTips("选中该炉计划不是计划,不能删除!");
- return;
- }
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list1.Add(item.Cells["HeatPlanSqe"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选炉计划信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是删除剩余炉计划?") == DialogResult.No) return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveE";
- ccp.MethodName = "doDeleteStatr";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName(), "H" };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) ;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- QueryZyReadyF(proPlanId, gxPlanNo);
- }
- }
-
- private void ultraGrid1_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGrid1.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHC"].Value = true;
- }
- }
- }
- #endregion
- private void cmbPro_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- this.ultraGridJg.UpdateData();
- UltraGridRow row = this.ultraGridJg.ActiveRow;
- if (row == null)
- {
- return;
- }
- FrmProInformation fp = new FrmProInformation(ob, row.Cells["PrdcrNo"].Text, "", "H");
- fp.ShowDialog();
- }
- }
- }
|