protected void ddlBelongingCompany_SelectedIndexChanged(object sender, EventArgs e)
        {
            string enterpriseID = ddlBelongingCompany.SelectedValue;

            if (enterpriseID == "0")
            {
                this.ddlBelongingDep.Items.Clear();
                var BelongingDepList = base.CodeService.GetCodeListInfoByCodeTypeID(1);
                this.ddlBelongingDep.DataSource     = BelongingDepList;
                this.ddlBelongingDep.DataTextField  = "CodeName";
                this.ddlBelongingDep.DataValueField = "CodeID";
                this.ddlBelongingDep.DataBind();
                ddlBelongingDep.Items.Insert(0, new ListItem("", "-1"));
            }
            else
            {
                var departmentList = EnterpriseService.GetDepartmentByParentID(int.Parse(enterpriseID), 0);
                ddlBelongingDep.Items.Clear();
                ddlBelongingDep.DataSource     = departmentList;
                ddlBelongingDep.DataTextField  = "DepName";
                ddlBelongingDep.DataValueField = "DepartmentID";
                ddlBelongingDep.DataBind();
                ddlBelongingDep.Items.Insert(0, new ListItem("", "-1"));
            }
        }
Exemplo n.º 2
0
        protected void ddlBelongingCompany_SelectedIndexChanged(object sender, EventArgs e)
        {
            string enterpriseID = ddlBelongingCompany.SelectedValue;

            if (enterpriseID != "-1")
            {
                var departmentList = EnterpriseService.GetDepartmentByParentID(int.Parse(enterpriseID), 0);
                ddlBelongingDep.Items.Clear();
                ddlBelongingDep.DataSource     = departmentList;
                ddlBelongingDep.DataTextField  = "DepName";
                ddlBelongingDep.DataValueField = "DepartmentID";
                ddlBelongingDep.DataBind();
                ddlBelongingDep.Items.Insert(0, new ListItem("", "-1"));
                if (enterpriseID == "3")
                {
                    ddlBelongingDep.Items.Add(new ListItem("家居事业部", "505"));
                    ddlBelongingDep.Items.Add(new ListItem("综管部", "507"));
                    ddlBelongingDep.Items.Add(new ListItem("唯家居", "707"));
                }
            }
            else
            {
                ddlBelongingDep.Items.Clear();
                ddlBelongingDep.Items.Insert(0, new ListItem("", "-1"));
            }
        }