Ejemplo n.º 1
0
        /// <summary>
        /// 加载dropdownlist数据
        /// </summary>
        void LoadNewPanelDropDownList()
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定盘点计划单状态
                List <NameValueModel> ListStatus = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.SCPStatusEnum));
                DropDownList_SCPStatus.Items.Clear();
                DropDownList_SCPStatus.DataTextField  = "Name";
                DropDownList_SCPStatus.DataValueField = "Value";
                DropDownList_SCPStatus.DataSource     = ListStatus;
                DropDownList_SCPStatus.DataBind();
                DropDownList_SCPStatus.Items.Insert(0, new ListItem("", ""));

                //绑定盘点计划单状态
                List <NameValueModel> ListType = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.SCPTypeEnum));
                DropDownList_Type.Items.Clear();
                DropDownList_Type.DataTextField  = "Name";
                DropDownList_Type.DataValueField = "Value";
                DropDownList_Type.DataSource     = ListType;
                DropDownList_Type.DataBind();
                DropDownList_Type.Items.Insert(0, new ListItem("", ""));

                //绑定仓库
                var result = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = result;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));
            }
        }
Ejemplo n.º 2
0
        private void showTypeData()
        {
            TBTypeService tbService = new TBTypeService();
            ArrayList     list      = tbService.GetTBTypeList();

            DropDownList_Type.DataSource     = list;
            DropDownList_Type.DataTextField  = "TypeIntro";
            DropDownList_Type.DataValueField = "Id";
            DropDownList_Type.DataBind();
        }
Ejemplo n.º 3
0
        private void fillInfoType()
        {
            TBTypeService tbService = new TBTypeService();
            ArrayList     list      = tbService.GetTBTypeList();
            TBType        temp      = new TBType();

            temp.Id        = 0;
            temp.TypeIntro = "全部信息";
            list.Insert(0, temp);
            DropDownList_Type.DataSource     = list;
            DropDownList_Type.DataTextField  = "TypeIntro";
            DropDownList_Type.DataValueField = "Id";
            DropDownList_Type.DataBind();
        }