//Bao cáo tình trạng cây cảnh


        private void TTCayCanh_Load(object sender, EventArgs e)
        {
            TTBus         = new BCTinhTrangBUS();
            cayBus        = new CayCanhBUS();
            loaiBus       = new LoaiCayBUS();
            tinhTrangBus  = new TinhTrangBUS();
            listTinhTrang = tinhTrangBus.selectTT();
            listloaiCay   = loaiBus.selectLoaiCay();
            listCay       = cayBus.select();
        }
Esempio n. 2
0
 private void QuanLyCayCanh_Load(object sender, EventArgs e)
 {
     vtBus         = new ViTriBUS();
     loaiBus       = new LoaiCayBUS();
     cayBus        = new CayCanhBUS();
     tinhtrangBus  = new TinhTrangBUS();
     listtinhtrang = tinhtrangBus.selectTT();
     listloai      = loaiBus.selectLoaiCay();
     listVT        = vtBus.selectVT();
     loadData_Vao_GridView();
 }
        private void loadLoaiCayVao_Combobox(int number)
        {
            List <LoaiCayDTO> listLoaiCay = LoaiCayBus.selectLoaiCay();

            if (listLoaiCay == null)
            {
                MessageBox.Show("Có lỗi khi lấy Món ăn từ DB");
                return;
            }
            comboBoxLoaiCay.DataSource    = new BindingSource(listLoaiCay, String.Empty);
            comboBoxLoaiCay.DisplayMember = "TenLoaiCayPT";
            comboBoxLoaiCay.ValueMember   = "MaLoaiCayPT";

            CurrencyManager myCurrencyManager = (CurrencyManager)this.BindingContext[comboBoxLoaiCay.DataSource];

            myCurrencyManager.Refresh();

            if (comboBoxLoaiCay.Items.Count > 0)
            {
                comboBoxLoaiCay.SelectedIndex = number;
            }
        }