private void HienthiComboboxDichVuTheoLoai(int maLoaiDichVu)
        {
            DichVuBUS dichVuBUS = new DichVuBUS();
            DataTable dataTable = new DataTable();

            dataTable = dichVuBUS.LayDanhSachDichVuTheoLoai(maLoaiDichVu);
            if (dataTable.Rows.Count > 0)
            {
                cbmDV.DataSource    = dataTable;
                cbmDV.ValueMember   = "Ma";
                cbmDV.DisplayMember = "Ten";
            }
            else
            {
                cbmDV.Text = "";
            }
        }
        private void HienthiDichVuTheoLoai(int maLoaiDichVu)
        {
            DichVuBUS dichVuBUS = new DichVuBUS();

            gridDSDV.DataSource = dichVuBUS.LayDanhSachDichVuTheoLoai(int.Parse(cbmLoaiDV.SelectedValue.ToString()));

            gridDSDV.Columns["Ma"].Visible           = false;
            gridDSDV.Columns[2].HeaderText           = "Dịch Vụ";
            gridDSDV.Columns[3].HeaderText           = "Đơn vị tính";
            gridDSDV.Columns["Maloaidichvu"].Visible = false;
            gridDSDV.Columns[5].HeaderText           = "Giá";

            gridDSDV.AutoSizeColumnsMode     = DataGridViewAutoSizeColumnsMode.AllCells;
            gridDSDV.AutoSizeRowsMode        = DataGridViewAutoSizeRowsMode.AllCells;
            gridDSDV.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            gridDSDV.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(206, 187, 214);
        }
Beispiel #3
0
        private void HienthiDichvu()
        {
            DichVuBUS dichVuBUS = new DichVuBUS();

            if (rbLoai.Checked)
            {
                gridDV.DataSource              = dichVuBUS.LayDanhSachDichVuTheoLoai(int.Parse(cbmLoai.SelectedValue.ToString()));
                gridDV.AutoSizeColumnsMode     = DataGridViewAutoSizeColumnsMode.AllCells;
                gridDV.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                gridDV.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(206, 187, 214);
                gridDV.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
            }
            else
            {
                gridDV.DataSource              = dichVuBUS.LayDanhSachDichVu();
                gridDV.AutoSizeColumnsMode     = DataGridViewAutoSizeColumnsMode.AllCells;
                gridDV.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                gridDV.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(206, 187, 214);
                gridDV.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
            }
        }