private void Bind()
 {
     this.ddlCategory.DataSource     = EnumCollection.EnumToDataTable(typeof(EnumCollection.service_items_category), "name", "id");
     this.ddlCategory.DataTextField  = "name";
     this.ddlCategory.DataValueField = "id";
     this.ddlCategory.DataBind();
 }
        private void BindSelect()
        {
            DataTable dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.resource_group), "key", "val");

            if (dt.Rows.Count > 0)
            {
                this.rbtnGroup.Items.Clear();
                foreach (DataRow item in dt.Rows)
                {
                    this.rbtnGroup.Items.Add(new ListItem(item["key"].ToString(), item["val"].ToString()));
                }
                this.rbtnGroup.SelectedIndex = 0;
            }

            dt = new BLL.user_info().GetList(" group_id = " + (int)EnumCollection.user_group.资源分享用户);
            this.ckbUser.DataSource     = dt;
            this.ckbUser.DataTextField  = "phone";
            this.ckbUser.DataValueField = "id";
            this.ckbUser.DataBind();
            this.ckbUser.SelectedIndex = 0;

            dt = new BLL.common_school().GetList(" 1=1 order by sort ");
            this.ddlSchool.DataSource     = dt;
            this.ddlSchool.DataTextField  = "name";
            this.ddlSchool.DataValueField = "id";
            this.ddlSchool.DataBind();
            this.ckbUser.SelectedIndex = 0;
        }
 private void BindSelect()
 {
     this.ddlType.DataSource     = EnumCollection.EnumToDataTable(typeof(EnumCollection.dict_type), "key", "val");
     this.ddlType.DataTextField  = "key";
     this.ddlType.DataValueField = "val";
     this.ddlType.DataBind();
 }
        private void BindSelect()
        {
            DataTable dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.goods_group), "key", "val");

            this.ddlGroup.DataSource     = dt;
            this.ddlGroup.DataTextField  = "key";
            this.ddlGroup.DataValueField = "val";
            this.ddlGroup.DataBind();
            this.ddlGroup.Items.Insert(0, new ListItem("所属分组", "0"));

            dt = new BLL.common_category().GetListNew(" group_id = " + (int)EnumCollection.category_group.商城, "0");

            this.ddlCategory.Items.Add(new ListItem("所属分类", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id          = dr["id"].ToString();
                int    ClassLayer  = int.Parse(dr["category_level"].ToString());
                string Title       = dr["name"].ToString().Trim();
                string parent_name = dr["parent_name"].ToString().Trim();

                if (ClassLayer == 2)
                {
                    if (!string.IsNullOrEmpty(parent_name))
                    {
                        Title = parent_name + " ├ " + Title;
                        //Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                        this.ddlCategory.Items.Add(new ListItem(Title, Id));
                    }
                }
            }
        }
Пример #5
0
        private void BindSelect()
        {
            DataTable dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.YesOrNot), "title", "id");

            this.rbtnStatus.DataSource     = dt;
            this.rbtnStatus.DataValueField = "id";
            this.rbtnStatus.DataTextField  = "title";
            this.rbtnStatus.DataBind();
            this.rbtnStatus.SelectedIndex = 0;
        }
Пример #6
0
 private void Bind()
 {
     this.ddlCategory.DataSource     = EnumCollection.EnumToDataTable(typeof(EnumCollection.mooc_item), "name", "id");
     this.ddlCategory.DataTextField  = "name";
     this.ddlCategory.DataValueField = "id";
     this.ddlCategory.DataBind();
     this.ddlCategory.Items.Insert(0, new ListItem("全部分类", "0")
     {
     });
 }
Пример #7
0
        private void BindSelect()
        {
            DataTable dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.questions_type), "key", "val");

            this.ddlType.DataSource     = dt;
            this.ddlType.DataTextField  = "key";
            this.ddlType.DataValueField = "val";
            this.ddlType.DataBind();
            this.ddlType.Items.Insert(0, new ListItem("=试题类型=", "0"));
        }
        private void BindSelect()
        {
            DataTable dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.order_status), "key", "val");

            this.ddlStatus.DataSource     = dt;
            this.ddlStatus.DataTextField  = "key";
            this.ddlStatus.DataValueField = "val";
            this.ddlStatus.DataBind();
            this.ddlStatus.Items.Insert(0, new ListItem("全部订单", "0"));
        }
        private static Dictionary <string, int> GetQuestionDic()
        {
            Dictionary <string, int> dic = new Dictionary <string, int>();
            DataTable dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.questions_type), "name", "id");

            foreach (DataRow item in dt.Rows)
            {
                dic.Add(item["name"].ToString(), Convert.ToInt32(item["id"]));
            }
            return(dic);
        }
        private void BindSelect()
        {
            DataTable dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.questions_group), "key", "val");

            this.rbtnGroup.DataSource     = dt;
            this.rbtnGroup.DataTextField  = "key";
            this.rbtnGroup.DataValueField = "val";
            this.rbtnGroup.DataBind();
            this.rbtnGroup.SelectedIndex = 0;

            dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.questions_type), "key", "val");
            this.rbtnType.DataSource     = dt;
            this.rbtnType.DataTextField  = "key";
            this.rbtnType.DataValueField = "val";
            this.rbtnType.DataBind();
            this.rbtnType.SelectedIndex = 0;
        }
        private void Bind()
        {
            DataTable dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.resource_group), "key", "val");

            this.ddlGroup.DataSource     = dt;
            this.ddlGroup.DataTextField  = "key";
            this.ddlGroup.DataValueField = "val";
            this.ddlGroup.DataBind();
            this.ddlGroup.Items.Insert(0, new ListItem("=资源分组=", "0"));

            dt = EnumCollection.EnumToDataTable(typeof(EnumCollection.resource_type), "key", "val");
            DataRow[] drs = dt.Select("val not in (5,7)", "val");

            if (drs.Length > 0)
            {
                this.ddlType.Items.Clear();
                foreach (DataRow item in drs)
                {
                    this.ddlType.Items.Add(new ListItem(item["key"].ToString(), item["val"].ToString()));
                }
                this.ddlType.Items.Insert(0, new ListItem("=资源类型=", "0"));
                this.ddlType.SelectedIndex = 0;
            }
        }