| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Data;
- using System.Linq;
- namespace Core.StlMes.Client.Qcm
- {
- public partial class ComBaseStationPopup : FrmBase
- {
- private FrmControlPointBasics _frm = new FrmControlPointBasics();
- private string _stationCodes = "";
- private string _stationNames = "";
- public string StationNames
- {
- get { return _stationNames; }
- set { _stationNames = value; }
- }
- public string StationCodes
- {
- get { return _stationCodes; }
- set { _stationCodes = value; }
- }
- public ComBaseStationPopup(string stationType, string stationCodes, string stationNames, OpeBase ob)
- {
- InitializeComponent();
- _stationCodes = stationCodes;
- _stationNames = stationNames;
- this.ob = ob;
- _frm.PopupLoad(ob);
- _frm.StationType = stationType;
- this.panel1.Controls.Add(_frm.UltraGrid2);
- _frm.UltraGrid2.DisplayLayout.Bands[0].Columns["CHK2"].Hidden = false;
- _frm.ToolBar_Click(null, "doQuery");
- SetChk();
- _frm.UltraGrid2.UpdateData();
- }
- private void SetChk()
- {
- string[] stationCodes = _stationCodes.Split(';');
- foreach (UltraGridRow row in _frm.UltraGrid2.Rows)
- {
- if (stationCodes.Contains(row.GetValue("STATION_CODE")))
- {
- row.SetValue("CHK2", "True");
- }
- }
- }
- private void ultraButton1_Click(object sender, EventArgs e)
- {
- _frm.UltraGrid2.UpdateData();
- IQueryable<UltraGridRow> rows = _frm.UltraGrid2.Rows.AsQueryable().Where("CHK2 = 'True'");
- _stationCodes = "";
- _stationNames = "";
- foreach (UltraGridRow row in rows)
- {
- _stationCodes += row.GetValue("STATION_CODE") + ";";
- _stationNames += row.GetValue("STATION_DESC") + ";";
- }
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- private void ultraButton2_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
|