Exemplo n.º 1
0
        private void BindDepartment()
        {
            //bind Department
            DataTable dt = svr.SearchByCriteria("CRMDepartment", out recordCount, "", "DepName");

            DDCLDep.DataSource     = dt;
            DDCLDep.DataTextField  = "DepName";
            DDCLDep.DataValueField = "DepID";
            DDCLDep.DataBind();
            //bind role relative products
            var Deps = svr.GetRoleRelativeDeps(long.Parse(hidID.Value));

            foreach (var p in Deps)
            {
                foreach (ListItem item in DDCLDep.Items)
                {
                    if (item.Value == p.DepID.ToString())
                    {
                        item.Selected = true;
                    }
                }
            }
        }