| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172 |
- 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.Server;
- using Core.Mes.Client.Comm.Control;
- using Infragistics.Win.UltraWinGrid;
- using System.Collections;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmPipeManage.Controls;
- namespace Core.StlMes.Client.YdmPipeManage
- {
- public partial class FrmVarietie : FrmBase
- {
- string strStartTime = "2015-01-01 00:00:00";//开始时间
- string strEndTime = "";//结束时间
- DataTable ds1 = new DataTable();
- DataTable ds2 = new DataTable();
- DataTable ds3 = new DataTable();
- DataTable ds4 = new DataTable();
- public FrmVarietie(OpeBase ob,string StartTime)
- {
- this.ob = ob;
- strStartTime = StartTime;
- //strEndTime = EndTime;
- InitializeComponent();
- }
- private void FrmVarietie_Load(object sender, EventArgs e)
- {
- //doQuery();
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- PipeManageClass.SetUltraGridRowFilter(ref GridProducode, true);
- PipeManageClass.SetUltraGridRowFilter(ref GridKind, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid1, true);
- PipeManageClass.SetUltraGridRowFilter(ref GridSteel, true);
- PipeManageClass.SetUltraGridRowFilter(ref GridzbSteel, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid2, true);
- PipeManageClass.SetUltraGridRowFilter(ref GridSpec, true);
- PipeManageClass.SetUltraGridRowFilter(ref GridzbSpec, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid3, true);
- PipeManageClass.SetUltraGridRowFilter(ref GridModel, true);
- PipeManageClass.SetUltraGridRowFilter(ref GridzbModel, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid4, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid5, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid6, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid7, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid8, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid9, true);
- PipeManageClass.SetUltraGridRowFilter(ref ultraGrid10, true);
- }
- /// <summary>
- /// 处理ultraToolbarsManager1的点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "Query":
- doQuery();
- break;
- case "Save":
- doAdd();
- break;
- case "Delete":
- doDelete();
- break;
- case "Refresh":
- doRefresh();
- break;
- case "Close":
- this.Close();
- break;
- default:
- break;
- }
- }
-
- /// <summary>
- /// 查询
- /// </summary>
- private void doQuery()
- {
- if (ultraTabControl1.SelectedTab.Key.Equals("0"))
- {
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getKind", null, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dataTable1, true);
- GridHelper.RefreshAndAutoSize(GridProducode);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
- {
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getSteel", null, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dtCX_Steel, true);
- GridHelper.RefreshAndAutoSize(GridSteel);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
- {
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getSpec", null, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dtCX_Spec, true);
- GridHelper.RefreshAndAutoSize(GridSpec);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
- {
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getModel", null, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dtCX_Model, true);
- GridHelper.RefreshAndAutoSize(GridModel);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
- {
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getFactory", null, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dataTable4, true);
- GridHelper.RefreshAndAutoSize(this.ultraGrid5);
- }
- else
- {
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getGrade", null, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref dataTable7, true);
- GridHelper.RefreshAndAutoSize(this.ultraGrid8);
- }
- doQueryZB();
- }
- /// <summary>
- /// 保存
- /// </summary>
- private void doAdd()
- {
- if (ultraTabControl1.SelectedTab.Key.Equals("0"))
- {
- #region 品名对应关系
- UltraGridRow row = GridProducode.ActiveRow;
- UltraGridRow row1 = GridKind.ActiveRow;
- int counm = 0;
- if (row==null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统品名!"); return; }
- if (row1 == null)
- {
- MessageUtil.ShowTips("质保无数据,不能进行此操作!");
- return;
- }
- ArrayList list = new ArrayList();
- //string strwhere = "";
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in GridKind.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- ArrayList listSave = new ArrayList();
- //listSave.Add(row.Cells["PRODUCCODE"].Text.Trim());
- listSave.Add(uRow.Cells["kind"].Text);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryKind1", new object[] { listSave }, this.ob);
- if (dt.Rows.Count > 0)
- {
- MessageUtil.ShowTips("您选择的该条质保系统品名" + "【" + uRow.Cells["kind"].Text + "】" + "对应关系已存在,请重新选择!");
- return;
- }
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["PRODUCCODE"].Text);
- pram.Add(row.Cells["PRODUCNAME"].Text);
- pram.Add(row.Cells["PRODUC_JX"].Text);
- pram.Add(row.Cells["PRODUC_ENG"].Text);
- pram.Add(uRow.Cells["kind"].Text);
- pram.Add(this.UserInfo.GetUserName());
- list.Add(pram);
- //strwhere += uRow.Cells["kind"].Text.Trim() + ",";
- }
- }
-
- //DataTable dt1 = PipeManageClass.RowFilterDataTable(ds1, strwhere);
- //GridHelper.CopyDataToDatatable(ref dt1, ref dataTable3, true);
- //GridHelper.RefreshAndAutoSize(GridKind);
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择质保系统品名!");
- return;
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addProduct", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("保存成功!");
- doQueryProduct();
- }
- #endregion
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
- {
- #region 钢级对应关系
- UltraGridRow row = GridSteel.ActiveRow;
- UltraGridRow row1 = GridzbSteel.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统钢级!"); return; }
- if (row1 == null)
- {
- MessageUtil.ShowTips("质保无数据,不能进行此操作!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in GridzbSteel.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- ArrayList listSave = new ArrayList();
- //listSave.Add(row.Cells["STEELCODE"].Text.Trim());
- listSave.Add(uRow.Cells["steellevel"].Text);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQuerySteel1", new object[] { listSave }, this.ob);
- if (dt.Rows.Count > 0)
- {
- MessageUtil.ShowTips("您选择该条质保系统钢级" +"【"+ uRow.Cells["steellevel"].Text +"】"+ "对应关系已存在,请重新选择!");
- return;
- }
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["STEELCODE"].Text);
- pram.Add(row.Cells["STEELNAME"].Text);
- pram.Add(uRow.Cells["steellevel"].Text);
- pram.Add(this.UserInfo.GetUserName());
- list.Add(pram);
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择质保系统钢级!");
- return;
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addSteel", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("保存成功!");
- doQueryProduct();
- }
- #endregion}
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
- {
- #region 规格对应关系
- UltraGridRow row = GridSpec.ActiveRow;
- UltraGridRow row1 = GridzbSpec.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统规格!"); return; }
- if (row1 == null)
- {
- MessageUtil.ShowTips("质保无数据,不能进行此操作!");
- return;
- }
-
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in GridzbSpec.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- ArrayList listSave = new ArrayList();
- //listSave.Add(row.Cells["SPEC_CODE"].Text.Trim());
- listSave.Add(uRow.Cells["gg"].Text);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQuerySpec1", new object[] { listSave }, this.ob);
- if (dt.Rows.Count > 0)
- {
- MessageUtil.ShowTips("您选择的该条质保系统规格" +"【"+ uRow.Cells["gg"].Text+"】" + "对应关系已存在,请重新选择!");
- return;
- }
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["SPEC_CODE"].Text);
- pram.Add(row.Cells["SPEC_NAME"].Text);
- pram.Add(uRow.Cells["gg"].Text);
- pram.Add(this.UserInfo.GetUserName());
- list.Add(pram);
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择质保系统规格!");
- return;
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addSpec", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("保存成功!");
- doQueryProduct();
- }
- #endregion}
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
- {
- #region 扣型对应关系
- UltraGridRow row = GridModel.ActiveRow;
- UltraGridRow row1 = GridzbModel.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统扣型!"); return; }
- if (row1 == null)
- {
- MessageUtil.ShowTips("质保无数据,不能进行此操作!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in GridzbModel.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- ArrayList listSave = new ArrayList();
- //listSave.Add(row.Cells["MODEL_CODE"].Text.Trim());
- listSave.Add(uRow.Cells["typeofThread"].Text);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryModel1", new object[] { listSave }, this.ob);
- if (dt.Rows.Count > 0)
- {
- MessageUtil.ShowTips("您选择的该条质保系统扣型" + "【" + uRow.Cells["typeofThread"].Text + "】" + "对应关系已存在,请重新选择!");
- return;
- }
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["MODEL_CODE"].Text);
- pram.Add(row.Cells["MODEL_DESC"].Text);
- pram.Add(uRow.Cells["typeofThread"].Text);
- pram.Add(this.UserInfo.GetUserName());
- list.Add(pram);
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择质保系统扣型!");
- return;
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addModel", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("保存成功!");
- doQueryProduct();
- }
- #endregion
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
- {
- #region 产线对应关系
- UltraGridRow row = this.ultraGrid5.ActiveRow;
- UltraGridRow row1 = ultraGrid7.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统产线!"); return; }
- if (row1 == null)
- {
- MessageUtil.ShowTips("质保无数据,不能进行此操作!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid7.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- ArrayList listSave = new ArrayList();
- //listSave.Add(row.Cells["MODEL_CODE"].Text.Trim());
- listSave.Add(uRow.Cells["factory"].Text);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryFactory1", new object[] { listSave }, this.ob);
- if (dt.Rows.Count > 0)
- {
- MessageUtil.ShowTips("您选择的该条质保系统产线" + "【" + uRow.Cells["factory"].Text + "】" + "对应关系已存在,请重新选择!");
- return;
- }
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["PLINE_CODE"].Text);
- pram.Add(row.Cells["PLINE_NAME"].Text);
- pram.Add(uRow.Cells["factory"].Text);
- pram.Add(this.UserInfo.GetUserName());
- list.Add(pram);
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择质保系统产线!");
- return;
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addFactory", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("保存成功!");
- doQueryProduct();
- }
- #endregion
- }
- else
- {
- #region 钢种对应关系
- UltraGridRow row = this.ultraGrid8.ActiveRow;
- UltraGridRow row1 = ultraGrid10.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统钢种!"); return; }
- if (row1 == null)
- {
- MessageUtil.ShowTips("质保无数据,不能进行此操作!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid10.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- ArrayList listSave = new ArrayList();
- //listSave.Add(row.Cells["MODEL_CODE"].Text.Trim());
- listSave.Add(uRow.Cells["steelgrade"].Text);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryGrade1", new object[] { listSave }, this.ob);
- if (dt.Rows.Count > 0)
- {
- MessageUtil.ShowTips("您选择的该条质保系统钢种" + "【" + uRow.Cells["steelgrade"].Text.Trim() + "】" + "对应关系已存在,请重新选择!");
- return;
- }
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["GRADECODE"].Text);
- pram.Add(row.Cells["GRADENAME"].Text);
- pram.Add(uRow.Cells["steelgrade"].Text);
- pram.Add(this.UserInfo.GetUserName());
- list.Add(pram);
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择质保系统钢种!");
- return;
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addGrade", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("保存成功!");
- doQueryProduct();
- }
- #endregion
- }
- }
-
- /// <summary>
- /// 删除
- /// </summary>
- private void doDelete()
- {
- if (ultraTabControl1.SelectedTab.Key.Equals("0"))
- {
- #region 品名对应关系
- UltraGridRow row = ultraGrid1.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择产销系统与质保系统品名对应关系!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["PRODUCCODE"].Text);
- pram.Add(uRow.Cells["ZB_PRODUCNAME"].Text);
- list.Add(pram);
- }
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteProduct", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("删除成功!");
- doQueryProduct();
- }
- else
- {
- MessageUtil.ShowTips("删除失败!");
- }
- #endregion
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
- {
- #region 钢级对应关系
- UltraGridRow row = ultraGrid2.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid2.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择产销系统与质保系统钢级对应关系!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid2.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["STEELCODE"].Text);
- pram.Add(uRow.Cells["ZB_STEELNAME"].Text);
- list.Add(pram);
- }
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteSteel", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("删除成功!");
- doQueryProduct();
- }
- else
- {
- MessageUtil.ShowTips("删除失败!");
- }
- #endregion
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
- {
- #region 规格对应关系
- UltraGridRow row = ultraGrid3.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid3.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择产销系统与质保系统规格对应关系!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid3.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["SPEC_CODE"].Text);
- pram.Add(uRow.Cells["ZB_SPEC_NAME"].Text);
- list.Add(pram);
- }
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteSpec", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("删除成功!");
- doQueryProduct();
- }
- else
- {
- MessageUtil.ShowTips("删除失败!");
- }
- #endregion
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
- {
- #region 扣型对应关系
- UltraGridRow row = ultraGrid4.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid4.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择产销系统与质保系统扣型对应关系!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid4.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["MODEL_CODE"].Text);
- pram.Add(uRow.Cells["ZB_MODEL_DESC"].Text);
- list.Add(pram);
- }
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteModel", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("删除成功!");
- doQueryProduct();
- }
- else
- {
- MessageUtil.ShowTips("删除失败!");
- }
- #endregion
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
- {
- #region 产线对应关系
- UltraGridRow row = ultraGrid6.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid6.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择产销系统与质保系统产线对应关系!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid6.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["PLINE_CODE"].Text);
- pram.Add(uRow.Cells["ZB_PLINENAME"].Text);
- list.Add(pram);
- }
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteFactory", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("删除成功!");
- doQueryProduct();
- }
- else
- {
- MessageUtil.ShowTips("删除失败!");
- }
- #endregion
- }
- else
- {
- #region 钢种对应关系
- UltraGridRow row = ultraGrid9.ActiveRow;
- int counm = 0;
- if (row == null)
- {
- MessageUtil.ShowTips("无数据,不能进行此操作!");
- return;
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid9.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- counm += 1;
- }
- }
- if (counm == 0)
- {
- MessageUtil.ShowTips("请选择产销系统与质保系统钢种对应关系!");
- return;
- }
- ArrayList list = new ArrayList();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid9.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["GRADECODE"].Text);
- pram.Add(uRow.Cells["ZB_GRADENAME"].Text);
- list.Add(pram);
- }
- }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteGrade", new Object[] { list }, this.ob);
- if (count > 0)
- {
- MessageUtil.ShowTips("删除成功!");
- doQueryProduct();
- }
- else
- {
- MessageUtil.ShowTips("删除失败!");
- }
- #endregion
- }
- }
- /// <summary>
- /// 刷新
- /// </summary>
- private void doRefresh()
- {
- doQueryZB();
- }
- /// <summary>
- /// 查询质保系统数据
- /// </summary>
- private void doQueryZB()
- {
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- if (ultraTabControl1.SelectedTab.Key.Equals("0"))
- {
- DataTable dt3 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryKind", null, this.ob);
- string intt = "";
- if (dt3.Rows.Count > 0)
- {
- for (int i = 0; i < dt3.Rows.Count; i++)
- {
- intt += "'" + dt3.Rows[i]["ZB_PRODUCNAME"].ToString() + "'" + ",";
- }
- }
- if (intt != "")
- {
- intt = intt.Substring(1, intt.Length - 3);
- }
- else
- intt = "";
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBKind", new object[] { strStartTime, intt }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt2, ref dataTable3, true);
- GridHelper.RefreshAndAutoSize(GridKind);
- ds1 = dt2.Copy();
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
- {
- DataTable dt3 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQuerySteel", null, this.ob);
- string intt = "";
- if (dt3.Rows.Count > 0)
- {
- for (int i = 0; i < dt3.Rows.Count; i++)
- {
- intt += "'" + dt3.Rows[i]["ZB_STEELNAME"].ToString() + "'" + ",";
- }
- }
- if (intt != "")
- {
- intt = intt.Substring(1, intt.Length - 3);
- }
- else
- intt = "";
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBSteel", new object[] { strStartTime, intt }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt2, ref dtZB_Steel, true);
- GridHelper.RefreshAndAutoSize(GridzbSteel);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
- {
- DataTable dt3 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQuerySpec", null, this.ob);
- StringBuilder intt = new StringBuilder();
- ArrayList listData = new ArrayList();
- string ss = "";
- DataTable dt2 = null;
- if (dt3.Rows.Count > 0)
- {
- for (int i = 0; i < dt3.Rows.Count; i++)
- {
- intt.Append("'" + dt3.Rows[i]["ZB_SPEC_NAME"].ToString() + "'" + ",");
- }
- ss = intt.ToString();
- if (ss != "")
- {
- ss = ss.Substring(1, ss.Length - 3);
- }
- dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBSpec", new object[] { strStartTime}, this.ob);
- }
- //string ss = intt.ToString();
- //if (ss != "
- //{
- // ss = ss.Substring(1, ss.Length - 3);
- //}
- //else
- // ss = "";
- //DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBSpec", new object[] { strStartTime, ss }, this.ob);
- DataRow[] drs = dt2.Select("GG IN ('" + ss + "')");
- foreach (DataRow dr in drs)
- {
- dt2.Rows.Remove(dr);
- }
- GridHelper.CopyDataToDatatable(ref dt2, ref dtZB_Spec, true);
- GridHelper.RefreshAndAutoSize(GridzbSpec);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
- {
- DataTable dt3 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryModel", null, this.ob);
- string intt = "";
- if (dt3.Rows.Count > 0)
- {
- for (int i = 0; i < dt3.Rows.Count; i++)
- {
- intt += "'" + dt3.Rows[i]["ZB_MODEL_DESC"].ToString() + "'" + ",";
- }
- }
- if (intt != "")
- {
- intt = intt.Substring(1, intt.Length - 3);
- }
- else
- intt = "";
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBModel", new object[] { strStartTime, intt }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt2, ref dtZB_Model, true);
- GridHelper.RefreshAndAutoSize(GridzbModel);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
- {
- DataTable dt4 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryFactory", null, this.ob);
- string intt = "";
- if (dt4.Rows.Count > 0)
- {
- for (int i = 0; i < dt4.Rows.Count; i++)
- {
- intt += "'" + dt4.Rows[i]["ZB_PLINENAME"].ToString() + "'" + ",";
- }
- }
- if (intt != "")
- {
- intt = intt.Substring(1, intt.Length - 3);
- }
- else
- intt = "";
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBFactory", new object[] { strStartTime, intt }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt2, ref dataTable6, true);
- GridHelper.RefreshAndAutoSize(ultraGrid7);
- }
- else
- {
- DataTable dt5 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryGrade", null, this.ob);
- string intt = "";
- if (dt5.Rows.Count > 0)
- {
- for (int i = 0; i < dt5.Rows.Count; i++)
- {
- intt += "'" + dt5.Rows[i]["ZB_GRADENAME"].ToString() + "'" + ",";
- }
- }
- if (intt != "")
- {
- intt = intt.Substring(1, intt.Length - 3);
- }
- else
- intt = "";
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBGrade", new object[] { strStartTime, intt }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt2, ref dataTable9, true);
- GridHelper.RefreshAndAutoSize(ultraGrid10);
- }
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception e)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- }
- /// <summary>
- /// 产销品名对应质保品名关系
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GridProducode_AfterRowActivate(object sender, EventArgs e)
- {
- doQueryProduct();
- }
- /// <summary>
- /// 产销钢级对应质保钢级关系
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GridSteel_AfterRowActivate(object sender, EventArgs e)
- {
- doQueryProduct();
- }
- /// <summary>
- /// 产销规格对应质保规格关系
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GridSpec_AfterRowActivate(object sender, EventArgs e)
- {
- doQueryProduct();
- }
- /// <summary>
- /// 产销扣型对应质保扣型关系
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GridModel_AfterRowActivate(object sender, EventArgs e)
- {
- doQueryProduct();
- }
- /// <summary>
- /// 产销产线对应质保产线关系
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
- {
- doQueryProduct();
- }
- /// <summary>
- /// 产销钢种对应质保钢种关系
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid8_AfterRowActivate(object sender, EventArgs e)
- {
- doQueryProduct();
- }
- /// <summary>
- /// 查询对应关系
- /// </summary>
- private void doQueryProduct()
- {
- if (ultraTabControl1.SelectedTab.Key.Equals("0"))
- {
- UltraGridRow row = GridProducode.ActiveRow;
- if (row == null) return;
- string strProduct = row.Cells["PRODUCCODE"].Text;
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.queryProduct", new object[] { strProduct }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
- GridHelper.RefreshAndAutoSize(ultraGrid1);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
- {
- UltraGridRow row = GridSteel.ActiveRow;
- if (row == null) return;
- string strSteel = row.Cells["STEELCODE"].Text;
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.querySteel", new object[] { strSteel }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtSteel, true);
- GridHelper.RefreshAndAutoSize(ultraGrid2);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
- {
- UltraGridRow row = GridSpec.ActiveRow;
- if (row == null) return;
- string strSpec = row.Cells["SPEC_CODE"].Text;
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.querySpec", new object[] { strSpec }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtSpec, true);
- GridHelper.RefreshAndAutoSize(ultraGrid3);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
- {
- UltraGridRow row = GridModel.ActiveRow;
- if (row == null) return;
- string strModel = row.Cells["MODEL_CODE"].Text;
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.queryModel", new object[] { strModel }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dtModel, true);
- GridHelper.RefreshAndAutoSize(ultraGrid4);
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
- {
- UltraGridRow row = this.ultraGrid5.ActiveRow;
- if (row == null) return;
- string strfactory = row.Cells["PLINE_CODE"].Text;
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.queryFactory", new object[] { strfactory }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable5, true);
- GridHelper.RefreshAndAutoSize(ultraGrid6);
- }
- else
- {
- UltraGridRow row = this.ultraGrid8.ActiveRow;
- if (row == null) return;
- string strgrade = row.Cells["GRADECODE"].Text;
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.queryGrade", new object[] { strgrade }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable8, true);
- GridHelper.RefreshAndAutoSize(ultraGrid9);
- }
- }
- /// <summary>
- /// 托选
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GridALL_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- if (ultraTabControl1.SelectedTab.Key.Equals("0"))
- {
- try
- {
- ultraGrid1.UpdateData();
- GridKind.UpdateData();
- foreach (UltraGridRow r in ultraGrid1.Rows)
- {
- r.Cells["CHK"].Value = r.Selected;
- }
- foreach (UltraGridRow r1 in GridKind.Rows)
- {
- r1.Cells["CHK"].Value = r1.Selected;
- }
- }
- catch { }
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
- {
- try
- {
- ultraGrid2.UpdateData();
- GridzbSteel.UpdateData();
- foreach (UltraGridRow r in ultraGrid2.Rows)
- {
- r.Cells["CHK"].Value = r.Selected;
- }
- foreach (UltraGridRow r1 in GridzbSteel.Rows)
- {
- r1.Cells["CHK"].Value = r1.Selected;
- }
- }
- catch { }
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
- {
- try
- {
- ultraGrid3.UpdateData();
- GridzbSpec.UpdateData();
- foreach (UltraGridRow r in ultraGrid3.Rows)
- {
- r.Cells["CHK"].Value = r.Selected;
- }
- foreach (UltraGridRow r1 in GridzbSpec.Rows)
- {
- r1.Cells["CHK"].Value = r1.Selected;
- }
- }
- catch { }
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
- {
- try
- {
- ultraGrid4.UpdateData();
- GridzbModel.UpdateData();
- foreach (UltraGridRow r in ultraGrid4.Rows)
- {
- r.Cells["CHK"].Value = r.Selected;
- }
- foreach (UltraGridRow r1 in GridzbModel.Rows)
- {
- r1.Cells["CHK"].Value = r1.Selected;
- }
- }
- catch { }
- }
- else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
- {
- try
- {
- ultraGrid6.UpdateData();
- ultraGrid5.UpdateData();
- foreach (UltraGridRow r in ultraGrid6.Rows)
- {
- r.Cells["CHK"].Value = r.Selected;
- }
- foreach (UltraGridRow r1 in ultraGrid5.Rows)
- {
- r1.Cells["CHK"].Value = r1.Selected;
- }
- }
- catch { }
- }
- else
- {
- try
- {
- ultraGrid9.UpdateData();
- ultraGrid8.UpdateData();
- foreach (UltraGridRow r in ultraGrid9.Rows)
- {
- r.Cells["CHK"].Value = r.Selected;
- }
- foreach (UltraGridRow r1 in ultraGrid8.Rows)
- {
- r1.Cells["CHK"].Value = r1.Selected;
- }
- }
- catch { }
- }
- }
- }
- }
|