public void LoadYear() { yearR = oper.GetYearRange("Col5='" + GetProject + "' and Col4='" + mark + "'"); for (int i = yearR.BeginYear; i <= yearR.FinishYear; i++) { comboBoxEdit2.Properties.Items.Add(i.ToString()); } comboBoxEdit2.SelectedIndex = 0; comboBoxEdit1.SelectedIndex = 0; }
private void Form1_Load(object sender, EventArgs e) { HideToolBarButton(); yAnge = oper.GetYearRange("Col5='" + GetProjectID + "' and Col4='" + OperTable.elec + "'"); Show(); Application.DoEvents(); this.Cursor = Cursors.WaitCursor; treeList1.BeginUpdate(); LoadData(); treeList1.EndUpdate(); this.Cursor = Cursors.Default; }
//public Ps_YearRange yAnge = new Ps_YearRange(); // private Ps_YearRange yearRange = OperTable.GetYearRange(); public void LoadTextBox() { Ps_YearRange yearRange = oper.GetYearRange("Col5='" + GetProject + "' and Col4='" + mark + "'"); Point bt = new Point(); for (int i = yearRange.StartYear; i <= yearRange.FinishYear; i++) { Point pt = GetLocation(i - yearRange.StartYear + 1); Label label = new Label(); label.Name = "x" + i.ToString(); label.Text = i.ToString() + "年:"; label.Location = pt; label.Size = new Size(50, 20); this.Controls.Add(label); TextBox box = new TextBox(); box.Name = "y" + i.ToString(); box.Text = textAttr.ContainsKey(box.Name) ? textAttr[box.Name].ToString() : ""; box.Location = new Point(pt.X + 50, pt.Y - 5); box.Size = new Size(50, 20); box.TextChanged += new EventHandler(box_TextChanged); this.Controls.Add(box); bt = pt; } DevExpress.XtraEditors.SimpleButton ok = new DevExpress.XtraEditors.SimpleButton(); ok.Name = "b1"; ok.Text = "确定"; ok.DialogResult = DialogResult.OK; ok.Location = new Point(200, bt.Y + 40); ok.Click += new EventHandler(ok_Click); this.Controls.Add(ok); DevExpress.XtraEditors.SimpleButton cancel = new DevExpress.XtraEditors.SimpleButton(); cancel.Name = "b2"; cancel.Text = "取消"; cancel.DialogResult = DialogResult.Cancel; cancel.Location = new Point(300 + 30, bt.Y + 40); this.Controls.Add(cancel); this.Size = new Size(470, ((yearRange.FinishYear - yearRange.StartYear) / 3 + 5) * 30); }
private void FrmAddTzgs_Load(object sender, EventArgs e) { string conny = "Col5='" + MIS.ProgUID + "' and Col4='" + OperTable.tzgs + "'"; yAnge = oper.GetYearRange(conny); if (strtype == "line") { label19.Visible = buildprortzgsflag; txtnr.Visible = buildprortzgsflag; label21.Visible = buildprortzgsflag; label20.Visible = buildprortzgsflag; txtgt.Visible = buildprortzgsflag; comboBoxEdit8.Visible = false; textEdit1.Visible = true; label15.Visible = false; comboBoxEdit10.Visible = false; panelControl1.Visible = true; panelControl2.Visible = false; panelControl3.Visible = false; comboBoxEdit12.Text = "线路"; } if (strtype == "bian") { panelControl1.Visible = false; panelControl2.Visible = true; panelControl3.Visible = false; textEdit1.Visible = false; comboBoxEdit12.Text = "变电站"; txtzb.Visible = buildprortzgsflag; label17.Visible = buildprortzgsflag; } if (strtype == "kg") { panelControl1.Visible = false; panelControl2.Visible = false; panelControl3.Visible = true; textEdit1.Visible = false; comboBoxEdit12.Text = "开关"; } string conn = "ProjectID='" + projectID + "' order by Sort"; IList <PS_Table_AreaWH> list = Common.Services.BaseService.GetList <PS_Table_AreaWH>("SelectPS_Table_AreaWHByConn", conn); foreach (PS_Table_AreaWH area in list) { comboBoxEdit10.Properties.Items.Add(area.Title); } conn = "ProjectID='" + projectID + "' order by Sort"; IList <PS_Table_Area_TYPE> list1 = Common.Services.BaseService.GetList <PS_Table_Area_TYPE>("SelectPS_Table_Area_TYPEByConn", conn); foreach (PS_Table_Area_TYPE area in list1) { comboBoxEdit11.Properties.Items.Add(area.Title); } if (areaname != "") { comboBoxEdit10.Text = areaname; } else if (comboBoxEdit10.Properties.Items.Count > 0) { comboBoxEdit10.SelectedIndex = 0; } }
//500千伏分区分年容载比计算表 private void build_500rzbtj() { Dictionary<string, Columqk> viscol = new Dictionary<string, Columqk>(); string title = "500千伏分区分年容载比计算表"; OperTable oper = new OperTable(); yAnge = oper.GetYearRange("Col5='" + GetProjectID + "' and Col4='" + OperTable.ph500 + "'"); System.Data.DataTable datatable = get500phtable(yAnge); System.Data.DataTable dt = ResultDataTable1(ConvertTreeListToDataTable(datatable, false, yAnge), ref viscol, yAnge); if (!shjjbyyear) { creatsheetbydt(title, dt, viscol); } else { recreatsheetbydt(title, dt, viscol, 1); } }