private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{ int id = int.Parse(this.DropDownList1.SelectedItem.Text);
if(this.DropDownList1.SelectedItem.Text!="")
{
DataSet ds=dm.selectallmonth(id);
this.DropDownList2.Items.Clear();
foreach(DataRow row in ds.Tables[0].Rows)
{
this.DropDownList2.Items.Add(row["month"].ToString());
}
this.DropDownList2.SelectedItem.Text =this.DropDownList2.Items[0].ToString();
if(this.DropDownList1.SelectedItem.Text!="")
{
//int id = int.Parse(this.DropDownList1.SelectedItem.Text);
string month=this.DropDownList2.SelectedItem.Text;
DataSet ds1=dm.selectcouall(id,month);
this.classnamebox.Text = ds1.Tables[0].Rows[0][0].ToString();
this.classbox.Text = ds1.Tables[0].Rows[0][1].ToString();
this.sumbox.Text = ds1.Tables[0].Rows[0][2].ToString();
}
}
}
private void DropDownList2_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(this.DropDownList1.SelectedItem.Text!="")
{
int id = int.Parse(this.DropDownList1.SelectedItem.Text);
string month=this.DropDownList2.SelectedItem.Text;
DataSet ds=dm.selectcouall(id,month);
this.classnamebox.Text = ds.Tables[0].Rows[0][0].ToString();
this.classbox.Text = ds.Tables[0].Rows[0][1].ToString();
this.sumbox.Text = ds.Tables[0].Rows[0][2].ToString();
}
}
{ int id = int.Parse(this.DropDownList1.SelectedItem.Text);
if(this.DropDownList1.SelectedItem.Text!="")
{
DataSet ds=dm.selectallmonth(id);
this.DropDownList2.Items.Clear();
foreach(DataRow row in ds.Tables[0].Rows)
{
this.DropDownList2.Items.Add(row["month"].ToString());
}
this.DropDownList2.SelectedItem.Text =this.DropDownList2.Items[0].ToString();
if(this.DropDownList1.SelectedItem.Text!="")
{
//int id = int.Parse(this.DropDownList1.SelectedItem.Text);
string month=this.DropDownList2.SelectedItem.Text;
DataSet ds1=dm.selectcouall(id,month);
this.classnamebox.Text = ds1.Tables[0].Rows[0][0].ToString();
this.classbox.Text = ds1.Tables[0].Rows[0][1].ToString();
this.sumbox.Text = ds1.Tables[0].Rows[0][2].ToString();
}
}
}
private void DropDownList2_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(this.DropDownList1.SelectedItem.Text!="")
{
int id = int.Parse(this.DropDownList1.SelectedItem.Text);
string month=this.DropDownList2.SelectedItem.Text;
DataSet ds=dm.selectcouall(id,month);
this.classnamebox.Text = ds.Tables[0].Rows[0][0].ToString();
this.classbox.Text = ds.Tables[0].Rows[0][1].ToString();
this.sumbox.Text = ds.Tables[0].Rows[0][2].ToString();
}
}