예제 #1
0
        /// <summary>
        /// Загрузка текущей книги рецептур в дерево
        /// </summary>
        public void LoadData()
        {
            tvBook.Nodes.Clear();
            DataBook curData  = DataBook.Book;
            TreeNode rootNode = new TreeNode(curData.Name);

            rootNode.Tag = curData;
            tvBook.Nodes.Add(rootNode);
            foreach (DataRecept rcp in curData.Components)
            {
                LoadRecepts(rootNode.Nodes, rcp);
            }
            tvBook.ExpandAll();
            tvBook.Sort();
            curData.Changed += new EventHandler <DataBaseEventArgs>(curData_Changed);

            currentMode = ViewMode.BookCommon;
            LoadList(ViewMode.BookCommon);
            lbPages.DisplayMember = "ModeKey";
            lbPages.ValueMember   = "ModeValue";
        }
예제 #2
0
        public void LoadData()
        {
            this.tbBookName.TextChanged         -= new System.EventHandler(this.tbTextChanged);
            this.tbCompanyName.TextChanged      -= new System.EventHandler(this.tbTextChanged);
            this.tbChiefName.TextChanged        -= new System.EventHandler(this.tbTextChanged);
            this.tbDeveloperName.TextChanged    -= new System.EventHandler(this.tbTextChanged);
            this.tbDeveloperCompany.TextChanged -= new System.EventHandler(this.tbTextChanged);

            DataBook data = DataBook.Book;

            tbBookName.Text         = data.Name;
            tbCompanyName.Text      = data.company;
            tbChiefName.Text        = data.ChiefName;
            tbChiefPost.Text        = data.ChiefPost;
            tbDeveloperName.Text    = data.developer;
            tbDeveloperCompany.Text = data.developerCompany;

            this.tbBookName.TextChanged         += new System.EventHandler(this.tbTextChanged);
            this.tbCompanyName.TextChanged      += new System.EventHandler(this.tbTextChanged);
            this.tbChiefName.TextChanged        += new System.EventHandler(this.tbTextChanged);
            this.tbDeveloperName.TextChanged    += new System.EventHandler(this.tbTextChanged);
            this.tbDeveloperCompany.TextChanged += new System.EventHandler(this.tbTextChanged);
        }