Ejemplo n.º 1
0
        public DlgEditBusiness()
        {
            InitializeComponent();

            cbBusinessData.Items.Clear();
            cbBusinessData.ValueMember   = "ID";
            cbBusinessData.DisplayMember = "NAME";
            List <SYS_BUSINESSDATA> bDatas = BusinessServcie.BusinessDatas();

            foreach (SYS_BUSINESSDATA bData in bDatas)
            {
                cbBusinessData.Items.Add(bData);
            }
            cbBusinessData.DataSource = bDatas;
            tbName.Focus();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 刷新业务数据树
        /// </summary>
        void RefreshBusinessDataTree()
        {
            treeBusinessData.Nodes.Clear();
            SYS_BUSINESSDATA obj = new SYS_BUSINESSDATA();

            obj.ID   = -1;
            obj.NAME = "业务数据";
            TreeListNode root = treeBusinessData.AppendNode(new object[] { obj.NAME, "" }, obj.ID);

            root.Tag = obj;

            List <SYS_BUSINESSDATA> datas = BusinessServcie.BusinessDatas();

            foreach (SYS_BUSINESSDATA data in datas)
            {
                TreeListNode node = treeBusinessData.AppendNode(new object[] { data.NAME, data.DESCRIPTION }, root);
                node.Tag = data;
            }

            treeBusinessData.ExpandAll();
        }