示例#1
0
        public void HienThiDropbox()
        {
            string UserID        = (string)Session["UserID"];
            string GSBH          = (string)Session["congty"];
            string themjobjsysid = (string)Session["themjobjsysid"];
            string themjobjsubid = (string)Session["themjobjsubid"];

            if (themjobjsubid != null && themjobjsysid != null)
            {
                DataTable dt1 = dal.HienThiLenDropBoxKhiThem(UserID, GSBH, themjobjsubid, themjobjsysid);
                if (dt1.Rows.Count > 0)
                {
                    DropDownSubSystem.DataSource     = dt1;
                    DropDownSubSystem.DataValueField = "jsubid";
                    DropDownSubSystem.DataTextField  = "jsubname";
                    DropDownSubSystem.DataBind();
                }
            }
            else
            {
                DataTable dt = dal.HienThiLenDropBox(UserID, GSBH);
                if (dt.Rows.Count > 0)
                {
                    DropDownSubSystem.DataSource     = dt;
                    DropDownSubSystem.DataValueField = "jsubid";
                    DropDownSubSystem.DataTextField  = "jsubname";
                    DropDownSubSystem.DataBind();
                }
            }
        }
        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 = dt;

                    DropDownSubSystem.DataBind();
                }
            }
            else
            {
                DropDownSubSystem.DataSource = null;
                DropDownSubSystem.DataBind();
            }
        }
        protected void DropDownSystem_SelectedIndexChanged(object sender, EventArgs e)
        {
            string systemID = DropDownSystem.SelectedValue.ToString();

            if (systemID != "0")
            {
                string SystemChange = DropDownSystem.SelectedValue.ToString();
                Session["SystemChange"] = SystemChange;
                HienThiDropDowSubSystem();
                HienThiJoblenDrop();
            }
            else
            {
                DropDownSubSystem.DataSource = null;
                DropDownSubSystem.DataBind();
                DropDownJob.DataSource = null;
                DropDownJob.DataBind();
            }
        }
        public void HienThiDropDowSubSystem()
        {
            string UserID    = (string)Session["UserID"];
            string GSBH      = (string)Session["congty"];
            string SubSystem = Session["jsubsystem"].ToString();

            DataTable dt = dal.HienThiDropDowSubSystemTheoUserIDByID(GSBH, UserID, SubSystem);

            if (dt.Rows.Count > 0)
            {
                DropDownSubSystem.DataSource     = dt;
                DropDownSubSystem.DataValueField = "jsubid";
                DropDownSubSystem.DataTextField  = "jsubname";
                DropDownSubSystem.DataBind();
            }
            else
            {
                DropDownSubSystem.DataSource = dt;

                DropDownSubSystem.DataBind();
            }
        }