Пример #1
0
        private void UserDivision()
        {
            string U = Context.User.Identity.Name;
            string UU = U.Substring(U.IndexOf(@"\") + 1);

            int dv, dp, b;

            dal.UserDivision(UU, out dv, out dp, out b);

            if (dv != 0)
            {
                BlockDropDownList.DataSource = dal.GetBlock();
                BlockDropDownList.DataBind();
                BlockDropDownList.SelectedValue = b.ToString();

                DepartmentDropDownList.DataSource = dal.GetDepartment(BlockDropDownList.SelectedValue);
                DepartmentDropDownList.DataBind();
                DepartmentDropDownList.SelectedValue = dp.ToString();

                DivisionDropDownList.DataSource = dal.GetDivision(DepartmentDropDownList.SelectedValue);
                DivisionDropDownList.DataBind();
                DivisionDropDownList.SelectedValue = dv.ToString();
            }
            else
            {
                BlockDropDownList.DataSource = dal.GetBlock();
                BlockDropDownList.DataBind();

                DepartmentDropDownList.DataSource = dal.GetDepartment(BlockDropDownList.SelectedValue);
                DepartmentDropDownList.DataBind();

                DivisionDropDownList.DataSource = dal.GetDivision(DepartmentDropDownList.SelectedValue);
                DivisionDropDownList.DataBind();
            }
        
        }
 protected void FilterDept(object sender, EventArgs e) //action fired after selecting facility
 {
     DepartmentDropDownList.DataSource = DepartmentManagementSystem.getDepartmentsFromThisFacility(FacilityDropDownList.SelectedItem.Value);
     DepartmentDropDownList.DataBind();
 }