public void HienThiDropDowSubSystem() { string UserID = (string)Session["UserID"]; string GSBH = (string)Session["congty"]; string System = DropDownsystem.SelectedValue.ToString().Trim(); if (System != "") { DataTable dt = dal.HienThiDropDowSubSystemTheoUserID(GSBH, UserID, System); if (dt.Rows.Count > 0) { DropDownSubsystem.DataSource = dt; DropDownSubsystem.DataValueField = "jsubid"; DropDownSubsystem.DataTextField = "jsubname"; DropDownSubsystem.DataBind(); } else { DropDownSubsystem.DataSource = null; DropDownSubsystem.DataBind(); } } else { DropDownSubsystem.DataSource = null; DropDownSubsystem.DataBind(); } }
protected void DropDownsystem_SelectedIndexChanged(object sender, EventArgs e) { string UserID = (string)Session["UserID"]; string GSBH = (string)Session["congty"]; string System = DropDownsystem.SelectedValue; if (System != "") { DataTable dt = dal.HienThiDropDowSubSystemTheoUserID(GSBH, UserID, System); if (dt.Rows.Count > 0) { DropDownSubsystem.DataSource = dt; DropDownSubsystem.DataValueField = "jsubid"; DropDownSubsystem.DataTextField = "jsubname"; DropDownSubsystem.DataBind(); Session["SystemChange111"] = System; } else { DropDownSubsystem.DataSource = dt; DropDownSubsystem.DataBind(); } } else { DropDownSubsystem.DataSource = null; DropDownSubsystem.DataBind(); } }