110,569
社区成员
发帖
与我相关
我的任务
分享
#region 加载数据
private void DataLoad()
{
bool bOpen=(this.connMain.State==System.Data.ConnectionState.Open);
try
{
if(!bOpen)
{
this.connMain.Open();
}
if(this.dataset11.Tables["PropertyZZJG"]!=null)
{
this.dataset11.Tables["PropertyZZJG"].Clear();
}
this.daMaster.SelectCommand.CommandText=@"select * from PropertyZZJG order by CurrentId";
this.daMaster.Fill(this.dataset11,"PropertyZZJG");
if(this.dataset11.Tables["PropertyUser"]!=null)
{
this.dataset11.Tables["PropertyUser"].Clear();
}
this.daUser.SelectCommand.CommandText=@"select * from PropertyUser";
this.daUser.Fill(this.dataset11,"PropertyUser");
}
catch(System.Exception ee)
{
MessageBox.Show(ee.Message,"系统提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
finally
{
if(!bOpen)
{
this.connMain.Close();
}
}
}
#endregion
private void ReadTreeNodes1()
{
if(this.TV_ZZJG.Nodes!=null)
{
this.TV_ZZJG.Nodes.Clear();
}
System.Data.DataRow[] dr=this.dtUser.Select("DepartmentID = "+this.TV_Department.SelectedNode.Tag.ToString());
for(int i=0;i<dr.Length;i++)
{
TreeNode tn=new TreeNode();
tn.Text=dr[i]["User_Name"].ToString();
tn.Tag=dr[i]["Master_Id"].ToString();
tn.ImageIndex=0;
tn.SelectedImageIndex=1;
this.TV_ZZJG.Nodes.Add(tn);
}