| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099 |
- 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.Mes.Client.Comm.Tool;
- using System.Collections;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.StlMes.Client.Qcm;
- namespace Core.StlMes.Client.SaleOrder.ReviewForm
- {
-
- public partial class frmBaseMaterialPl : FrmBase
- {
- private DataSourceList<SlmBaseMaterialEntity> _materialEntityList = new DataSourceList<SlmBaseMaterialEntity>();
- private DataSourceList<SlmBaseMaterialAPlEntity> _materialAPlEntityList = new DataSourceList<SlmBaseMaterialAPlEntity>();
- private DataSourceList<SlmBaseMaterialBPlEntity> _materialBPlEntityList = new DataSourceList<SlmBaseMaterialBPlEntity>();
- private DataSourceList<SlmBaseMaterialCPlEntity> _materialCPlEntityList = new DataSourceList<SlmBaseMaterialCPlEntity>();
- private DataSourceList<SlmBaseMaterialDPlEntity> _materialDPlEntityList = new DataSourceList<SlmBaseMaterialDPlEntity>();
- private DataSourceList<SlmBaseMaterialEPlEntity> _materialEPlEntityList = new DataSourceList<SlmBaseMaterialEPlEntity>();
- private DataSourceList<SlmBaseMaterialFPlEntity> _materialFPlEntityList = new DataSourceList<SlmBaseMaterialFPlEntity>();
- private DataSourceList<SlmBaseMaterialJPlEntity> _materialJPlEntityList = new DataSourceList<SlmBaseMaterialJPlEntity>();
- private DataSourceList<SlmBaseMaterialIPlEntity> _materialIPlEntityList = new DataSourceList<SlmBaseMaterialIPlEntity>();
- Boolean flag = false;
- private string[] _plines = new string[0];
- public frmBaseMaterialPl()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void frmBaseMaterialPl_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<SlmBaseMaterialAPlEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmBaseMaterialBPlEntity>(ultraGrid2.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmBaseMaterialCPlEntity>(ultraGrid3.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmBaseMaterialDPlEntity>(ultraGrid4.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmBaseMaterialEPlEntity>(ultraGrid5.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmBaseMaterialFPlEntity>(ultraGrid6.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmBaseMaterialJPlEntity>(ultraGrid7.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmBaseMaterialIPlEntity>(ultraGrid8.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmBaseMaterialEntity>(ultraGrid9.DisplayLayout.Bands[0]);
- GetPagePermission();
- _plines = getPlinePermission();
- flag = true;
- }
- private void QueryMaterial()
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- if (IsExitEdit())
- {
- if (ultraTabControl1.ActiveTab.Key == "1")
- {
- QueryMaterialAPl();
- }
- else if (ultraTabControl1.ActiveTab.Key == "2")
- {
- QueryMaterialBPl();
- }
- else if (ultraTabControl1.ActiveTab.Key == "3")
- {
- QueryMaterialCPl();
- }
- else if (ultraTabControl1.ActiveTab.Key == "4")
- {
- QueryMaterialDPl();
- }
- else if (ultraTabControl1.ActiveTab.Key == "5")
- {
- QueryMaterialEPl();
- }
- else if (ultraTabControl1.ActiveTab.Key == "6")
- {
- QueryMaterialFPl();
- }
- else if (ultraTabControl1.ActiveTab.Key == "7")
- {
- QueryMaterialHPl();
- }
- else if (ultraTabControl1.ActiveTab.Key == "8")
- {
- QueryMaterialIPl();
- }
- else if (ultraTabControl1.ActiveTab.Key == "9")
- {
- QueryBaseMaterial();
- }
- }
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- /// <summary>
- /// 查询基础物料编码
- /// </summary>
- private void QueryBaseMaterial()
- {
- _materialEntityList = EntityHelper.GetData<SlmBaseMaterialEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterial", new object[] { }, ob);
- _materialEntityList.AcceptChanges();
- slmBaseMaterialEntityBindingSource.DataSource = _materialEntityList;
- }
- /// <summary>
- /// 通过主键查询基础物料码
- /// </summary>
- /// <returns></returns>
- private DataRow QueryBaseMaterialByPk(string materialNo)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialByPk",
- new object[] { materialNo }, ob);
- if (dt.Rows.Count > 0)
- {
- return dt.Rows[0];
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 查询电炉
- /// </summary>
- private void QueryMaterialAPl()
- {
- _materialAPlEntityList = EntityHelper.GetData<SlmBaseMaterialAPlEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialAPl", new object[] { _plines }, ob);
- _materialAPlEntityList.AcceptChanges();
- slmBaseMaterialAPlEntityBindingSource.DataSource = _materialAPlEntityList;
- }
- /// <summary>
- /// 查询铸造
- /// </summary>
- private void QueryMaterialBPl()
- {
- _materialBPlEntityList = EntityHelper.GetData<SlmBaseMaterialBPlEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialBPl", new object[] { _plines }, ob);
- _materialBPlEntityList.AcceptChanges();
- slmBaseMaterialBPlEntityBindingSource.DataSource = _materialBPlEntityList;
- }
- /// <summary>
- /// 查询锻造
- /// </summary>
- private void QueryMaterialCPl()
- {
- _materialCPlEntityList = EntityHelper.GetData<SlmBaseMaterialCPlEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialCPl", new object[] { _plines }, ob);
- _materialCPlEntityList.AcceptChanges();
- slmBaseMaterialCPlEntityBindingSource.DataSource = _materialCPlEntityList;
- }
- /// <summary>
- /// 查询轧制
- /// </summary>
- private void QueryMaterialDPl()
- {
- _materialDPlEntityList = EntityHelper.GetData<SlmBaseMaterialDPlEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialDPl", new object[] { _plines }, ob);
- _materialDPlEntityList.AcceptChanges();
- slmBaseMaterialDPlEntityBindingSource.DataSource = _materialDPlEntityList;
- }
- /// <summary>
- /// 查询墩拔扩
- /// </summary>
- private void QueryMaterialEPl()
- {
- _materialEPlEntityList = EntityHelper.GetData<SlmBaseMaterialEPlEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialEPl", new object[] { _plines }, ob);
- _materialEPlEntityList.AcceptChanges();
- slmBaseMaterialEPlEntityBindingSource.DataSource = _materialEPlEntityList;
- }
- /// <summary>
- /// 查询热处理
- /// </summary>
- private void QueryMaterialFPl()
- {
- _materialFPlEntityList = EntityHelper.GetData<SlmBaseMaterialFPlEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialFPl", new object[] { _plines }, ob);
- _materialFPlEntityList.AcceptChanges();
- slmBaseMaterialFPlEntityBindingSource.DataSource = _materialFPlEntityList;
- }
- /// <summary>
- /// 查询接箍
- /// </summary>
- private void QueryMaterialHPl()
- {
- _materialJPlEntityList = EntityHelper.GetData<SlmBaseMaterialJPlEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialHPl", new object[] { _plines }, ob);
- _materialJPlEntityList.AcceptChanges();
- slmBaseMaterialJPlEntityBindingSource.DataSource = _materialJPlEntityList;
- }
- /// <summary>
- /// 查询加工
- /// </summary>
- private void QueryMaterialIPl()
- {
- _materialIPlEntityList = EntityHelper.GetData<SlmBaseMaterialIPlEntity>(
- "com.steering.pss.sale.order.CoreBaseMaterialPl.getBaseMaterialIPl", new object[] { _plines }, ob);
- _materialIPlEntityList.AcceptChanges();
- slmBaseMaterialIPlEntityBindingSource.DataSource = _materialIPlEntityList;
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "doQuery":
- QueryMaterial();
- break;
- case "doUpdate":
- UpdateMaterialAPl();
- break;
- case "doDelete":
- DeleteMaterialAPl();
- break;
- case "Export":
- DoExport();
- break;
- case "doClose":
- this.Close();
- break;
- }
- }
- private void DoExport()
- {
- if (ultraTabControl1.ActiveTab.Key == "1")
- {
- GridHelper.ulGridToExcel(ultraGrid1, "电炉产线能力");
- }
- else if (ultraTabControl1.ActiveTab.Key == "2")
- {
- GridHelper.ulGridToExcel(ultraGrid2, "铸造产线能力");
- }
- else if (ultraTabControl1.ActiveTab.Key == "3")
- {
- GridHelper.ulGridToExcel(ultraGrid3, "锻造产线能力");
- }
- else if (ultraTabControl1.ActiveTab.Key == "4")
- {
- GridHelper.ulGridToExcel(ultraGrid4, "轧制产线能力");
- }
- else if (ultraTabControl1.ActiveTab.Key == "5")
- {
- GridHelper.ulGridToExcel(ultraGrid5, "镦拔扩产线能力");
- }
- else if (ultraTabControl1.ActiveTab.Key == "6")
- {
- GridHelper.ulGridToExcel(ultraGrid6, "热处理产线能力");
- }
- else if (ultraTabControl1.ActiveTab.Key == "7")
- {
- GridHelper.ulGridToExcel(ultraGrid7, "接箍加工产线能力");
- }
- else if (ultraTabControl1.ActiveTab.Key == "8")
- {
- GridHelper.ulGridToExcel(ultraGrid8, "加工产线能力");
- }
- else if (ultraTabControl1.ActiveTab.Key == "9")
- {
- GridHelper.ulGridToExcel(ultraGrid9, "产成品物料");
- }
- }
- /// <summary>
- /// 修改电炉产线能力
- /// </summary>
- private void UpdateMaterialAPl()
- {
- ultraGrid1.UpdateData();
- ultraGrid2.UpdateData();
- ultraGrid3.UpdateData();
- ultraGrid4.UpdateData();
- ultraGrid5.UpdateData();
- ultraGrid6.UpdateData();
- ultraGrid7.UpdateData();
- ultraGrid8.UpdateData();
- ultraGrid9.UpdateData();
- var ultraGrid9Rows = ultraGrid9.Rows.Where(a=>a.GetValue("Chk") == "True");
- IQueryable<UltraGridRow> ultraGrid1ChkRows = ultraGrid1.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid2ChkRows = ultraGrid2.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid3ChkRows = ultraGrid3.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid4ChkRows = ultraGrid4.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid5ChkRows = ultraGrid5.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid6ChkRows = ultraGrid6.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid7ChkRows = ultraGrid7.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid8ChkRows = ultraGrid8.Rows.AsQueryable().Where("CHK = 'True'");
- int chkCnt = ultraGrid1ChkRows.Count() + ultraGrid2ChkRows.Count() + ultraGrid3ChkRows.Count()
- + ultraGrid4ChkRows.Count() + ultraGrid5ChkRows.Count() + ultraGrid6ChkRows.Count()
- + ultraGrid7ChkRows.Count() + ultraGrid8ChkRows.Count() + ultraGrid9Rows.Count();
- if (chkCnt == 0)
- {
- MessageUtil.ShowWarning("请选择记录");
- return;
- }
- ArrayList list = new ArrayList();
- ArrayList list1 = new ArrayList();
- ArrayList list2 = new ArrayList();
- ArrayList list3 = new ArrayList();
- ArrayList list4 = new ArrayList();
- ArrayList list5 = new ArrayList();
- ArrayList list6 = new ArrayList();
- ArrayList list7 = new ArrayList();
- ArrayList list8 = new ArrayList();
- ArrayList list9 = new ArrayList();
- string msg = "";
- string fieldName = "";
- foreach (UltraGridRow ugr in ultraGrid1ChkRows)
- {
- SlmBaseMaterialAPlEntity baseMaterialAPl = EntityHelper.CopyEntity<SlmBaseMaterialAPlEntity>(ugr.ListObject);
- baseMaterialAPl.UpdateName = UserInfo.GetUserName();
- if (EntityHelper.CheckEntity(baseMaterialAPl, out msg, out fieldName) == false)
- {
- MessageUtil.ShowWarning(msg);
- return;
- }
- string strJSON = JSONFormat.Format(baseMaterialAPl);
- list1.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid2ChkRows)
- {
- SlmBaseMaterialBPlEntity baseMaterialBPl = EntityHelper.CopyEntity<SlmBaseMaterialBPlEntity>(ugr.ListObject);
- baseMaterialBPl.UpdateName = UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialBPl);
- list2.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid3ChkRows)
- {
- SlmBaseMaterialCPlEntity baseMaterialCPl = EntityHelper.CopyEntity<SlmBaseMaterialCPlEntity>(ugr.ListObject);
- baseMaterialCPl.UpdateName = UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialCPl);
- list3.Add(strJSON);
- }
- IQueryable<SlmBaseMaterialDPlEntity> querableMaterialD = ultraGrid4ChkRows.Select(a => (SlmBaseMaterialDPlEntity)a.ListObject);
- if (CheckMaterialDIsSame(querableMaterialD, out msg))
- {
- MessageUtil.ShowWarning(msg);
- return;
- }
- foreach (UltraGridRow ugr in ultraGrid4ChkRows)
- {
- SlmBaseMaterialDPlEntity baseMaterialDPl = EntityHelper.CopyEntity<SlmBaseMaterialDPlEntity>(ugr.ListObject);
- baseMaterialDPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialDPl);
- list4.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid4ChkRows)
- {
- SlmBaseMaterialDPlEntity baseMaterialDPl = EntityHelper.CopyEntity<SlmBaseMaterialDPlEntity>(ugr.ListObject);
- if (CheckMaterialD(baseMaterialDPl, list4, out msg))
- {
- MessageUtil.ShowWarning(msg);
- return;
- }
- }
- //if (CheckMaterialD(list4, out msg))
- //{
- // MessageUtil.ShowWarning(msg);
- // return;
- //}
- foreach (UltraGridRow ugr in ultraGrid5ChkRows)
- {
- SlmBaseMaterialEPlEntity baseMaterialEPl = EntityHelper.CopyEntity<SlmBaseMaterialEPlEntity>(ugr.ListObject);
- baseMaterialEPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialEPl);
- list5.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid6ChkRows)
- {
- SlmBaseMaterialFPlEntity baseMaterialFPl = EntityHelper.CopyEntity<SlmBaseMaterialFPlEntity>(ugr.ListObject);
- baseMaterialFPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialFPl);
- list6.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid7ChkRows)
- {
- SlmBaseMaterialJPlEntity baseMaterialJPl = EntityHelper.CopyEntity<SlmBaseMaterialJPlEntity>(ugr.ListObject);
- baseMaterialJPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialJPl);
- list7.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid8ChkRows)
- {
- SlmBaseMaterialIPlEntity baseMaterialIPl = EntityHelper.CopyEntity<SlmBaseMaterialIPlEntity>(ugr.ListObject);
- baseMaterialIPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialIPl);
- list8.Add(strJSON);
- }
- foreach (var row in ultraGrid9Rows)
- {
- SlmBaseMaterialEntity baseMaterial = EntityHelper.CopyEntity<SlmBaseMaterialEntity>(row.ListObject);
- DataRow rowBaseMaterial = QueryBaseMaterialByPk(baseMaterial.MaterialNo.ToString());
- if (rowBaseMaterial != null && rowBaseMaterial["FIRST_PRDC"].ToString() == "1")
- {
- if (baseMaterial.AutoCraft == "True")
- {
- MessageUtil.ShowWarning("该物料为首次生产,不能设置自动生成工艺文件!");
- row.SetCellActive("AutoCraft");
- return;
- }
- }
- baseMaterial.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterial);
- list9.Add(strJSON);
- }
- list.Add(list1);
- list.Add(list2);
- list.Add(list3);
- list.Add(list4);
- list.Add(list5);
- list.Add(list6);
- list.Add(list7);
- list.Add(list8);
- list.Add(list9);
- if (MessageUtil.ShowYesNoAndQuestion("是否修改?") == DialogResult.No)
- {
- return;
- }
- ServerHelper.SetData("com.steering.pss.sale.order.CoreBaseMaterialPl.updateBaseMaterial", new object[] { list}, ob);
- _materialAPlEntityList.AcceptChanges();
- _materialBPlEntityList.AcceptChanges();
- _materialCPlEntityList.AcceptChanges();
- _materialDPlEntityList.AcceptChanges();
- _materialEPlEntityList.AcceptChanges();
- _materialFPlEntityList.AcceptChanges();
- _materialIPlEntityList.AcceptChanges();
- _materialJPlEntityList.AcceptChanges();
- _materialEntityList.AcceptChanges();
- MessageUtil.ShowTips("修改成功!");
- //QueryMaterialAPl();
- }
- private bool CheckMaterialDIsSame(IQueryable<SlmBaseMaterialDPlEntity> querableMaterialD, out string msg)
- {
- msg = "";
- var varList = querableMaterialD.GroupBy(a =>
- new
- {
- a.OutMaterialNo, a.InMaterialNo
- });
- foreach (var var in varList)
- {
- IQueryable<SlmBaseMaterialDPlEntity> groupList = querableMaterialD.Where(
- a => a.InMaterialNo == var.Key.InMaterialNo && a.OutMaterialNo == var.Key.OutMaterialNo);
- int cnt = groupList.Select(a => a.PlineLevel).Distinct().Count();
- if (cnt != groupList.Count())
- {
- msg = "保存的数据中优先级存在重复项!\r\n投入物料[" + groupList.First().InMaterialDesc + "]-产出物料["
- + groupList.First().OutMaterialDesc +"]";
- return true;
- }
- }
- return false;
- }
- private bool CheckMaterialD(SlmBaseMaterialDPlEntity baseMaterialDPl, ArrayList list, out string msg)
- {
- msg = "";
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreBaseMaterialPl.queryMaterialDLvCnt",
- new object[] { JSONFormat.Format(baseMaterialDPl), list }, ob);
- if (dt.Rows.Count > 0)
- {
- msg = "系统中存在相同的优先级[" + dt.Rows[0]["PLINE_LEVEL"] + "]\r\n投入物料["
- + baseMaterialDPl.InMaterialDesc + "]-产出物料["+ baseMaterialDPl.OutMaterialDesc +"]";
- return true;
- }
- return false;
- }
- //private void InitColumn()
- //{
- // ///电炉
- // setColumnReadOnly(ultraGrid1, new String[] { "InMaterialNo", "OutMaterialNo", "PlineCode", "PlineName", "InMaterialDesc", "OutMaterialDesc" });
- // setColumnBackColor(ultraGrid1, new String[] { "HrCapcty", "PrdRate", "DisableFl" });
- // ///铸造
- // setColumnReadOnly(ultraGrid2, new String[] { "InMaterialNo", "OutMaterialNo", "PlineCode", "PlineName" });
- // setColumnBackColor(ultraGrid2, new String[] { "HrCapcty", "PrdRate", "DisableFl" });
- // ///锻造
- // setColumnReadOnly(ultraGrid3, new String[] { "InMaterialNo", "OutMaterialNo", "PlineCode", "PlineName" });
- // setColumnBackColor(ultraGrid3, new String[] { "HrCapcty", "PrdRate", "DisableFl" });
- // ///轧管
- // setColumnReadOnly(ultraGrid4, new String[] { "InMaterialNo", "OutMaterialNo", "PlineCode", "PlineName" });
- // setColumnBackColor(ultraGrid4, new String[] { "HrCapcty", "PrdRate", "DisableFl", "RolLenMin", "RolLenMax", "CropEnd", "MandrelSize", "DisableFl", "DblLenMax" }); ;
- // ///墩拔扩
- // setColumnReadOnly(ultraGrid5, new String[] { "InMaterialNo", "OutMaterialNo", "PlineCode", "PlineName" });
- // setColumnBackColor(ultraGrid5, new String[] { "HrCapcty", "PrdRate", "DisableFl" });
- // ///热处理
- // setColumnReadOnly(ultraGrid6, new String[] { "InMaterialNo", "OutMaterialNo", "PlineCode", "PlineName" });
- // setColumnBackColor(ultraGrid6, new String[] { "HrCapcty", "PrdRate", "DisableFl" });
- // ///接箍
- // setColumnReadOnly(ultraGrid7, new String[] { "InMaterialNo", "OutMaterialNo", "PlineCode", "PlineName" });
- // setColumnBackColor(ultraGrid7, new String[] { "HrCapcty", "PrdRate", "DisableFl" });
- //}
- ///// <summary>
- ///// 设置列背景颜色
- ///// </summary>
- ///// <param name="ugr">UltraGrid</param>
- ///// <param name="columns">列数组</param>
- //private void setColumnBackColor(UltraGrid ugr, String[] columns)
- //{
- // for (int i = 0; i < columns.Length; i++)
- // {
- // ugr.DisplayLayout.Bands[0].Columns[columns[i]].CellAppearance.BackColor = Color.FromArgb(255, 255, 128);
- // }
- //}
- ///// <summary>
- ///// 设置列只可读
- ///// </summary>
- ///// <param name="ugr">UltraGrid</param>
- ///// <param name="columns">列数组</param>
- //private void setColumnReadOnly(UltraGrid ugr, String[] columns)
- //{
- // for (int i = 0; i < columns.Length; i++)
- // {
- // ugr.DisplayLayout.Bands[0].Columns[columns[i]].CellActivation = Activation.ActivateOnly;
- // }
- //}
- /// <summary>
- /// 判断实体类列数据是否为数字
- /// </summary>
- /// <param name="obj"></param>
- /// <param name="columns"></param>
- /// <returns></returns>
- private Boolean checkIsNumber(Object obj, List<String> columns)
- {
- System.Reflection.PropertyInfo[] properties = obj.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public);
- foreach (System.Reflection.PropertyInfo item in properties)
- {
- string name = item.Name;
- string value = item.GetValue(obj, null).ToString();
- if (columns.Contains(name))
- {
- if (!value.Equals("") && !StringUtil.IsNumber(value))
- {
- return false;
- }
- }
- }
- return true;
- }
- private void ControlCellEdit(UltraGridRow row)
- {
- foreach (UltraGridCell cell in row.Cells)
- {
- if (cell.Column.CellAppearance.BackColor == Color.FromArgb(255, 255, 128))
- {
- if (row.Cells["CHK"].Value.ToString() == "True") cell.Activation = Activation.AllowEdit;
- else cell.Activation = Activation.ActivateOnly;
- }
- }
- }
- private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- ControlCellEdit(e.Row);
- }
- private void ultraGrid2_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- ControlCellEdit(e.Row);
- }
- private void ultraGrid3_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- ControlCellEdit(e.Row);
- }
- private void ultraGrid4_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- ControlCellEdit(e.Row);
- }
- private void ultraGrid5_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- ControlCellEdit(e.Row);
- }
- private void ultraGrid6_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- ControlCellEdit(e.Row);
- }
- private void ultraGrid7_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- ControlCellEdit(e.Row);
- }
- private void ultraGrid8_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- ControlCellEdit(e.Row);
- }
-
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- ultraGrid1.UpdateData();
- SlmBaseMaterialAPlEntity materialAPlEntity = (SlmBaseMaterialAPlEntity)e.Cell.Row.ListObject;
- _materialAPlEntityList.Change(materialAPlEntity);
- }
- private void ultraGrid2_CellChange(object sender, CellEventArgs e)
- {
- e.Cell.Row.Update();
- SlmBaseMaterialBPlEntity materialBPlEntity = (SlmBaseMaterialBPlEntity)e.Cell.Row.ListObject;
- _materialBPlEntityList.Change(materialBPlEntity);
- }
- private void ultraGrid3_CellChange(object sender, CellEventArgs e)
- {
- e.Cell.Row.Update();
- SlmBaseMaterialCPlEntity materialCPlEntity = (SlmBaseMaterialCPlEntity)e.Cell.Row.ListObject;
- _materialCPlEntityList.Change(materialCPlEntity);
- }
- private void ultraGrid4_CellChange(object sender, CellEventArgs e)
- {
- e.Cell.Row.Update();
- SlmBaseMaterialDPlEntity materialDPlEntity = (SlmBaseMaterialDPlEntity)e.Cell.Row.ListObject;
- _materialDPlEntityList.Change(materialDPlEntity);
- }
- private void ultraGrid5_CellChange(object sender, CellEventArgs e)
- {
- e.Cell.Row.Update();
- SlmBaseMaterialEPlEntity materialEPlEntity = (SlmBaseMaterialEPlEntity)e.Cell.Row.ListObject;
- _materialEPlEntityList.Change(materialEPlEntity);
- }
- private void ultraGrid6_CellChange(object sender, CellEventArgs e)
- {
- e.Cell.Row.Update();
- SlmBaseMaterialFPlEntity materialFPlEntity = (SlmBaseMaterialFPlEntity)e.Cell.Row.ListObject;
- _materialFPlEntityList.Change(materialFPlEntity);
- }
- private void ultraGrid7_CellChange(object sender, CellEventArgs e)
- {
- e.Cell.Row.Update();
- SlmBaseMaterialJPlEntity materialJPlEntity = (SlmBaseMaterialJPlEntity)e.Cell.Row.ListObject;
- _materialJPlEntityList.Change(materialJPlEntity);
- }
- private void ultraGrid8_CellChange(object sender, CellEventArgs e)
- {
- e.Cell.Row.Update();
- SlmBaseMaterialIPlEntity materialIPlEntity = (SlmBaseMaterialIPlEntity)e.Cell.Row.ListObject;
- _materialIPlEntityList.Change(materialIPlEntity);
- }
- private bool IsExitEdit()
- {
- if(_materialAPlEntityList.IsChanged || _materialBPlEntityList.IsChanged || _materialCPlEntityList.IsChanged
- || _materialDPlEntityList.IsChanged || _materialEPlEntityList.IsChanged || _materialFPlEntityList.IsChanged
- || _materialIPlEntityList.IsChanged || _materialJPlEntityList.IsChanged || _materialEntityList.IsChanged)
- {
- if (MessageUtil.ShowYesNoAndQuestion("系统检测到有数据修改,是否放弃编辑?") == DialogResult.Yes)
- {
- _materialAPlEntityList.IsChanged = false;
- _materialBPlEntityList.IsChanged = false;
- _materialCPlEntityList.IsChanged = false;
- _materialDPlEntityList.IsChanged = false;
- _materialEPlEntityList.IsChanged = false;
- _materialFPlEntityList.IsChanged = false;
- _materialIPlEntityList.IsChanged = false;
- _materialJPlEntityList.IsChanged = false;
- _materialEntityList.IsChanged = false;
- return true;
- }
- else
- {
- return false;
- }
- }
- return true;
- }
- private void ultraTabControl1_ActiveTabChanging(object sender, Infragistics.Win.UltraWinTabControl.ActiveTabChangingEventArgs e)
- {
- if (IsExitEdit() == false)
- {
- e.Cancel = true;
- }
- }
- /// <summary>
- /// 获取TAB页面权限
- /// </summary>
- /// <param name="deptCode"></param>
- /// <returns></returns>
- public void GetPagePermission()
- {
-
- for (int i = 0; i < ultraTabControl1.Tabs.Count; i++)
- {
- ultraTabControl1.Tabs[i].Visible = false;
- }
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreBaseMaterialPl.GetPagePermission", new object[] { this.ValidDataPurviewIds }, this.ob);
- ArrayList proCodeList = new ArrayList();
- if (dt != null && dt.Rows.Count > 0)
- {
- foreach(DataRow dr in dt.Rows){
- proCodeList.Add(dr[0]);
- }
- }
- ultraTabControl1.Tabs[8].Visible = true;
- if (proCodeList != null && proCodeList.Count > 0)
- {
- if (proCodeList.Contains("A"))
- {
- ultraTabControl1.Tabs[0].Visible = true;
- }
- if (proCodeList.Contains("B"))
- {
- ultraTabControl1.Tabs[1].Visible = true;
- }
- if (proCodeList.Contains("C"))
- {
- ultraTabControl1.Tabs[2].Visible = true;
- }
- if (proCodeList.Contains("D"))
- {
- ultraTabControl1.Tabs[3].Visible = true;
- }
- if (proCodeList.Contains("E"))
- {
- ultraTabControl1.Tabs[4].Visible = true;
- }
- if (proCodeList.Contains("F"))
- {
- ultraTabControl1.Tabs[5].Visible = true;
- }
- if (proCodeList.Contains("H"))
- {
- ultraTabControl1.Tabs[6].Visible = true;
- }
- if (proCodeList.Contains("G"))
- {
- ultraTabControl1.Tabs[7].Visible = true;
- }
- }
- }
- /// <summary>
- /// 产线权限
- /// </summary>
- /// <returns></returns>
- public string[] getPlinePermission()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreBaseMaterialPl.getPlinePermission", new object[] { this.ValidDataPurviewIds }, this.ob);
- string[] plines=new string[0];
- if (dt != null && dt.Rows.Count > 0)
- {
- plines = new string[dt.Rows.Count];
- for (int i=0;i< dt.Rows.Count;i++)
- {
- plines[i] = dt.Rows[i][0].ToString();
- }
- }
- return plines;
- }
- private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (!flag)
- {
- return;
- }
- try
- {
- this.Cursor = Cursors.WaitCursor;
- QueryMaterial();
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- public void DeleteMaterialAPl()
- {
- ultraGrid1.UpdateData();
- ultraGrid2.UpdateData();
- ultraGrid3.UpdateData();
- ultraGrid4.UpdateData();
- ultraGrid5.UpdateData();
- ultraGrid6.UpdateData();
- ultraGrid7.UpdateData();
- ultraGrid8.UpdateData();
- ultraGrid9.UpdateData();
- IQueryable<UltraGridRow> ultraGrid1ChkRows = ultraGrid1.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid2ChkRows = ultraGrid2.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid3ChkRows = ultraGrid3.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid4ChkRows = ultraGrid4.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid5ChkRows = ultraGrid5.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid6ChkRows = ultraGrid6.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid7ChkRows = ultraGrid7.Rows.AsQueryable().Where("CHK = 'True'");
- IQueryable<UltraGridRow> ultraGrid8ChkRows = ultraGrid8.Rows.AsQueryable().Where("CHK = 'True'");
- var ultraGrid9Rows = ultraGrid9.Rows.Where(a=>a.GetValue("Chk") == "True");
- int chkCnt = ultraGrid1ChkRows.Count() + ultraGrid2ChkRows.Count() + ultraGrid3ChkRows.Count()
- + ultraGrid4ChkRows.Count() + ultraGrid5ChkRows.Count() + ultraGrid6ChkRows.Count()
- + ultraGrid7ChkRows.Count() + ultraGrid8ChkRows.Count() + ultraGrid9Rows.Count();
- if (chkCnt == 0)
- {
- MessageUtil.ShowWarning("请选择需要删除的记录!");
- return;
- }
- ArrayList list = new ArrayList();
- ArrayList list1 = new ArrayList();
- ArrayList list2 = new ArrayList();
- ArrayList list3 = new ArrayList();
- ArrayList list4 = new ArrayList();
- ArrayList list5 = new ArrayList();
- ArrayList list6 = new ArrayList();
- ArrayList list7 = new ArrayList();
- ArrayList list8 = new ArrayList();
- ArrayList list9 = new ArrayList();
- string msg = "";
- string fieldName = "";
- foreach (UltraGridRow ugr in ultraGrid1ChkRows)
- {
- SlmBaseMaterialAPlEntity baseMaterialAPl = EntityHelper.CopyEntity<SlmBaseMaterialAPlEntity>(ugr.ListObject);
- baseMaterialAPl.UpdateName = UserInfo.GetUserName();
- if (EntityHelper.CheckEntity(baseMaterialAPl, out msg, out fieldName) == false)
- {
- MessageUtil.ShowWarning(msg);
- return;
- }
- string strJSON = JSONFormat.Format(baseMaterialAPl);
- list1.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid2ChkRows)
- {
- SlmBaseMaterialBPlEntity baseMaterialBPl = EntityHelper.CopyEntity<SlmBaseMaterialBPlEntity>(ugr.ListObject);
- baseMaterialBPl.UpdateName = UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialBPl);
- list2.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid3ChkRows)
- {
- SlmBaseMaterialCPlEntity baseMaterialCPl = EntityHelper.CopyEntity<SlmBaseMaterialCPlEntity>(ugr.ListObject);
- baseMaterialCPl.UpdateName = UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialCPl);
- list3.Add(strJSON);
- }
- IQueryable<SlmBaseMaterialDPlEntity> querableMaterialD = ultraGrid4ChkRows.Select(a => (SlmBaseMaterialDPlEntity)a.ListObject);
- if (CheckMaterialDIsSame(querableMaterialD, out msg))
- {
- MessageUtil.ShowWarning(msg);
- return;
- }
- foreach (UltraGridRow ugr in ultraGrid4ChkRows)
- {
- SlmBaseMaterialDPlEntity baseMaterialDPl = EntityHelper.CopyEntity<SlmBaseMaterialDPlEntity>(ugr.ListObject);
- baseMaterialDPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialDPl);
- list4.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid4ChkRows)
- {
- SlmBaseMaterialDPlEntity baseMaterialDPl = EntityHelper.CopyEntity<SlmBaseMaterialDPlEntity>(ugr.ListObject);
- if (CheckMaterialD(baseMaterialDPl, list4, out msg))
- {
- MessageUtil.ShowWarning(msg);
- return;
- }
- }
- foreach (UltraGridRow ugr in ultraGrid5ChkRows)
- {
- SlmBaseMaterialEPlEntity baseMaterialEPl = EntityHelper.CopyEntity<SlmBaseMaterialEPlEntity>(ugr.ListObject);
- baseMaterialEPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialEPl);
- list5.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid6ChkRows)
- {
- SlmBaseMaterialFPlEntity baseMaterialFPl = EntityHelper.CopyEntity<SlmBaseMaterialFPlEntity>(ugr.ListObject);
- baseMaterialFPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialFPl);
- list6.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid7ChkRows)
- {
- SlmBaseMaterialJPlEntity baseMaterialJPl = EntityHelper.CopyEntity<SlmBaseMaterialJPlEntity>(ugr.ListObject);
- baseMaterialJPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialJPl);
- list7.Add(strJSON);
- }
- foreach (UltraGridRow ugr in ultraGrid8ChkRows)
- {
- SlmBaseMaterialIPlEntity baseMaterialIPl = EntityHelper.CopyEntity<SlmBaseMaterialIPlEntity>(ugr.ListObject);
- baseMaterialIPl.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterialIPl);
- list8.Add(strJSON);
- }
- foreach (var row in ultraGrid9Rows)
- {
- SlmBaseMaterialEntity baseMaterial = EntityHelper.CopyEntity<SlmBaseMaterialEntity>(row.ListObject);
- baseMaterial.UpdateName = this.UserInfo.GetUserName();
- string strJSON = JSONFormat.Format(baseMaterial);
- list9.Add(strJSON);
- }
- list.Add(list1);
- list.Add(list2);
- list.Add(list3);
- list.Add(list4);
- list.Add(list5);
- list.Add(list6);
- list.Add(list7);
- list.Add(list8);
- list.Add(list9);
- if (MessageUtil.ShowYesNoAndQuestion("此删除操作不可恢复,确认是否继续?") == DialogResult.No)
- {
- return;
- }
- ServerHelper.SetData("com.steering.pss.sale.order.CoreBaseMaterialPl.deleteBaseMaterial", new object[] { list }, ob);
- QueryMaterial();
- MessageUtil.ShowTips("删除成功!");
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- var row = ultraGrid9.ActiveRow;
- switch (ultraGrid9.ActiveCell.Column.Key)
- {
- case "MaterialTypeMaxDesc":
- DataTable dtMax = ClsBaseInfo.GetComBaseInfo("4088", ob);
- dtMax.Columns["BASENAME"].Caption = "物料大类";
- BaseInfoPopup baseInfoMax = new BaseInfoPopup(dtMax, "BASENAME", "BASECODE");
- foreach (var column in baseInfoMax.UltraGrid1.DisplayLayout.Bands[0].Columns)
- {
- if (column.Key != "BASENAME")
- {
- column.Hidden = true;
- }
- }
- if (baseInfoMax.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- ultraGrid9.ActiveRow.SetValue("MaterialTypeMaxDesc", baseInfoMax.ChoicedRow.GetValue("BASENAME"));
- ultraGrid9.ActiveRow.SetValue("MaterialTypeMax", baseInfoMax.ChoicedRow.GetValue("BASECODE"));
- }
- break;
- case "MaterialTypeMidDesc":
- if (row.GetValue("MaterialTypeMax") == "")
- {
- MessageUtil.ShowWarning("请选择物料大类!");
- return;
- }
- DataTable dtMid = ClsBaseInfo.GetComBaseInfo(row.GetValue("MaterialTypeMax"), ob);
- dtMid.Columns["BASENAME"].Caption = "物料中类";
- BaseInfoPopup baseInfoMid = new BaseInfoPopup(dtMid, "BASENAME", "BASECODE");
- foreach (var column in baseInfoMid.UltraGrid1.DisplayLayout.Bands[0].Columns)
- {
- if (column.Key != "BASENAME")
- {
- column.Hidden = true;
- }
- }
- if (baseInfoMid.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- ultraGrid9.ActiveRow.SetValue("MaterialTypeMidDesc", baseInfoMid.ChoicedRow.GetValue("BASENAME"));
- ultraGrid9.ActiveRow.SetValue("MaterialTypeMid", baseInfoMid.ChoicedRow.GetValue("BASECODE"));
- }
- break;
- case "MaterialTypeMinDesc":
- if (row.GetValue("MaterialTypeMid") == "")
- {
- MessageUtil.ShowWarning("请选择物料中类!");
- return;
- }
- DataTable dtMin = ClsBaseInfo.GetComBaseInfo(row.GetValue("MaterialTypeMid"), ob);
- dtMin.Columns["BASENAME"].Caption = "物料小类";
- BaseInfoPopup baseInfoMin = new BaseInfoPopup(dtMin, "BASENAME", "BASECODE");
- foreach (var column in baseInfoMin.UltraGrid1.DisplayLayout.Bands[0].Columns)
- {
- if (column.Key != "BASENAME")
- {
- column.Hidden = true;
- }
- }
- if (baseInfoMin.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- ultraGrid9.ActiveRow.SetValue("MaterialTypeMinDesc", baseInfoMin.ChoicedRow.GetValue("BASENAME"));
- ultraGrid9.ActiveRow.SetValue("MaterialTypeMin", baseInfoMin.ChoicedRow.GetValue("BASECODE"));
- }
- break;
- case "PropertyType1Desc":
- DataTable dtProperty1 = ClsBaseInfo.GetComBaseInfo("4089", ob);
- dtProperty1.Columns["BASENAME"].Caption = "属性分类1";
- BaseInfoPopup baseInfoProperty1 = new BaseInfoPopup(dtProperty1, "BASENAME", "BASECODE");
- foreach (var column in baseInfoProperty1.UltraGrid1.DisplayLayout.Bands[0].Columns)
- {
- if (column.Key != "BASENAME")
- {
- column.Hidden = true;
- }
- }
- if (baseInfoProperty1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- ultraGrid9.ActiveRow.SetValue("PropertyType1Desc", baseInfoProperty1.ChoicedRow.GetValue("BASENAME"));
- ultraGrid9.ActiveRow.SetValue("PropertyType1", baseInfoProperty1.ChoicedRow.GetValue("BASECODE"));
- }
- break;
- case "PropertyType2Desc":
- DataTable dtProperty2 = ClsBaseInfo.GetComBaseInfo("4089", ob);
- dtProperty2.Columns["BASENAME"].Caption = "属性分类2";
- BaseInfoPopup baseInfoProperty2 = new BaseInfoPopup(dtProperty2, "BASENAME", "BASECODE");
- foreach (var column in baseInfoProperty2.UltraGrid1.DisplayLayout.Bands[0].Columns)
- {
- if (column.Key != "BASENAME")
- {
- column.Hidden = true;
- }
- }
- if (baseInfoProperty2.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- ultraGrid9.ActiveRow.SetValue("PropertyType2Desc", baseInfoProperty2.ChoicedRow.GetValue("BASENAME"));
- ultraGrid9.ActiveRow.SetValue("PropertyType2", baseInfoProperty2.ChoicedRow.GetValue("BASECODE"));
- }
- break;
- }
- }
- private void ultraGrid9_CellChange(object sender, CellEventArgs e)
- {
- e.Cell.Row.Update();
- SlmBaseMaterialEntity materialEntity = (SlmBaseMaterialEntity)e.Cell.Row.ListObject;
- _materialEntityList.Change(materialEntity);
- }
- private void ultraGrid_MouseUp(object sender, MouseEventArgs e)
- {
- UltraGrid grid = (UltraGrid)sender;
- foreach (UltraGridRow row in grid.Rows)
- {
- if (row.Selected)
- {
- row.Cells["CHK"].Value = true;
- }
- }
- grid.UpdateData();
- }
- }
- }
|