private void LoadRoleList2DDL(string selected_value)
 {
     ddlRoleList.Items.Clear();
     string ApplicationId = ddlApplicationList.SelectedValue;
     RoleController app_obj = new RoleController();
     DataTable dt_app = app_obj.GetRoleListByApplicationId(ApplicationId);            
     ddlRoleList.DataSource = dt_app;
     ddlRoleList.DataTextField = "RoleName";
     ddlRoleList.DataValueField = "RoleId";
     ddlRoleList.DataBind();            
     ddlRoleList.SelectedValue = selected_value;
     ddlRoleList.Enabled = false;
 }
예제 #2
0
 private void LoadRoleList2DDL()
 {
     ddlRoleList.Items.Clear();
     string ApplicationId = ddlApplicationList.SelectedValue;
     RoleController app_obj = new RoleController();
     DataTable dt_app = app_obj.GetRoleListByApplicationId(ApplicationId);
     ddlRoleList.AutoPostBack = true;
     ddlRoleList.DataSource = dt_app;
     ddlRoleList.DataTextField = "RoleName";
     ddlRoleList.DataValueField = "RoleId";
     ddlRoleList.DataBind();
     //ddlRoleList.Items.Insert(0, new ListItem("- Chọn -", ""));
     ddlRoleList.SelectedIndex = 0;
 }
 private void LoadRoleList2DDL(string selected_value)
 {
     ddlRoleList.Items.Clear(); //DROPDOWNLIST        
     RoleController role_obj = new RoleController();
     string ApplicationId = ddlApplicationList.SelectedValue;
     DataTable dt = role_obj.GetRoleListByApplicationId(ApplicationId);           
     
     ddlRoleList.DataSource = dt;
     ddlRoleList.DataTextField = "RoleName";
     ddlRoleList.DataValueField = "RoleId";            
     ddlRoleList.Items.Insert(0, new ListItem("- Chọn -", ""));
     ddlRoleList.SelectedValue = selected_value;
     ddlRoleList.DataBind();   
 }
        public CascadingDropDownNameValue[] GetRoleList(string knownCategoryValues, string category)
        {
            StringDictionary dataValues = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
            string ApplicationId = dataValues["ApplicationId"];
            RoleController role_obj = new RoleController();
            DataTable dt = role_obj.GetRoleListByApplicationId(ApplicationId);

            List<CascadingDropDownNameValue> role_list = new List<CascadingDropDownNameValue>();
            foreach (DataRow dRow in dt.Rows)
            {
                string RoleId = dRow["RoleId"].ToString();
                string RoleName = dRow["RoleName"].ToString();
                role_list.Add(new CascadingDropDownNameValue(RoleName, RoleId));
            }
            return role_list.ToArray();
        }