void LoadTypeList()
        {
            DishTypeInfoBll dtibll = new DishTypeInfoBll();
            var             list   = dtibll.GetList();

            list.Insert(0, new DishTypeInfo()
            {
                DId    = 0,
                DTitle = "全部"
            });

            ddlType.DisplayMember = "DTitle";
            ddlType.ValueMember   = "DId";
            ddlType.DataSource    = list;
        }
Beispiel #2
0
        private void LoadDishTypeInfo()
        {
            DishTypeInfoBll dtiBll = new DishTypeInfoBll();

            cb_DishType.DisplayMember = "DTitle";
            cb_DishType.ValueMember   = "Did";

            var list = dtiBll.GetList();

            list.Insert(0, new DishTypeInfo()
            {
                DId    = -1,
                DTitle = "全部"
            });
            cb_DishType.DataSource = list;
        }
        private void LoadDishType()
        {
            //throw new NotImplementedException();
            DishTypeInfoBll dtiBll = new DishTypeInfoBll();
            var             list   = dtiBll.GetList();

            list.Insert(0, new DishTypeInfo()
            {
                DId    = 0,
                DTitle = "All"
            });

            ddlType.ValueMember   = "did";
            ddlType.DisplayMember = "dtitle";
            ddlType.DataSource    = list;
        }
Beispiel #4
0
        private void LoadTypeList()
        {
            DishTypeInfoBll     dtiBll = new DishTypeInfoBll();
            List <DishTypeInfo> list   = dtiBll.GetList();

            list.Insert(0, new DishTypeInfo()
            {
                DId    = 0,
                DTitle = "全部"
            });
            ddlTypeSearch.DataSource    = list;
            ddlTypeSearch.ValueMember   = "DId";
            ddlTypeSearch.DisplayMember = "DTitle";
            ddlTypeAdd.DataSource       = dtiBll.GetList();
            ddlTypeAdd.ValueMember      = "DId";
            ddlTypeAdd.DisplayMember    = "DTitle";
        }
Beispiel #5
0
        private void LoadDishType()
        {
            DishTypeInfoBll dtiBll = new DishTypeInfoBll();
            var             list   = dtiBll.GetList();

            list.Insert(0, new DishTypeInfo()
            {
                Id         = 0,
                DTypeTitle = "全部"
            });
            List <string> dishTypelist = new List <string>();

            foreach (DishTypeInfo dishType in list)
            {
                dishTypelist.Add(dishType.DTypeTitle);
            }
            ddlType.DataSource = dishTypelist;
        }
Beispiel #6
0
        private void LoadTypeList()
        {
            DishTypeInfoBll dtiBll = new DishTypeInfoBll();

            //绑定添加与修改的分类
            comboBox1.DisplayMember = "DTitle";
            comboBox1.ValueMember   = "DId";
            comboBox1.DataSource    = dtiBll.GetList();
            //绑定查询的分类
            var list = dtiBll.GetList();

            list.Insert(0, new DishTypeInfo()
            {
                DId    = 0,
                DTitle = "全部"
            });
            comboBox2.DisplayMember = "DTitle";
            comboBox2.ValueMember   = "DId";
            comboBox2.DataSource    = list;
        }
Beispiel #7
0
        private void LoadTypeList()
        {
            DishTypeInfoBll dtiBll = new DishTypeInfoBll();

            //绑定添加修改的分类
            cbxType.DisplayMember = "DTitle";
            cbxType.ValueMember   = "DId";
            cbxType.DataSource    = dtiBll.GetList();;

            //绑定查询的分类
            var list = dtiBll.GetList();

            list.Insert(0, new DishTypeInfo()
            {
                DId    = 0,
                DTitle = "全部",
            });

            cbxTypeSearch.DisplayMember = "DTitle";
            cbxTypeSearch.ValueMember   = "DId";
            cbxTypeSearch.DataSource    = list;
        }
        private void LoadTypeList()
        {
            DishTypeInfoBll dtiBll = new DishTypeInfoBll();

            //为了下拉框显示“全部”,向list中插入数据
            #region 绑定搜索的下拉列表
            List <DishTypeInfo> list = dtiBll.GetList();
            list.Insert(0, new DishTypeInfo()
            {
                DId    = 0,
                DTitle = "全部"
            });
            ddlTypeSearch.DataSource    = list;
            ddlTypeSearch.ValueMember   = "did";
            ddlTypeSearch.DisplayMember = "dtitle";
            #endregion

            #region 绑定添加的下拉列表
            cbbType.DataSource    = dtiBll.GetList();
            cbbType.DisplayMember = "dtitle";
            cbbType.ValueMember   = "did";
            #endregion
        }