private void Init()
 {
     tblMayTinh  = new TableMayTinh();
     tblPhongMay = new TablePhongMay();
     list        = tblPhongMay.GetAll();
     LoadDataToTree(tblPhongMay);
 }
        private void LoadDataToTree(TablePhongMay tblPhongMay)
        {
            IEnumerable <PhongMay> list = tblPhongMay.GetAll();

            foreach (PhongMay i in list)
            {
                TreeNode root = new TreeNode(i.ten);
                root.Name = i.id.ToString();
                tree.Nodes.Add(root);
                IEnumerable <MayTinh> mts = tblPhongMay.GetMayTinhByPhongMay(i.id);
                LoadMayTinhToTree(root, mts);
            }
        }
Esempio n. 3
0
 public FormThemPhong()
 {
     InitializeComponent();
     phong = new TablePhongMay();
 }