예제 #1
0
 private void QLMon_Loai_Load(object sender, EventArgs e)
 {
     //load danh sach loai mon
     dataGridView1.DataSource = LoaiMon_BUS.LoadDSLoaiMon();
     bingdingLoaiMon();
     //do du lieu vao combobox
     comboBoxThuocLoai.DataSource    = LoaiMon_BUS.DSMaLoaiMon();
     comboBoxThuocLoai.DisplayMember = "Maloaimon";
     //load danh sach mon an
     dataGridView2.DataSource = Mon_BUS.LoadDSMon();
     bingdingMon();
 }
예제 #2
0
        private void QLTiec_Load(object sender, EventArgs e)
        {
            //chao
            labelChao.Text = DangNhap._manhanvien;

            //hien thi ds mon
            dataGridViewDSMon.DataSource = Mon_BUS.LoadDSMon();
            //hien thi ds tiec
            Tiec_BUS t = new Tiec_BUS();

            dataGridViewDSTiec.DataSource = t.LoadTiec();
            //bingding
            bingding();
        }
예제 #3
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int temp = e.RowIndex;

            if (temp != -1)
            {
                string t = dataGridView1.Rows[temp].Cells[0].Value.ToString();
                dataGridView2.DataSource = Mon_BUS.LoadDSMonTheoLoai(t);
                lbLoaiMon.Text           = t;
            }
            else
            {
                return;
            }
        }
예제 #4
0
        private void btnXoaMon_Click(object sender, EventArgs e)
        {
            string mamon  = txtMaMon.Text;
            string tenmon = txtTenMon.Text;
            float  dongia = float.Parse(txtDonGia.Text);
            string loai   = comboBoxThuocLoai.Text;

            Mon_DTO mon = new Mon_DTO(mamon, tenmon, dongia, loai);

            bool kt = Mon_BUS.XoaMon(mon);

            if (kt == false)
            {
                MessageBox.Show("Thao tác không thành công!");
                return;
            }
            else
            {
                MessageBox.Show("Xóa món thành công!");
                dataGridView2.DataSource = Mon_BUS.LoadDSMon();
                bingdingMon();
            }
        }
예제 #5
0
 private void btnDanhSachMon_Click(object sender, EventArgs e)
 {
     dataGridView2.DataSource = Mon_BUS.LoadDSMon();
     bingdingMon();
 }