void da_RunSQLReturnTableSCompleted(object sender, RunSQLReturnTableSCompletedEventArgs e) { this.listBox1.Items.Clear(); this.listBox_FrmLab.Items.Clear(); DataSet ds = new DataSet(); ds.FromXml(e.Result); foreach (DataRow dr in ds.Tables[0].Rows) { ListBoxItem lb = new ListBoxItem(); lb.Content = "Step:" + dr["Step"] + " " + dr["Name"].ToString(); lb.Tag = "ND" + dr["NodeID"]; if (Glo.FK_MapData == lb.Tag.ToString()) { continue; } this.listBox1.Items.Add(lb); } foreach (DataRow dr in ds.Tables[1].Rows) { ListBoxItem lb = new ListBoxItem(); lb.Content = dr["Name"].ToString(); lb.Tag = dr["No"]; if (Glo.FK_MapData == lb.Tag.ToString()) { continue; } this.listBox_FrmLab.Items.Add(lb); } }
void daNew_RunSQLReturnTableSCompleted(object sender, RunSQLReturnTableSCompletedEventArgs e) { DataSet ds = new DataSet(); ds.FromXml(e.Result); DataTable dtSort = ds.Tables[0]; Glo.Ctrl_DDL_BindDataTable(this.DDL_FrmSort, dtSort, "01"); }
void daBindFrm_RunSQLReturnTableSCompleted(object sender, RunSQLReturnTableSCompletedEventArgs e) { this.Btn_Del.IsEnabled = false; this.Btn_Save.IsEnabled = false; DataSet ds = new DataSet(); ds.FromXml(e.Result); DataTable dtSort = ds.Tables[0]; if (dtSort.Rows.Count == 0) { DataRow dr = dtSort.NewRow(); dr[0] = "01"; dr[1] = "默认类别"; dtSort.Rows.Add(dr); } if (this.IsNew) { Glo.Ctrl_DDL_BindDataTable(this.DDL_FrmSort, dtSort, "01"); this.HisAppType = AppType.Application; this.Btn_Del.IsEnabled = true; this.Btn_Save.IsEnabled = true; return; } DataTable dtMapdata = ds.Tables[1]; if (dtMapdata.Rows.Count == 0) { MessageBox.Show("数据已被删除,请刷新列表。"); this.DialogResult = false; return; } this.TB_No.Text = dtMapdata.Rows[0]["No"]; this.TB_Name.Text = dtMapdata.Rows[0]["Name"]; this.TB_PTable.Text = dtMapdata.Rows[0]["PTable"]; string tag = dtMapdata.Rows[0]["Tag"]; if (tag != null) { this.TB_URL.Text = tag; } this.TB_Designer.Text = dtMapdata.Rows[0]["Designer"]; this.TB_DesignerUnit.Text = dtMapdata.Rows[0]["DesignerUnit"]; this.TB_DesignerContact.Text = dtMapdata.Rows[0]["DesignerContact"]; // 应用类型。 this.HisAppType = (AppType)int.Parse(dtMapdata.Rows[0]["AppType"]); Glo.Ctrl_DDL_SetSelectVal(this.DDL_DBUrl, dtMapdata.Rows[0]["DBURL"]); Glo.Ctrl_DDL_SetSelectVal(this.DDL_FrmType, dtMapdata.Rows[0]["FrmType"]); Glo.Ctrl_DDL_BindDataTable(this.DDL_FrmSort, dtSort, dtMapdata.Rows[0]["FK_FrmSort"]); if (this.HisAppType == AppType.Application) { this.Btn_Del.IsEnabled = true; this.Btn_Save.IsEnabled = true; } }