private void FormNewYear_Load(object sender, EventArgs e) { s.Add("S1"); s.Add("S2"); s.Add("S3"); s.Add("S4"); s.Add("S5"); s.Add("S6"); s.Add("S7"); s.Add("S8"); s.Add("S9"); s.Add("S10"); spinEdit1.Text = classname; classname1 = classname; if (!IsUpdate) { psp_sl = new PowerSubstationLine(); psp_sl.Type = type; psp_sl.Type2 = type2; psp_sl.Flag = flag; } else { PowerSubstationLine ps = new PowerSubstationLine(); ps.Title = classname; ps.ClassType = classtype; ps.Flag = flag; ps.Type = type; ps.Type2 = type2; psp_sl = (PowerSubstationLine)Common.Services.BaseService.GetObject("SelectPowerSubstationLineByAll", ps); } }
private void InitValues() { PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; //psl.Type = type; psl.Type2 = "PowerSubstation" + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20); IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psl); foreach (PowerSubstationLine pss in li) { foreach (GridColumn gc in this.ctrlPSP_PowerSubstationInfo1.GridView.Columns) { try { if (gc.FieldName.Substring(0, 1) == "S") { //gc.Visible = false; if (gc.FieldName == pss.ClassType) { gc.Caption = pss.Title; gc.VisibleIndex = int.Parse(pss.Type); gc.Visible = true; //gc.Columns[0].Caption = pss.Title; //gc.Columns[0].Visible = true; //gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; } } } catch (Exception e) { MsgBox.Show(e.Message); } } } }
private void InitValues() { PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; psl.Type = type; psl.Type2 = "SubstationGuiHua"; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (GridBand gc in this.ctrlSubstation_Info1.GridView.Bands) { try { if (gc.Columns[0].FieldName.Substring(0, 1) == "S" && gc.Columns[0].FieldName.Substring(1, 1) != "2") { gc.Visible = false; foreach (PowerSubstationLine pss in li) { if (gc.Columns[0].FieldName == pss.ClassType) { gc.Visible = true; gc.Caption = pss.Title; gc.Columns[0].Caption = pss.Title; gc.Columns[0].Visible = true; gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; } } } } catch { } } }
private void barDel1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { GridColumn gc = this.ctrlSubstation_Info_LangFang1.GridView.FocusedColumn; if (gc == null) { return; } if (gc.FieldName.Substring(0, 1) != "S") { MsgBox.Show("不能删除固定列"); return; } if (MsgBox.ShowYesNo("是否删除 " + gc.Caption + " 的所有数据?") != DialogResult.Yes) { return; } foreach (GridBand gc1 in ctrlSubstation_Info_LangFang1.GridView.Bands) { try { if (gc1.Columns[0].Name == gc.Name) { gc1.Visible = false; } } catch { } } int colIndex = ctrlSubstation_Info_LangFang1.GridView.FocusedColumn.VisibleIndex; gc.Visible = false; gc.OptionsColumn.ShowInCustomizationForm = false; Substation_Info si = new Substation_Info(); si.Title = gc.FieldName + "=''"; si.Flag = flag; Itop.Client.Common.Services.BaseService.Update("UpdateSubstation_InfoByFlag", si); PowerSubstationLine psl = new PowerSubstationLine(); psl.ClassType = gc.FieldName; psl.Flag = flag; psl.Type = type; psl.Title = gc.Caption; psl.Type2 = "Substation"; Itop.Client.Common.Services.BaseService.Update("DeletePowerSubstationLineByAll", psl); if (colIndex >= ctrlSubstation_Info_LangFang1.GridView.VisibleColumns.Count) { colIndex--; } ctrlSubstation_Info_LangFang1.GridView.FocusedColumn = ctrlSubstation_Info_LangFang1.GridView.VisibleColumns[colIndex]; // ctrlSubstation_Info_LangFang1.GridView.FocusedColumn = ctrlSubstation_Info_LangFang1.GridView.VisibleColumns[this.ctrlSubstation_Info_LangFang1.GridView.FocusedColumn.ColumnHandle]; }
private void FrmSubstation_InfoDialog_Load(object sender, EventArgs e) { try { if (isselect) { this.vGridControl.Enabled = false; } if (!IsCreate) { checkEdit1.Visible = false; } InitArea(); IList <Substation_Info> list = new List <Substation_Info>(); list.Add(_obj); this.vGridControl.DataSource = list; //foreach (BaseRow gc in this.vGridControl.Rows) //{ // if (gc.Properties.FieldName.Substring(0, 1) == "S" && gc.Properties.FieldName != "S1" && gc.Properties.FieldName != "S4" && gc.Properties.FieldName != "S2") // gc.Visible = false; //} PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = "Substation"; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); //foreach (BaseRow gc1 in this.vGridControl.Rows) //{ // if (gc1.Properties.FieldName.Substring(0, 1) == "S") // { // foreach (PowerSubstationLine pss in li) // { // if (gc1.Properties.FieldName == pss.ClassType) // { // gc1.Properties.Caption = pss.Title; // gc1.Visible = true; // } // } // } //} } catch { } }
private void InitVisuble() { PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; psl.Type = type; psl.Type2 = type2; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); //foreach (GridColumn gc1 in this.ctrlLine_Info1.GridView.Columns) //{ // if (gc1.FieldName.Substring(0, 1) == "S") // { // foreach (PowerSubstationLine pss in li) // { // if (gc1.FieldName == pss.ClassType) // { // gc1.Caption = pss.Title; // gc1.Visible = true; // gc1.OptionsColumn.ShowInCustomizationForm = true; // } // } // } //} foreach (GridBand gc in this.ctrlLine_Info1.GridView.Bands) { try { if (gc.Columns[0].FieldName.Substring(0, 1) == "S") { gc.Visible = false; foreach (PowerSubstationLine pss in li) { if (gc.Columns[0].FieldName == pss.ClassType) { gc.Visible = true; gc.Caption = pss.Title; gc.Columns[0].Caption = pss.Title; gc.Columns[0].Visible = true; gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; } } } } catch { } } }
private void FrmSubstation_InfoDialog_Load(object sender, EventArgs e) { if (isselect) { this.vGridControl.Enabled = false; } if (!IsCreate) { checkEdit1.Visible = false; } IList <Substation_Info> list = new List <Substation_Info>(); list.Add(_obj); this.vGridControl.DataSource = list; foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName.Substring(0, 1) == "S") { gc.Visible = false; } } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = "Substation"; IList <PowerSubstationLine> li = UCDeviceBase.DataService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName.Substring(0, 1) == "S") { foreach (PowerSubstationLine pss in li) { if (gc1.Properties.FieldName == pss.ClassType) { gc1.Properties.Caption = pss.Title; gc1.Visible = true; } } } } }
private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { GridColumn gc = this.ctrlSubstation_Info1.GridView.FocusedColumn; if (gc == null) { return; } if (gc.FieldName.Substring(0, 1) != "S") { MsgBox.Show("不能删除固定列"); return; } if (MsgBox.ShowYesNo("是否删除 " + gc.Caption + " 的所有数据?") != DialogResult.Yes) { return; } foreach (GridBand gc1 in ctrlSubstation_Info1.GridView.Bands) { try { if (gc1.Columns[0].Name == gc.Name) { gc1.Visible = false; } } catch { } } gc.Visible = false; gc.OptionsColumn.ShowInCustomizationForm = false; Substation_Info si = new Substation_Info(); si.Title = gc.FieldName + "=''"; si.Flag = flag; UCDeviceBase.DataService.Update("UpdateSubstation_InfoByFlag", si); PowerSubstationLine psl = new PowerSubstationLine(); psl.ClassType = gc.FieldName; psl.Flag = flag; psl.Type = type; psl.Title = gc.Caption; psl.Type2 = "SubstationGuiHua"; UCDeviceBase.DataService.Update("DeletePowerSubstationLineByAll", psl); }
private void gridView1_Layout(object sender, EventArgs e) { //string filepath = Path.GetTempPath(); //this.ctrlPSP_PowerSubstationInfo1.bandedGridView1.SaveLayoutToXml(filepath + "SubstationLayOut.xml"); PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type2 = types2 + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20); IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psl); foreach (PowerSubstationLine psp in li) { foreach (GridColumn gc in this.gridView1.VisibleColumns) { try { if (gc.FieldName.Substring(0, 1) == "S") { if (gc.FieldName == psp.ClassType) { //gc.Caption = pss.Title; psp.Type = gc.VisibleIndex.ToString(); //gc.Visible = true; //gc.Columns[0].Caption = pss.Title; //gc.Columns[0].Visible = true; //gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; } } } catch { } } if (psp.Type != "-1") { Itop.Client.Common.Services.BaseService.Update("UpdatePowerSubstationLine", psp); } } }
private void FrmSubstation_InfoDialog_Load(object sender, EventArgs e) { IList <Substation_Info> list = new List <Substation_Info>(); list.Add(Object); this.vGridControl.DataSource = list; foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName.Substring(0, 1) == "S") { gc.Visible = false; } } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = types2; //psl.Type2 = "Substation"; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName.Substring(0, 1) == "S") { foreach (PowerSubstationLine pss in li) { if (gc1.Properties.FieldName == pss.ClassType) { gc1.Properties.Caption = pss.Title; gc1.Visible = true; } } } } }
private void barDel1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { GridColumn gc = this.ctrlPSP_PowerSubstationInfo1.GridView.FocusedColumn; if (gc == null) { return; } if (gc.FieldName.Substring(0, 1) != "S") { MsgBox.Show("不能删除固定列"); return; } bool bl = false; for (int i = 0; i < ctrlPSP_PowerSubstationInfo1.GridView.VisibleColumns.Count; i++) { if (gc.Caption == ctrlPSP_PowerSubstationInfo1.GridView.VisibleColumns[i].Caption) { if (MsgBox.ShowYesNo("是否删除 " + gc.Caption + " 的所有数据?") != DialogResult.Yes) { return; } bl = true; break; } else { bl = false; } } if (bl == true) { int colIndex = ctrlPSP_PowerSubstationInfo1.GridView.FocusedColumn.VisibleIndex; foreach (GridColumn gc1 in ctrlPSP_PowerSubstationInfo1.GridView.Columns) { try { if (gc1.Name == gc.Name) { gc1.Visible = false; } } catch { } } gc.Visible = false; gc.OptionsColumn.ShowInCustomizationForm = false; PSP_PowerSubstationInfo si = new PSP_PowerSubstationInfo(); si.Title = gc.FieldName + "=''"; si.Flag = flag; Itop.Client.Common.Services.BaseService.Update("UpdatePSP_PowerSubstationInfoByFlag", si); PowerSubstationLine psl = new PowerSubstationLine(); psl.ClassType = gc.FieldName; psl.Flag = flag; //psl.Type = type; psl.Title = gc.Caption; psl.Type2 = "PowerSubstation" + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20); Itop.Client.Common.Services.BaseService.Update("DeletePowerSubstationLineByNoType", psl); if (colIndex >= ctrlPSP_PowerSubstationInfo1.GridView.VisibleColumns.Count) { colIndex--; } ctrlPSP_PowerSubstationInfo1.GridView.FocusedColumn = ctrlPSP_PowerSubstationInfo1.GridView.VisibleColumns[colIndex]; } else { return; } }
private void simpleButton1_Click(object sender, EventArgs e) { classname = psp_sl.Title = spinEdit1.Text; if (classname.ToString() == "") { MsgBox.Show("类别名称不能为空"); return; } try { if (Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeClass", psp_sl) == null) { try { if (!IsUpdate) { bool bz = false; string f = ""; foreach (string ss in s) { PowerSubstationLine ps = new PowerSubstationLine(); ps.Title = classname; ps.Flag = flag; ps.Type = type; ps.Type2 = type2; ps.ClassType = ss; object obj = Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeClass1", ps); if (obj == null) { classtype = ss; bz = true; f = ss; break; } } if (bz) { psp_sl.ClassType = f; // psp_sl.UID+="|"+proj Common.Services.BaseService.Create <PowerSubstationLine>(psp_sl); } } else { Common.Services.BaseService.Update <PowerSubstationLine>(psp_sl); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { MsgBox.Show("出错啦:" + ex.Message); } } else { MsgBox.Show("此分类已经存在,请重新输入!"); } } catch { } }
private void barButtonItem16_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (treeList1.FocusedColumn == null) { return; } string fieldName = treeList1.FocusedColumn.FieldName; string caption = treeList1.FocusedColumn.Caption; if (fieldName.Substring(0, 1) != "S") { MsgBox.Show("不能删除此列!"); return; } if (MsgBox.ShowYesNo("是否删除 " + treeList1.FocusedColumn.Caption + " 的所有数据?") != DialogResult.Yes) { return; } try { int colIndex = treeList1.FocusedColumn.AbsoluteIndex; Hashtable ha = new Hashtable(); ha.Add("Title", fieldName + "=''"); ha.Add("Flag2", typeFlag2); Itop.Client.Common.Services.BaseService.Update("UpdatePSP_PowerTypes_LiaoByFlag2", ha); PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = "1"; psl.ClassType = fieldName; psl.Type = typeFlag2; psl.Title = caption; psl.Type2 = type; Itop.Client.Common.Services.BaseService.Update("DeletePowerSubstationLineByAll", psl); // Common.Services.BaseService.Update("DeletePowerValuesByYear", hs); // dataTable.Columns.Remove(treeList1.FocusedColumn.Caption); // treeList1.Columns.Remove(treeList1.FocusedColumn); treeList1.FocusedColumn.VisibleIndex = -1; if (colIndex >= treeList1.VisibleColumnCount) { colIndex--; } treeList1.FocusedColumn = treeList1.Columns[colIndex]; } catch (Exception ex) { MsgBox.Show("删除出错:" + ex.Message); } }
private void FrmSubstation_InfoDialog_Load(object sender, EventArgs e) { if (isselect) this.vGridControl.Enabled = false; if (!IsCreate) { checkEdit1.Visible = false; } IList<Substation_Info> list = new List<Substation_Info>(); list.Add(_obj); this.vGridControl.DataSource = list; foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName.Substring(0, 1) == "S") gc.Visible = false; } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = "Substation"; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName.Substring(0, 1) == "S") { foreach (PowerSubstationLine pss in li) { if (gc1.Properties.FieldName == pss.ClassType) { gc1.Properties.Caption = pss.Title; gc1.Visible = true; } } } } }
private void FrmLine_InfoDialog_Load(object sender, EventArgs e) { if (isselect) this.vGridControl.Enabled = false; if (!IsCreate) { checkEdit1.Visible=false; } IList<Line_Info> list = new List<Line_Info>(); list.Add(Object); this.vGridControl.DataSource = list; foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "") continue; if (gc.Properties.FieldName.Substring(0, 1) == "S") gc.Visible = false; if (gc.Properties.FieldName.Substring(0, 1) == "K" && types2=="66") gc.Visible = false; if (gc.Properties.FieldName.Substring(0, 1) == "L" && types2 == "10") gc.Visible = false; } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = types2; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName == "") { if (types2 == "66") gc1.Visible = false; continue; } if (gc1.Properties.FieldName.Substring(0, 1) == "S") { foreach (PowerSubstationLine pss in li) { if (gc1.Properties.FieldName == pss.ClassType) { gc1.Properties.Caption = pss.Title; gc1.Visible = true; } } } } //MessageBox.Show(liss.Count.ToString()); Hashtable hs1 = new Hashtable(); Hashtable hs2 = new Hashtable(); Hashtable hs3 = new Hashtable(); foreach (Line_Info liii in liss) { if (!hs1.ContainsValue(liii.K2)) hs1.Add(Guid.NewGuid().ToString(), liii.K2); if (!hs2.ContainsValue(liii.K3)) hs2.Add(Guid.NewGuid().ToString(), liii.K3); if (!hs3.ContainsValue(liii.K22)) hs3.Add(Guid.NewGuid().ToString(), liii.K22); } //MessageBox.Show(hs1.Count.ToString()); //MessageBox.Show(hs2.Count.ToString()); //MessageBox.Show(hs3.Count.ToString()); foreach (DictionaryEntry de1 in hs1) { repositoryItemComboBox1.Items.Add(de1.Value.ToString()); } foreach (DictionaryEntry de2 in hs2) { repositoryItemComboBox2.Items.Add(de2.Value.ToString()); } //foreach (DictionaryEntry de3 in hs3) //{ // repositoryItemComboBox3.Items.Add(de3.Value.ToString()); //} }
private void InitValues() { PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; //psl.Type = type; psl.Type2 = "PowerSubstation" + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20); IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psl); foreach (PowerSubstationLine pss in li) { foreach (GridColumn gc in this.ctrlPSP_PowerSubstationInfo1.GridView.Columns) { try { if (gc.FieldName.Substring(0, 1) == "S") { //gc.Visible = false; if (gc.FieldName == pss.ClassType) { gc.Caption = pss.Title; gc.VisibleIndex = int.Parse(pss.Type); gc.Visible = true; //gc.Columns[0].Caption = pss.Title; //gc.Columns[0].Visible = true; //gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; } } } catch (Exception e) { MsgBox.Show(e.Message); } } } }
private void FrmPower_AddBands_Load(object sender, EventArgs e) { s.Add("S1"); s.Add("S2"); s.Add("S3"); s.Add("S4"); s.Add("S5"); s.Add("S6"); s.Add("S7"); s.Add("S8"); s.Add("S9"); s.Add("S10"); s.Add("S11"); s.Add("S12"); s.Add("S13"); s.Add("S14"); s.Add("S15"); s.Add("S16"); s.Add("S17"); s.Add("S18"); s.Add("S19"); s.Add("S20"); textBox1.Text = classname; classname1 = classname; if (!IsUpdate) { psp_sl = new PowerSubstationLine(); psp_sl.Type = type; psp_sl.Type2 = type2; psp_sl.Flag = flag; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psp_sl); if (addflag == "powerflag") { if (li.Count >= 20) { MsgBox.Show("��ģ������������20���Զ����У�"); this.Close(); return; } } if (addflag == "form1_liaoflag") { if (li.Count >= 20) { MsgBox.Show("��ģ������������20���Զ����У�"); this.Close(); return; } } } else { PowerSubstationLine ps = new PowerSubstationLine(); ps.Title = classname; // ps.ClassType = classtype; ps.Flag = flag; ps.Type = type; ps.Type2 = type2; psp_sl = (PowerSubstationLine)Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeFlag", ps); } }
private void InitVisuble() { PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; psl.Type = type; psl.Type2 = type2; // this.ctrlLine_Info1.FlagsType = type; if (leixing != "����") { LayoutList ll = this.ctrlLayoutList1.FocusedObject; if (ll == null) return; psl.Type = ll.UID; //this.ctrlLine_Info1.FlagsType = ll.UID; type = ll.UID; } IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (GridBand gc in this.ctrlLine_Info1.GridView.Bands) { try { if ((gc.Columns[0].FieldName.Substring(0, 1) == "S" && gc.Columns[0].FieldName != "S2") || gc.Columns[0].FieldName.Substring(0, 1) == "K") { gc.Visible = false; //foreach (PowerSubstationLine pss in li) //{ // if (gc.Columns[0].FieldName == pss.ClassType) // { // gc.Visible = true; // gc.Caption = pss.Title; // gc.Columns[0].Caption = pss.Title; // gc.Columns[0].Visible = true; // gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; // } //} } } catch { } } this.ctrlLine_Info1.Type = type; this.ctrlLine_Info1.Flag = flag; this.ctrlLine_Info1.Type2 = type2; }
private void InitValues() { PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; psl.Type = type; psl.Type2 = "SubstationGuiHua"; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (GridBand gc in this.ctrlSubstation_Info1.GridView.Bands) { try { if (gc.Columns[0].FieldName.Substring(0, 1) == "S") { gc.Visible = false; //foreach (PowerSubstationLine pss in li) //{ // if (gc.Columns[0].FieldName == pss.ClassType) // { // gc.Visible = true; // gc.Caption = pss.Title; // gc.Columns[0].Caption = pss.Title; // gc.Columns[0].Visible = true; // gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; // } //} } } catch { } } }
private void InitValues() { PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; psl.Type = type; psl.Type2 = "PlanTable"; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (GridBand gc in this.ctrlItemPlanTable_HuaiBei1.bandedGridView1.Bands) { try { if (gc.Columns[0].FieldName.Substring(0, 1) == "S") { gc.Visible = false; if (gc.Columns[0].FieldName.Substring(0, 2) == "SB") { gc.Visible = true; } foreach (PowerSubstationLine pss in li) { if (gc.Columns[0].FieldName == pss.ClassType) { gc.Visible = true; gc.Caption = pss.Title; gc.Columns[0].Caption = pss.Title; gc.Columns[0].Visible = true; gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; } } } } catch { } } }
private void FrmEditProject_Load(object sender, EventArgs e) { string q0 = ""; string q1 = ""; string q2 = ""; string q3 = ""; double?q4 = null; string q5 = ""; string q6 = ""; string q7 = ""; string q8 = ""; string q9 = ""; string q10 = ""; string q11 = ""; string q12 = ""; string q13 = ""; string q14 = ""; string q15 = ""; string q16 = ""; string q17 = ""; string q18 = ""; string q19 = ""; string q20 = ""; string q21 = ""; string q22 = ""; string q23 = ""; string q24 = ""; int t1 = 0; PSP_PowerTypes_Liao ppt = new PSP_PowerTypes_Liao(); try { ppt.ID = int.Parse(poweruid); } catch { } ppt.Flag2 = flag; PSP_PowerTypes_Liao ps = (PSP_PowerTypes_Liao)Common.Services.BaseService.GetOneByKey <PSP_PowerTypes_Liao>(ppt); // if (ps != null) try { groupBox1.Text = ps.Title; q0 = ps.Title; t1 = ps.Flag; q1 = ps.JianSheXingZhi; q2 = ps.RongLiang; q3 = ps.ChangDu; dt = ps.CreatTime; if (ps.TouZiZongEr.ToString() != "") { q4 = double.Parse(ps.TouZiZongEr); } if (ps.S1 == "" || ps.S1 == null) { q5 = ""; } else { q5 = ps.S1; } if (ps.S2 != "" && ps.S2 != null) { q6 = ps.S2; } if (ps.S3 != "" && ps.S3 != null) { q7 = ps.S3; } if (ps.S4 != "" && ps.S4 != null) { q8 = ps.S4; } if (ps.S5 != "" && ps.S5 != null) { q9 = ps.S5; } if (ps.S6 != "" && ps.S6 != null) { q10 = ps.S6; } if (ps.S7 != "" && ps.S7 != null) { q11 = ps.S7; } if (ps.S8 != "" && ps.S8 != null) { q12 = ps.S8; } if (ps.S9 != "" && ps.S9 != null) { q13 = ps.S9; } if (ps.S10 != "" && ps.S10 != null) { q14 = ps.S10; } if (ps.S11 != "" && ps.S11 != null) { q15 = ps.S11; } if (ps.S12 != "" && ps.S12 != null) { q16 = ps.S12; } if (ps.S13 != "" && ps.S13 != null) { q17 = ps.S13; } if (ps.S14 != "" && ps.S14 != null) { q18 = ps.S14; } if (ps.S15 != "" && ps.S15 != null) { q19 = ps.S15; } if (ps.S16 != "" && ps.S16 != null) { q20 = ps.S16; } if (ps.S17 != "" && ps.S17 != null) { q21 = ps.S17; } if (ps.S18 != "" && ps.S18 != null) { q22 = ps.S18; } if (ps.S19 != "" && ps.S19 != null) { q23 = ps.S19; } if (ps.S20 != "" && ps.S20 != null) { q24 = ps.S20; } } catch { } ac1.Add(q5); ac1.Add(q6); ac1.Add(q7); ac1.Add(q8); ac1.Add(q9); ac1.Add(q10); ac1.Add(q11); ac1.Add(q12); ac1.Add(q13); ac1.Add(q14); ac1.Add(q15); ac1.Add(q16); ac1.Add(q17); ac1.Add(q18); ac1.Add(q19); ac1.Add(q20); ac1.Add(q21); ac1.Add(q22); ac1.Add(q23); ac1.Add(q24); PowerValues ppv = new PowerValues(); if (ps == null) { ppv.TypeID = -1; } else { ppv.TypeID = ps.ID; } //ppv.TypeID1 = flag; IList <PowerValues> listValues = Common.Services.BaseService.GetList <PowerValues>("SelectPowerValuesList", ppv); PowerYears pps = new PowerYears(); pps.Flag = flag; IList <PowerYears> li = Common.Services.BaseService.GetList <PowerYears>("SelectPowerYearsListByFlagSortYear", pps); lb = new Label[li.Count]; te = new TextEdit[li.Count]; int i = 0; lt3.Text = "项目名称:"; lt3.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt3); tt3 = new TextEdit(); tt3.Location = new Point(157, 26 + 33 * i); tt3.Size = new Size(231, 21); groupBox1.Controls.Add(tt3); i++; lt2.Text = "建设性质:"; lt2.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt2); tt2 = new TextEdit(); tt2.Location = new Point(157, 26 + 33 * i); tt2.Size = new Size(231, 21); groupBox1.Controls.Add(tt2); i++; lt4.Text = "变电容量:"; lt4.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt4); tt4 = new TextEdit(); tt4.Location = new Point(157, 26 + 33 * i); tt4.Size = new Size(231, 21); tt4.Properties.DisplayFormat.FormatString = "n4"; tt4.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt4.Properties.EditFormat.FormatString = "n4"; tt4.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt4.Properties.Mask.EditMask = "###########0.####"; tt4.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; groupBox1.Controls.Add(tt4); i++; lt1.Text = "线路长度:"; lt1.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt1); tt1 = new TextEdit(); tt1.Location = new Point(157, 26 + 33 * i); tt1.Size = new Size(231, 21); tt1.Properties.DisplayFormat.FormatString = "n4"; tt1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt1.Properties.EditFormat.FormatString = "n4"; tt1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt1.Properties.Mask.EditMask = "########0.####"; tt1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; groupBox1.Controls.Add(tt1); i++; lt6.Text = "总投资(万元):"; lt6.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt6); tt6 = new TextEdit(); tt6.Location = new Point(157, 26 + 33 * i); tt6.Size = new Size(231, 21); tt6.Properties.DisplayFormat.FormatString = "n4"; tt6.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt6.Properties.EditFormat.FormatString = "n4"; tt6.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt6.Properties.Mask.EditMask = "############0.####"; tt6.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; groupBox1.Controls.Add(tt6); i++; int j = 0; foreach (PowerYears ppy in li) { lb[j] = new Label(); lb[j].Name = "Label" + ppy.Year; lb[j].Text = ppy.Year + "年:"; lb[j].Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lb[j]); te[j] = new TextEdit(); te[j].Name = "Text" + ppy.Year; te[j].Location = new Point(157, 26 + 33 * i); te[j].Size = new Size(231, 21); te[j].Properties.DisplayFormat.FormatString = "n4"; te[j].Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; te[j].Properties.EditFormat.FormatString = "n4"; te[j].Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; te[j].Properties.Mask.EditMask = "##########0.####"; te[j].Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; groupBox1.Controls.Add(te[j]); if (listValues.Count > 0) { foreach (PowerValues ppy1 in listValues) { if (ppy.Year == ppy1.Year) { te[j].Text = ppy1.Value.ToString(); } } } j++; i++; } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = "1"; psl.Type = flag; psl.Type2 = type; IList <PowerSubstationLine> lli = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); sb = new Label[lli.Count]; se = new TextEdit[lli.Count]; j = 0; foreach (PowerSubstationLine pss in lli) { sb[j] = new Label(); sb[j].Name = "Label" + pss.Title; sb[j].Text = pss.Title + ":"; sb[j].Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(sb[j]); se[j] = new TextEdit(); se[j].Name = "Text" + pss.Title; se[j].Tag = "Text" + pss.ClassType; se[j].Location = new Point(157, 26 + 33 * i); se[j].Size = new Size(231, 21); groupBox1.Controls.Add(se[j]); try { int num = 0; if (se[j].Tag.ToString().Length <= 6) { num = int.Parse(se[j].Tag.ToString().Substring(se[j].Tag.ToString().Length - 1, 1)) - 1; } else { num = int.Parse(se[j].Tag.ToString().Substring(se[j].Tag.ToString().Length - 2, 2)) - 1; } if (ac1[num].ToString() != DBNull.Value.ToString() && ac1[num].ToString() != "") { se[j].Text = ac1[num].ToString(); } else { se[j].Text = ""; } } catch (Exception ex) { MsgBox.Show(ex.Message); } j++; i++; } try { tt1.Text = q3.ToString(); tt2.Text = q1.ToString(); tt3.Text = q0.ToString(); tt4.Text = q2.ToString(); tt6.Text = q4.ToString(); } catch { } groupBox1.Size = new Size(434, 30 + 33 * i); simpleButton1.Location = new Point(296, 50 + 33 * i); simpleButton2.Location = new Point(389, 50 + 33 * i); this.Size = new Size(490, 130 + 33 * i); }
private void simpleButton2_Click(object sender, EventArgs e) { PowerSubstationLine pl = new PowerSubstationLine(); classname = textBox1.Text; pl.Type2 = type2; pl.Flag = flag; pl.Title = classname; // pl.Type = type; ////PowerSubstationLine psp_l = new PowerSubstationLine(); ////psp_l = (PowerSubstationLine)Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeFlag", pl); ////psp_l.Type2 = type2; ////psp_l.Flag = flag; psp_sl.Title = textBox1.Text; if (classname.ToString() == "") { MsgBox.Show("类别名称不能为空"); return; } if (al.Contains(textBox1.Text) == true) { MsgBox.Show("已经存在此分类,要想添加,请先删除已存在的" + textBox1.Text + "!"); return; } try { PowerSubstationLine plobj = new PowerSubstationLine(); plobj = (PowerSubstationLine)Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeFlag", pl); if (plobj == null) { try { if (!IsUpdate) { bool bz = false; string f = ""; foreach (string ss in s) { PowerSubstationLine ps = new PowerSubstationLine(); //ps.Title = classname; ps.Flag = flag; //ps.Type = type; ps.Type2 = type2; ps.ClassType = ss; // object obj = Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeClass1", ps); object obj = Common.Services.BaseService.GetObject("SelectPowerSubstationLineByClassTypeType2Class1", ps); if (obj == null) { classtype = ss; bz = true; f = ss; break; } } if (bz) { psp_sl.ClassType = f; psp_sl.Type = type; Common.Services.BaseService.Create <PowerSubstationLine>(psp_sl); } } else { Common.Services.BaseService.Update <PowerSubstationLine>(psp_sl); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { MsgBox.Show("出错啦:" + ex.Message); } } else { MsgBox.Show("此分类已经存在,请重新输入!"); } } catch { } }
private void FrmPower_AddBands_Load(object sender, EventArgs e) { s.Add("S1"); s.Add("S2"); s.Add("S3"); s.Add("S4"); s.Add("S5"); s.Add("S6"); s.Add("S7"); s.Add("S8"); s.Add("S9"); s.Add("S10"); s.Add("S11"); s.Add("S12"); s.Add("S13"); s.Add("S14"); s.Add("S15"); s.Add("S16"); s.Add("S17"); s.Add("S18"); s.Add("S19"); s.Add("S20"); textBox1.Text = classname; classname1 = classname; if (!IsUpdate) { psp_sl = new PowerSubstationLine(); //psp_sl.Type = type; psp_sl.Type2 = type2; psp_sl.Flag = flag; //IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psp_sl); IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psp_sl); if (addflag == "powerflag") { if (li.Count >= 30) { MsgBox.Show("本模块最多允许添加30个自定义列!"); this.Close(); return; } s.Add("S21"); s.Add("S22"); s.Add("S23"); s.Add("S24"); s.Add("S25"); s.Add("S26"); s.Add("S27"); s.Add("S28"); s.Add("S29"); s.Add("S30"); } if (addflag == "form1_liaoflag") { if (li.Count >= 20) { MsgBox.Show("本模块最多允许添加20个自定义列!"); this.Close(); return; } } } else { PowerSubstationLine ps = new PowerSubstationLine(); ps.Title = classname; // ps.ClassType = classtype; ps.Flag = flag; //ps.Type = type; ps.Type2 = type2; //psp_sl = (PowerSubstationLine)Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeFlag", ps); psp_sl = (PowerSubstationLine)Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleType2Flag", ps); } }
private void FrmEditProject_Load(object sender, EventArgs e) { string q1 = ""; string q2 = ""; string q3 = ""; double? q4 = null; string q5 = ""; string q6 = ""; string q7 = ""; string q8 = ""; string q9 = ""; string q10 = ""; string q11 = ""; string q12 = ""; string q13 = ""; string q14 = ""; string q15 = ""; string q16 = ""; string q17 = ""; string q18 = ""; string q19 = ""; string q20 = ""; string q21 = ""; string q22 = ""; string q23 = ""; string q24 = ""; int t1 = 0; PSP_PowerTypes_Liao ppt = new PSP_PowerTypes_Liao(); try { ppt.ID = int.Parse(poweruid); } catch { } ppt.Flag2 = flag; PSP_PowerTypes_Liao ps = Common.Services.BaseService.GetOneByKey<PSP_PowerTypes_Liao>(ppt); if (ps != null) { groupBox1.Text = ps.Title; t1 = ps.Flag; q1 = ps.JianSheXingZhi; q2 = ps.RongLiang; q3 = ps.ChangDu; if (ps.TouZiZongEr.ToString()!="") { q4=double.Parse(ps.TouZiZongEr); } if (ps.S1 == "" || ps.S1 == null) { q5 = ""; } else { q5 = ps.S1; } ac1.Add(q5); if (ps.S2 != "" && ps.S2!=null) { q6 = ps.S2; } ac1.Add(q6); if (ps.S3 != "" && ps.S3 != null) { q7 = ps.S3; } ac1.Add(q7); if (ps.S4 != "" && ps.S4 != null) { q8 = ps.S4; } ac1.Add(ps.S4); if (ps.S5 != "" && ps.S5 != null) { q9 = ps.S5; } ac1.Add(ps.S5); if (ps.S6 != "" && ps.S6 != null) { q10 = ps.S6; } ac1.Add(ps.S6); if (ps.S7 != "" && ps.S7 != null) { q11 = ps.S7; } ac1.Add(ps.S7); if (ps.S8 != "" && ps.S8 != null) { q12 = ps.S8; } ac1.Add(ps.S8); if (ps.S9 != "" && ps.S9 != null) { q13 = ps.S9; } ac1.Add(ps.S9); if (ps.S10 != "" && ps.S10 != null) { q14 = ps.S10; } ac1.Add(ps.S10); if (ps.S11 != "" && ps.S11 != null) { q15 = ps.S11; } ac1.Add(ps.S11); if (ps.S12 != "" && ps.S12 != null) { q16 = ps.S12; } ac1.Add(ps.S12); if (ps.S13 != "" && ps.S13 != null) { q17 = ps.S13; } ac1.Add(ps.S13); if (ps.S14 != "" && ps.S14 != null) { q18 = ps.S14; } ac1.Add(ps.S14); if (ps.S15 != "" && ps.S15 != null) { q19 = ps.S15; } ac1.Add(ps.S15); if (ps.S16 != "" && ps.S16 != null) { q20 = ps.S16; } ac1.Add(ps.S16); if (ps.S17 != "" && ps.S17 != null) { q21 = ps.S17; } ac1.Add(ps.S17); if (ps.S18 != "" && ps.S18 != null) { q22 = ps.S18; } ac1.Add(ps.S18); if (ps.S19 != "" && ps.S19 != null) { q23 = ps.S19; } ac1.Add(ps.S19); if (ps.S20 != "" && ps.S20 != null) { q24 = ps.S20; } ac1.Add(ps.S20); } PowerValues ppv = new PowerValues(); try { ppv.TypeID = int.Parse(poweruid); } catch { } //ppv.TypeID1 = flag; IList<PowerValues> listValues = Common.Services.BaseService.GetList<PowerValues>("SelectPowerValuesList", ppv); PowerYears pps = new PowerYears(); pps.Flag = flag; IList<PowerYears> li = Common.Services.BaseService.GetList<PowerYears>("SelectPowerYearsListByFlag", pps); lb=new Label[li.Count]; te=new TextEdit[li.Count]; int i=0; lt2.Text = "��������:"; lt2.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt2); tt2 = new TextEdit(); tt2.Location = new Point(157, 26 + 33 * i); tt2.Size = new Size(231, 21); groupBox1.Controls.Add(tt2); i++; lt4.Text = "�������:"; lt4.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt4); tt4 = new TextEdit(); tt4.Location = new Point(157, 26 + 33 * i); tt4.Size = new Size(231, 21); tt4.Properties.DisplayFormat.FormatString = "n4"; tt4.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt4.Properties.EditFormat.FormatString = "n4"; tt4.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt4.Properties.Mask.EditMask = "#####0.####"; tt4.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; groupBox1.Controls.Add(tt4); i++; lt1.Text = "��·����:"; lt1.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt1); tt1 = new TextEdit(); tt1.Location = new Point(157, 26 + 33 * i); tt1.Size = new Size(231, 21); tt1.Properties.DisplayFormat.FormatString = "n4"; tt1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt1.Properties.EditFormat.FormatString = "n4"; tt1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt1.Properties.Mask.EditMask = "#####0.####"; tt1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; groupBox1.Controls.Add(tt1); i++; lt6.Text = "��Ͷ�ʣ���Ԫ��:"; lt6.Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lt6); tt6 = new TextEdit(); tt6.Location = new Point(157, 26 + 33 * i); tt6.Size = new Size(231, 21); tt6.Properties.DisplayFormat.FormatString = "n4"; tt6.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt6.Properties.EditFormat.FormatString = "n4"; tt6.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; tt6.Properties.Mask.EditMask = "#####0.####"; tt6.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; groupBox1.Controls.Add(tt6); i++; int j = 0; foreach (PowerYears ppy in li) { lb[j] = new Label(); lb[j].Name = "Label" + ppy.Year; lb[j].Text = ppy.Year + ":"; lb[j].Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(lb[j]); te[j] = new TextEdit(); te[j].Name = "Text" + ppy.Year; te[j].Location = new Point(157, 26 + 33 * i); te[j].Size = new Size(231, 21); groupBox1.Controls.Add(te[j]); foreach (PowerValues ppy1 in listValues) { if (ppy.Year == ppy1.Year) te[j].Text = ppy1.Value.ToString(); } j++; i++; } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = "1"; psl.Type =flag ; psl.Type2 = type; IList<PowerSubstationLine> lli = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); sb = new Label[lli.Count]; se = new TextEdit[lli.Count]; j = 0; foreach (PowerSubstationLine pss in lli) { sb[j] = new Label(); sb[j].Name = "Label" + pss.Title; sb[j].Text = pss.Title + ":"; sb[j].Location = new Point(52, 27 + 33 * i); groupBox1.Controls.Add(sb[j]); se[j] = new TextEdit(); se[j].Name = "Text" + pss.Title; se[j].Location = new Point(157, 26 + 33 * i); se[j].Size = new Size(231, 21); groupBox1.Controls.Add(se[j]); try { if (ac1[j].ToString() != DBNull.Value.ToString() && ac1[j].ToString() != "") { se[j].Text = ac1[j].ToString(); } else { se[j].Text = ""; } } catch (Exception ex) { MsgBox.Show(ex.Message); } j++; i++; } try { tt1.Text = q3.ToString(); tt2.Text = q1.ToString(); tt4.Text = q2.ToString(); tt6.Text = q4.ToString(); } catch { } groupBox1.Size = new Size(434, 30 + 33 * i); simpleButton1.Location = new Point(296, 50 + 33 * i); simpleButton2.Location = new Point(389, 50 + 33 * i); this.Size = new Size(490, 130 + 33 * i); }
private void InitValues() { //Hashtable ht = Class1.GetXmlElementValue(filepath + flag + type2 + ".xml"); ArrayList al = Class1.GetXmlElement(filepath + flag + type2 + ".xml"); Hashtable ht1 = new Hashtable(); Hashtable ht2 = new Hashtable(); PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; psl.Type2 = type2; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psl); foreach (PowerSubstationLine pss in li) ht1.Add(pss.ClassType, pss.Title); foreach (GridColumn gc in this.ctrlPower1.GridView.Columns) { try { ht2.Add(gc.FieldName, gc); if (ht1.ContainsKey(gc.FieldName)) { gc.Caption = ht1[gc.FieldName].ToString(); gc.Visible = true; } } catch { } } for(int i=0;i<al.Count;i++) { try { if (ht2.ContainsKey(al[i].ToString().Replace("col",""))) { GridColumn gc1 = (GridColumn)ht2[al[i].ToString().Replace("col", "")]; gc1.VisibleIndex = i; } } catch { } } ////// { ////// try ////// { ////// if (gc.FieldName.Substring(0, 1) == "S") ////// { ////// if (gc.FieldName == pss.ClassType) ////// { ////// gc.Caption = pss.Title; ////// gc.Visible = true; ////// if(ht.ContainsKey("col"+gc.FieldName)) ////// gc.VisibleIndex = Convert.ToInt32(ht["col" + gc.FieldName].ToString())*100; ////// } ////// } ////// } ////// catch (Exception e) ////// { MsgBox.Show(e.Message); } ////// } //////} }
private void FrmLine_InfoDialog_Load(object sender, EventArgs e) { if (isselect) { this.vGridControl.Enabled = false; } if (!IsCreate) { checkEdit1.Visible = false; } IList <Line_Info> list = new List <Line_Info>(); list.Add(Object); this.vGridControl.DataSource = list; foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "") { continue; } if (gc.Properties.FieldName.Substring(0, 1) == "S") { gc.Visible = false; } if (gc.Properties.FieldName.Substring(0, 1) == "K" && types2 == "66") { gc.Visible = false; } if (gc.Properties.FieldName.Substring(0, 1) == "L" && types2 == "10") { gc.Visible = false; } } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = types2; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName == "") { if (types2 == "66") { gc1.Visible = false; } continue; } if (gc1.Properties.FieldName.Substring(0, 1) == "S") { foreach (PowerSubstationLine pss in li) { if (gc1.Properties.FieldName == pss.ClassType) { gc1.Properties.Caption = pss.Title; gc1.Visible = true; } } } } //MessageBox.Show(liss.Count.ToString()); Hashtable hs1 = new Hashtable(); Hashtable hs2 = new Hashtable(); Hashtable hs3 = new Hashtable(); foreach (Line_Info liii in liss) { if (!hs1.ContainsValue(liii.K2)) { hs1.Add(Guid.NewGuid().ToString(), liii.K2); } if (!hs2.ContainsValue(liii.K3)) { hs2.Add(Guid.NewGuid().ToString(), liii.K3); } if (!hs3.ContainsValue(liii.K22)) { hs3.Add(Guid.NewGuid().ToString(), liii.K22); } } //MessageBox.Show(hs1.Count.ToString()); //MessageBox.Show(hs2.Count.ToString()); //MessageBox.Show(hs3.Count.ToString()); foreach (DictionaryEntry de1 in hs1) { repositoryItemComboBox1.Items.Add(de1.Value.ToString()); } foreach (DictionaryEntry de2 in hs2) { repositoryItemComboBox2.Items.Add(de2.Value.ToString()); } //foreach (DictionaryEntry de3 in hs3) //{ // repositoryItemComboBox3.Items.Add(de3.Value.ToString()); //} }
private void barDel1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { GridColumn gc = this.ctrlPSP_PowerSubstationInfo1.GridView.FocusedColumn; if (gc == null) return; if (gc.FieldName.Substring(0, 1) != "S") { MsgBox.Show("����ɾ���̶���"); return; } bool bl = false; for(int i=0;i<ctrlPSP_PowerSubstationInfo1.GridView.VisibleColumns.Count;i++) { if (gc.Caption == ctrlPSP_PowerSubstationInfo1.GridView.VisibleColumns[i].Caption) { if (MsgBox.ShowYesNo("�Ƿ�ɾ�� " + gc.Caption + " ���������ݣ�") != DialogResult.Yes) { return; } bl = true; break; } else { bl = false; } } if (bl == true) { int colIndex = ctrlPSP_PowerSubstationInfo1.GridView.FocusedColumn.VisibleIndex; foreach (GridColumn gc1 in ctrlPSP_PowerSubstationInfo1.GridView.Columns) { try { if (gc1.Name == gc.Name) { gc1.Visible = false; } } catch { } } gc.Visible = false; gc.OptionsColumn.ShowInCustomizationForm = false; PSP_PowerSubstationInfo si = new PSP_PowerSubstationInfo(); si.Title = gc.FieldName + "=''"; si.Flag = flag; Itop.Client.Common.Services.BaseService.Update("UpdatePSP_PowerSubstationInfoByFlag", si); PowerSubstationLine psl = new PowerSubstationLine(); psl.ClassType = gc.FieldName; psl.Flag = flag; //psl.Type = type; psl.Title = gc.Caption; psl.Type2="PowerSubstation" + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20); Itop.Client.Common.Services.BaseService.Update("DeletePowerSubstationLineByNoType", psl); if (colIndex >= ctrlPSP_PowerSubstationInfo1.GridView.VisibleColumns.Count) { colIndex--; } ctrlPSP_PowerSubstationInfo1.GridView.FocusedColumn = ctrlPSP_PowerSubstationInfo1.GridView.VisibleColumns[colIndex]; } else { return; } }
private void InitValues() { //Hashtable ht = Class1.GetXmlElementValue(filepath + flag + type2 + ".xml"); ArrayList al = Class1.GetXmlElement(filepath + flag + type2 + ".xml"); Hashtable ht1 = new Hashtable(); Hashtable ht2 = new Hashtable(); PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flag; psl.Type2 = type2; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psl); foreach (PowerSubstationLine pss in li) { ht1.Add(pss.ClassType, pss.Title); } foreach (GridColumn gc in this.ctrlPower1.GridView.Columns) { try { ht2.Add(gc.FieldName, gc); if (ht1.ContainsKey(gc.FieldName)) { gc.Caption = ht1[gc.FieldName].ToString(); gc.Visible = true; } } catch { } } for (int i = 0; i < al.Count; i++) { try { if (ht2.ContainsKey(al[i].ToString().Replace("col", ""))) { GridColumn gc1 = (GridColumn)ht2[al[i].ToString().Replace("col", "")]; gc1.VisibleIndex = i; } } catch { } } ////// { ////// try ////// { ////// if (gc.FieldName.Substring(0, 1) == "S") ////// { ////// if (gc.FieldName == pss.ClassType) ////// { ////// gc.Caption = pss.Title; ////// gc.Visible = true; ////// if(ht.ContainsKey("col"+gc.FieldName)) ////// gc.VisibleIndex = Convert.ToInt32(ht["col" + gc.FieldName].ToString())*100; ////// } ////// } ////// } ////// catch (Exception e) ////// { MsgBox.Show(e.Message); } ////// } //////} }
private void InitValues() { PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = "1"; psl.Type = typeFlag2; psl.Type2 = type; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); //foreach (GridBand gc in this.ctrlPSP_PowerSubstationInfo1.bandedGridView1.Bands) //{ // try // { // if (gc.Columns[0].FieldName.Substring(0, 1) == "S") // { // gc.Visible = false; foreach (PowerSubstationLine pss in li) { ReAddColumn(pss.ClassType,pss.Title); } // } // } // catch { } //} }
private void simpleButton1_Click_1(object sender, EventArgs e) { PowerSubstationLine pl = new PowerSubstationLine(); classname = textBox1.Text; pl.Type2 = type2; pl.Flag = flag; pl.Title = classname; pl.Type = type; ////PowerSubstationLine psp_l = new PowerSubstationLine(); ////psp_l = (PowerSubstationLine)Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeFlag", pl); ////psp_l.Type2 = type2; ////psp_l.Flag = flag; psp_sl.Title = textBox1.Text; if (classname.ToString() == "") { MsgBox.Show("������Ʋ���Ϊ��"); return; } if (al.Contains(textBox1.Text) == true) { MsgBox.Show("�Ѿ����ڴ���ݣ�Ҫ����ӣ�����ɾ���Ѵ��ڵ�" + textBox1.Text + "!"); return; } try { if (Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeFlag", pl) == null) { try { if (!IsUpdate) { bool bz = false; string f = ""; foreach (string ss in s) { PowerSubstationLine ps = new PowerSubstationLine(); ps.Title = classname; ps.Flag = flag; ps.Type = type; ps.Type2 = type2; ps.ClassType = ss; object obj = Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeClass1", ps); if (obj == null) { classtype = ss; bz = true; f = ss; break; } } if (bz) { psp_sl.ClassType = f; Common.Services.BaseService.Create<PowerSubstationLine>(psp_sl); } } else { Common.Services.BaseService.Update<PowerSubstationLine>(psp_sl); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { MsgBox.Show("��������" + ex.Message); } } else { MsgBox.Show("�˷����Ѿ����ڣ����������룡"); } } catch { } }
private void FrmLine_InfoDialog_Load(object sender, EventArgs e) { if (isselect) this.vGridControl.Enabled = false; if (!IsCreate) { checkEdit1.Visible=false; } IList<Line_Info> list = new List<Line_Info>(); list.Add(Object); string s = " ProjectID='" + Itop.Client.MIS.ProgUID + "'"; IList list2 = Services.BaseService.GetList("SelectPS_Table_AreaWHByConn", s); repositoryItemLookUpEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); repositoryItemLookUpEdit1.Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] { new DevExpress.XtraEditors.Controls.LookUpColumnInfo("ID", "", 20, DevExpress.Utils.FormatType.None, "", false, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None), new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Title")}); repositoryItemLookUpEdit1.DisplayMember = "Title"; repositoryItemLookUpEdit1.NullText = ""; repositoryItemLookUpEdit1.ValueMember = "ID"; repositoryItemLookUpEdit1.DataSource = list2; this.vGridControl.DataSource = list; WireCategory wirewire = new WireCategory(); IList list1 = Services.BaseService.GetList("SelectWireCategoryList", ""); foreach (WireCategory sub in list1) { if (repositoryItemComboBox7.Items.IndexOf(sub.WireType) == -1) { repositoryItemComboBox7.Items.Add(sub.WireType); } } foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "") continue; if (gc.Properties.FieldName.Substring(0, 1) == "S" && gc.Properties.FieldName != "S4") gc.Visible = false; if (gc.Properties.FieldName.Substring(0, 1) == "K" && types2=="66") gc.Visible = false; if (gc.Properties.FieldName.Substring(0, 1) == "L" && types2 == "10") gc.Visible = false; } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = types2; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName == "") { if (types2 == "66") gc1.Visible = false; continue; } if (gc1.Properties.FieldName.Substring(0, 1) == "S") { //foreach (PowerSubstationLine pss in li) //{ // if (gc1.Properties.FieldName == pss.ClassType) // { // gc1.Properties.Caption = pss.Title; // gc1.Visible = true; // } //} } } //MessageBox.Show(liss.Count.ToString()); Hashtable hs1 = new Hashtable(); Hashtable hs2 = new Hashtable(); Hashtable hs3 = new Hashtable(); //foreach (Line_Info liii in liss) //{ // if (!hs1.ContainsValue(liii.K2)) // hs1.Add(Guid.NewGuid().ToString(), liii.K2); // if (!hs2.ContainsValue(liii.K3)) // hs2.Add(Guid.NewGuid().ToString(), liii.K3); // if (!hs3.ContainsValue(liii.K22)) // hs3.Add(Guid.NewGuid().ToString(), liii.K22); //} //MessageBox.Show(hs1.Count.ToString()); //MessageBox.Show(hs2.Count.ToString()); //MessageBox.Show(hs3.Count.ToString()); //foreach (DictionaryEntry de1 in hs1) //{ // try // { // repositoryItemComboBox1.Items.Add(de1.Value.ToString()); // } // catch { } //} //foreach (DictionaryEntry de2 in hs2) //{ // try // { // repositoryItemComboBox2.Items.Add(de2.Value.ToString()); // } // catch { } //} //foreach (DictionaryEntry de3 in hs3) //{ // repositoryItemComboBox3.Items.Add(de3.Value.ToString()); //} }
private void FrmPSP_PowerSubstationInfoDialog_Load(object sender, EventArgs e) { if (isselect) { this.vGridControl.Enabled = false; } if (!IsCreate) { checkEdit1.Visible = false; } IList <PSP_PowerSubstationInfo> list = new List <PSP_PowerSubstationInfo>(); list.Add(Object); this.vGridControl.DataSource = list; this.xtraTabControl1.TabPages[0].Text = this.Text; PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; //psl.Type = types1; psl.Type2 = types2; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psl); foreach (PowerSubstationLine pss in li) { BaseRow vrow = new DevExpress.XtraVerticalGrid.Rows.EditorRow(); vrow.Properties.Caption = pss.Title; vrow.Properties.FieldName = pss.ClassType; vrow.Height = 25; vrow.Properties.RowEdit = ItemTextEditS1; vrow.Visible = true; vGridControl.Rows.Add(vrow); } //vGridControl.Rows.Add(); //this.rowS2 = new DevExpress.XtraVerticalGrid.Rows.EditorRow(); ////foreach (PowerSubstationLine pss in li) ////{ ////foreach (BaseRow gc1 in this.vGridControl.Rows) ////{ //// if (gc1.Properties.FieldName.Substring(0, 1) == "S") //// { //// if (gc1.Properties.FieldName == pss.ClassType) //// { //// gc1.Properties.Caption = pss.Title; //// gc1.Index = int.Parse(pss.Type); //// //gc1.VisibleIndex = int.Parse(pss.Type); //// //DevExpress.XtraVerticalGrid.Rows.BaseRow aa = DevExpress.Utils.c; //// gc1.Visible = true; //// } //// } ////} ////} }
private void FrmPSP_PlanTable_HuaiBeiDialog_Load(object sender, EventArgs e) { if (isselect) { this.vGridControl.Enabled = false; } foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName.Substring(0, 1) == "S") { gc.Visible = false; } if (gc.Properties.FieldName.Substring(0, 2) == "SB") { gc.Visible = true; } } if (IsCreate) { ////this.rowBD220.Enabled = false; ////this.rowLine220.Enabled = false; ////this.rowLine110.Enabled = false; ////this.rowBD110.Enabled = false; if (_obj.KeyFlag == "time1" || _obj.KeyFlag == "time2" || _obj.KeyFlag == "time3") { _obj.ItemSB = "0"; _obj.ItemPF = "0"; _obj.KYWC = "0"; _obj.KYPS = "0"; _obj.PSYJ = "0"; ////_obj.CSSC = "0"; ////_obj.JSGFSSB = "0"; ////_obj.ZBSB = "0"; ////_obj.ZBSHDateTime = "0"; _obj.XZYJS = "0"; _obj.HPPF = "0"; _obj.TDYS = "0"; _obj.SBHZSQ = "0"; _obj.XMHZ = "0"; _obj.JHKSDateTime = "0"; _obj.JHTCDateTime = "0"; // _obj.JHTCDateTime_GuiHua = "0"; } foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") { gc.Visible = false; } //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") { gc.Visible = false; } } } IList <PSP_PlanTable_HuaiBei> list = new List <PSP_PlanTable_HuaiBei>(); list.Add(Object); this.vGridControl.DataSource = list; //if (!(_obj.KeyFlag == "time1" || _obj.KeyFlag == "time2" || _obj.KeyFlag == "time3" || _obj.KeyFlag == "220" || _obj.KeyFlag == "110" || _obj.KeyFlag == "kuojian")) //{ // foreach (BaseRow gc in this.vGridControl.Rows) // { // if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ" ) // gc.Visible = false; // if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime" ) // gc.Visible = false; // if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") // gc.Visible = false; // } //} if (_obj.ParentID == "220") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") { gc.Visible = false; } //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") { gc.Visible = false; } if (gc.Properties.FieldName == "Line110" || gc.Properties.FieldName == "BD110") { gc.Visible = false; } } } if (_obj.ParentID == "110") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") { gc.Visible = false; } //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") { gc.Visible = false; } if (gc.Properties.FieldName == "Line220" || gc.Properties.FieldName == "BD220") { gc.Visible = false; } } } if (_obj.KeyFlag == "220" || _obj.KeyFlag == "110" || _obj.KeyFlag == "kuojian") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "BD220" || gc.Properties.FieldName == "BD110" || gc.Properties.FieldName == "Line110" || gc.Properties.FieldName == "Line220") { gc.Visible = false; } if (gc.Properties.FieldName == "Contents" || gc.Properties.FieldName == "DeptName" || gc.Properties.FieldName == "DY" || gc.Properties.FieldName == "TZGM") { gc.Visible = false; } if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") { gc.Visible = false; } //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") { gc.Visible = false; } } } if (_obj.KeyFlag == "time1" || _obj.KeyFlag == "time2" || _obj.KeyFlag == "time3") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "BD220" || gc.Properties.FieldName == "BD110" || gc.Properties.FieldName == "Line110" || gc.Properties.FieldName == "Line220") { gc.Visible = false; } if (gc.Properties.FieldName == "Contents" || gc.Properties.FieldName == "DeptName" || gc.Properties.FieldName == "DY" || gc.Properties.FieldName == "TZGM" || gc.Properties.FieldName == "JHTCDateTime_GuiHua") { gc.Visible = false; } //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; } } if (_obj.KeyFlag == "time1" || _obj.KeyFlag == "time2" || _obj.KeyFlag == "time3" || _obj.KeyFlag == "220" || _obj.KeyFlag == "110" || _obj.KeyFlag == "kuojian" || _obj.KeyFlag == "220千伏" || _obj.KeyFlag == "110千伏") { foreach (BaseRow gc in vGridControl.Rows) { if (gc.Properties.FieldName == "Title") { gc.Properties.ReadOnly = true; } } } if (_obj.KeyFlag == "220千伏" || _obj.KeyFlag == "110千伏") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "BD220" || gc.Properties.FieldName == "BD110" || gc.Properties.FieldName == "Line110" || gc.Properties.FieldName == "Line220") { gc.Visible = false; } if (gc.Properties.FieldName == "TZGM" || gc.Properties.FieldName == "JHTCDateTime_GuiHua") { gc.Visible = false; } if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") { gc.Visible = false; } //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") { gc.Visible = false; } } } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = types2; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName.Substring(0, 1) == "S") { foreach (PowerSubstationLine pss in li) { if (gc1.Properties.FieldName == pss.ClassType) { gc1.Properties.Caption = pss.Title; gc1.Visible = true; } } } } }
private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { GridColumn gc = this.ctrlSubstation_Info1.GridView.FocusedColumn; if (gc == null) return; if (gc.FieldName.Substring(0, 1) != "S") { MsgBox.Show("����ɾ���̶���"); return; } if (MsgBox.ShowYesNo("�Ƿ�ɾ�� " + gc.Caption + " ���������ݣ�") != DialogResult.Yes) { return; } foreach (GridBand gc1 in ctrlSubstation_Info1.GridView.Bands) { try { if (gc1.Columns[0].Name == gc.Name) { gc1.Visible = false; } } catch { } } gc.Visible = false; gc.OptionsColumn.ShowInCustomizationForm = false; Substation_Info si = new Substation_Info(); si.Title = gc.FieldName + "=''"; si.Flag = flag; Itop.Client.Common.Services.BaseService.Update("UpdateSubstation_InfoByFlag", si); PowerSubstationLine psl = new PowerSubstationLine(); psl.ClassType = gc.FieldName; psl.Flag = flag; psl.Type = type; psl.Title = gc.Caption; psl.Type2 = "SubstationGuiHua"; Itop.Client.Common.Services.BaseService.Update("DeletePowerSubstationLineByAll", psl); }
private void FrmPSP_PowerSubstationInfoDialog_Load(object sender, EventArgs e) { if (isselect) this.vGridControl.Enabled = false; if (!IsCreate) { checkEdit1.Visible = false; } IList<PSP_PowerSubstationInfo> list = new List<PSP_PowerSubstationInfo>(); list.Add(Object); this.vGridControl.DataSource = list; this.xtraTabControl1.TabPages[0].Text = this.Text; PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; //psl.Type = types1; psl.Type2 = types2; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psl); foreach (PowerSubstationLine pss in li) { BaseRow vrow = new DevExpress.XtraVerticalGrid.Rows.EditorRow(); vrow.Properties.Caption = pss.Title; vrow.Properties.FieldName = pss.ClassType; vrow.Height = 25; vrow.Properties.RowEdit = ItemTextEditS1; vrow.Visible = true; vGridControl.Rows.Add(vrow); } //vGridControl.Rows.Add(); //this.rowS2 = new DevExpress.XtraVerticalGrid.Rows.EditorRow(); ////foreach (PowerSubstationLine pss in li) ////{ ////foreach (BaseRow gc1 in this.vGridControl.Rows) ////{ //// if (gc1.Properties.FieldName.Substring(0, 1) == "S") //// { //// if (gc1.Properties.FieldName == pss.ClassType) //// { //// gc1.Properties.Caption = pss.Title; //// gc1.Index = int.Parse(pss.Type); //// //gc1.VisibleIndex = int.Parse(pss.Type); //// //DevExpress.XtraVerticalGrid.Rows.BaseRow aa = DevExpress.Utils.c; //// gc1.Visible = true; //// } //// } ////} ////} }
private void FrmLine_InfoDialog_Load(object sender, EventArgs e) { if (isselect) { this.vGridControl.Enabled = false; } if (!IsCreate) { checkEdit1.Visible = false; } IList <Line_Info> list = new List <Line_Info>(); list.Add(Object); string s = " ProjectID='" + Itop.Client.MIS.ProgUID + "'"; IList list2 = Services.BaseService.GetList("SelectPS_Table_AreaWHByConn", s); repositoryItemLookUpEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); repositoryItemLookUpEdit1.Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] { new DevExpress.XtraEditors.Controls.LookUpColumnInfo("ID", "", 20, DevExpress.Utils.FormatType.None, "", false, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None), new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Title") }); repositoryItemLookUpEdit1.DisplayMember = "Title"; repositoryItemLookUpEdit1.NullText = ""; repositoryItemLookUpEdit1.ValueMember = "ID"; repositoryItemLookUpEdit1.DataSource = list2; this.vGridControl.DataSource = list; WireCategory wirewire = new WireCategory(); IList list1 = Services.BaseService.GetList("SelectWireCategoryList", ""); foreach (WireCategory sub in list1) { if (repositoryItemComboBox7.Items.IndexOf(sub.WireType) == -1) { repositoryItemComboBox7.Items.Add(sub.WireType); } } foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "") { continue; } if (gc.Properties.FieldName.Substring(0, 1) == "S" && gc.Properties.FieldName != "S4") { gc.Visible = false; } if (gc.Properties.FieldName.Substring(0, 1) == "K" && types2 == "66") { gc.Visible = false; } if (gc.Properties.FieldName.Substring(0, 1) == "L" && types2 == "10") { gc.Visible = false; } } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = types2; IList <PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList <PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName == "") { if (types2 == "66") { gc1.Visible = false; } continue; } if (gc1.Properties.FieldName.Substring(0, 1) == "S") { //foreach (PowerSubstationLine pss in li) //{ // if (gc1.Properties.FieldName == pss.ClassType) // { // gc1.Properties.Caption = pss.Title; // gc1.Visible = true; // } //} } } //MessageBox.Show(liss.Count.ToString()); Hashtable hs1 = new Hashtable(); Hashtable hs2 = new Hashtable(); Hashtable hs3 = new Hashtable(); //foreach (Line_Info liii in liss) //{ // if (!hs1.ContainsValue(liii.K2)) // hs1.Add(Guid.NewGuid().ToString(), liii.K2); // if (!hs2.ContainsValue(liii.K3)) // hs2.Add(Guid.NewGuid().ToString(), liii.K3); // if (!hs3.ContainsValue(liii.K22)) // hs3.Add(Guid.NewGuid().ToString(), liii.K22); //} //MessageBox.Show(hs1.Count.ToString()); //MessageBox.Show(hs2.Count.ToString()); //MessageBox.Show(hs3.Count.ToString()); //foreach (DictionaryEntry de1 in hs1) //{ // try // { // repositoryItemComboBox1.Items.Add(de1.Value.ToString()); // } // catch { } //} //foreach (DictionaryEntry de2 in hs2) //{ // try // { // repositoryItemComboBox2.Items.Add(de2.Value.ToString()); // } // catch { } //} //foreach (DictionaryEntry de3 in hs3) //{ // repositoryItemComboBox3.Items.Add(de3.Value.ToString()); //} }
private void simpleButton1_Click(object sender, EventArgs e) { classname = psp_sl.Title = spinEdit1.Text; if (classname.ToString() == "") { MsgBox.Show("类别名称不能为空"); return; } try { if (Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeClass", psp_sl) == null) { try { if (!IsUpdate) { bool bz = false; string f = ""; foreach (string ss in s) { PowerSubstationLine ps = new PowerSubstationLine(); ps.Title = classname; ps.Flag = flag; ps.Type = type; ps.Type2 = type2; ps.ClassType = ss; object obj = Common.Services.BaseService.GetObject("SelectPowerSubstationLineByTitleTypeClass1", ps); if (obj == null) { classtype = ss; bz = true; f = ss; break; } } if (bz) { psp_sl.ClassType = f; // psp_sl.UID+="|"+proj Common.Services.BaseService.Create<PowerSubstationLine>(psp_sl); } } else { Common.Services.BaseService.Update<PowerSubstationLine>(psp_sl); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { MsgBox.Show("出错啦:" + ex.Message); } } else { MsgBox.Show("此分类已经存在,请重新输入!"); } } catch { } }
private void FrmPSP_PlanTable_HuaiBeiDialog_Load(object sender, EventArgs e) { if (isselect) this.vGridControl.Enabled = false; foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName.Substring(0, 1) == "S") gc.Visible = false; if (gc.Properties.FieldName.Substring(0, 2) == "SB") gc.Visible = true; } if (IsCreate) { ////this.rowBD220.Enabled = false; ////this.rowLine220.Enabled = false; ////this.rowLine110.Enabled = false; ////this.rowBD110.Enabled = false; if (_obj.KeyFlag == "time1" || _obj.KeyFlag == "time2" || _obj.KeyFlag == "time3") { _obj.ItemSB = "0"; _obj.ItemPF = "0"; _obj.KYWC = "0"; _obj.KYPS = "0"; _obj.PSYJ = "0"; ////_obj.CSSC = "0"; ////_obj.JSGFSSB = "0"; ////_obj.ZBSB = "0"; ////_obj.ZBSHDateTime = "0"; _obj.XZYJS = "0"; _obj.HPPF = "0"; _obj.TDYS = "0"; _obj.SBHZSQ = "0"; _obj.XMHZ = "0"; _obj.JHKSDateTime = "0"; _obj.JHTCDateTime = "0"; // _obj.JHTCDateTime_GuiHua = "0"; } foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") gc.Visible = false; //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") gc.Visible = false; } } IList<PSP_PlanTable_HuaiBei> list = new List<PSP_PlanTable_HuaiBei>(); list.Add(Object); this.vGridControl.DataSource = list; //if (!(_obj.KeyFlag == "time1" || _obj.KeyFlag == "time2" || _obj.KeyFlag == "time3" || _obj.KeyFlag == "220" || _obj.KeyFlag == "110" || _obj.KeyFlag == "kuojian")) //{ // foreach (BaseRow gc in this.vGridControl.Rows) // { // if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ" ) // gc.Visible = false; // if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime" ) // gc.Visible = false; // if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") // gc.Visible = false; // } //} if (_obj.ParentID == "220") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") gc.Visible = false; //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") gc.Visible = false; if (gc.Properties.FieldName == "Line110" || gc.Properties.FieldName == "BD110") gc.Visible = false; } } if (_obj.ParentID == "110") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") gc.Visible = false; //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") gc.Visible = false; if (gc.Properties.FieldName == "Line220" || gc.Properties.FieldName == "BD220") gc.Visible = false; } } if (_obj.KeyFlag == "220" || _obj.KeyFlag == "110" || _obj.KeyFlag == "kuojian") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "BD220" || gc.Properties.FieldName == "BD110" || gc.Properties.FieldName == "Line110" || gc.Properties.FieldName == "Line220") gc.Visible = false; if (gc.Properties.FieldName == "Contents" || gc.Properties.FieldName == "DeptName" || gc.Properties.FieldName == "DY" || gc.Properties.FieldName == "TZGM") gc.Visible = false; if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") gc.Visible = false; //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") gc.Visible = false; } } if (_obj.KeyFlag == "time1" || _obj.KeyFlag == "time2" || _obj.KeyFlag == "time3") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "BD220" || gc.Properties.FieldName == "BD110" || gc.Properties.FieldName == "Line110" || gc.Properties.FieldName == "Line220") gc.Visible = false; if (gc.Properties.FieldName == "Contents" || gc.Properties.FieldName == "DeptName" || gc.Properties.FieldName == "DY" || gc.Properties.FieldName == "TZGM" || gc.Properties.FieldName == "JHTCDateTime_GuiHua") gc.Visible = false; //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; } } if (_obj.KeyFlag == "time1" || _obj.KeyFlag == "time2" || _obj.KeyFlag == "time3" || _obj.KeyFlag == "220" || _obj.KeyFlag == "110" || _obj.KeyFlag == "kuojian" || _obj.KeyFlag == "220ǧ��" || _obj.KeyFlag == "110ǧ��") { foreach (BaseRow gc in vGridControl.Rows) { if (gc.Properties.FieldName == "Title") gc.Properties.ReadOnly = true; } } if (_obj.KeyFlag == "220ǧ��" || _obj.KeyFlag == "110ǧ��") { foreach (BaseRow gc in this.vGridControl.Rows) { if (gc.Properties.FieldName == "BD220" || gc.Properties.FieldName == "BD110" || gc.Properties.FieldName == "Line110" || gc.Properties.FieldName == "Line220") gc.Visible = false; if (gc.Properties.FieldName == "TZGM" || gc.Properties.FieldName == "JHTCDateTime_GuiHua") gc.Visible = false; if (gc.Properties.FieldName == "ItemSB" || gc.Properties.FieldName == "ItemPF" || gc.Properties.FieldName == "KYWC" || gc.Properties.FieldName == "KYPS" || gc.Properties.FieldName == "PSYJ") gc.Visible = false; //if (gc.Properties.FieldName == "CSSC" || gc.Properties.FieldName == "JSGFSSB" || gc.Properties.FieldName == "ZBSB" || gc.Properties.FieldName == "ZBSHDateTime") // gc.Visible = false; if (gc.Properties.FieldName == "XZYJS" || gc.Properties.FieldName == "HPPF" || gc.Properties.FieldName == "TDYS" || gc.Properties.FieldName == "SBHZSQ" || gc.Properties.FieldName == "XMHZ" || gc.Properties.FieldName == "JHKSDateTime" || gc.Properties.FieldName == "JHTCDateTime") gc.Visible = false; } } PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type = types1; psl.Type2 = types2; IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType", psl); foreach (BaseRow gc1 in this.vGridControl.Rows) { if (gc1.Properties.FieldName.Substring(0, 1) == "S") { foreach (PowerSubstationLine pss in li) { if (gc1.Properties.FieldName == pss.ClassType) { gc1.Properties.Caption = pss.Title; gc1.Visible = true; } } } } }
private void gridView1_Layout(object sender, EventArgs e) { //string filepath = Path.GetTempPath(); //this.ctrlPSP_PowerSubstationInfo1.bandedGridView1.SaveLayoutToXml(filepath + "SubstationLayOut.xml"); PowerSubstationLine psl = new PowerSubstationLine(); psl.Flag = flags1; psl.Type2 = types2 + "|" + Itop.Client.MIS.ProgUID.Substring(0, 20); IList<PowerSubstationLine> li = Itop.Client.Common.Services.BaseService.GetList<PowerSubstationLine>("SelectPowerSubstationLineByFlagType2", psl); foreach (PowerSubstationLine psp in li) { foreach (GridColumn gc in this.gridView1.VisibleColumns) { try { if (gc.FieldName.Substring(0, 1) == "S") { if (gc.FieldName == psp.ClassType) { //gc.Caption = pss.Title; psp.Type = gc.VisibleIndex.ToString(); //gc.Visible = true; //gc.Columns[0].Caption = pss.Title; //gc.Columns[0].Visible = true; //gc.Columns[0].OptionsColumn.ShowInCustomizationForm = true; } } } catch { } } if(psp.Type!="-1") Itop.Client.Common.Services.BaseService.Update("UpdatePowerSubstationLine", psp); } }