Ejemplo n.º 1
0
 private void bt_xoaThongtin_Click(object sender, EventArgs e)
 {
     if (dgvdsKhach2.SelectedRows.Count > 0)
     {
         DataRow dh = ((DataRowView)dgvdsKhach2.SelectedRows[0].DataBoundItem).Row;
         dh.Delete();
         XuLyDuLieu.ghiBang("ThongTinKhach", dsKhach);
     }
 }
Ejemplo n.º 2
0
        private void bt_themThongtin_Click(object sender, EventArgs e)
        {
            DataRow dh = dsKhach.NewRow();

            dh["HoTenKhach"] = TT_Ten.Text;
            dh["DiaCHi"]     = TT_DiaChi.Text;
            dh["SDT"]        = TT_SDT.Text;
            dh["SoLanDat"]   = TT_SoLan.Text;

            dsKhach.Rows.Add(dh);

            XuLyDuLieu.ghiBang("ThongTinKhach", dsKhach);
        }
Ejemplo n.º 3
0
        private void bt_DuyetDH_Click(object sender, EventArgs e)
        {
            DataRow dh = dsDonHang.NewRow();

            dh["HD_MaHD"]      = DHC_Ma.Text;
            dh["HD_TenKhach"]  = DHC_tbTen.Text;
            dh["HD_DiaCHi"]    = DHC_tbDiaChi.Text;
            dh["HD_SDT"]       = DHC_tbSDT.Text;
            dh["HD_MaMDC"]     = DHC_MaTD.Text;
            dh["HD_TinhTrang"] = DHC_TinhTrang.Text;

            dsDonHang.Rows.Add(dh);

            XuLyDuLieu.ghiBang("HoaDon", dsDonHang);
        }
Ejemplo n.º 4
0
 private void bt_suaThongTin_Click(object sender, EventArgs e)
 {
     if (dgvdsKhach2.SelectedRows.Count > 0)
     {
         DataRow dh = ((DataRowView)dgvdsKhach2.SelectedRows[0].DataBoundItem).Row;
         dh["HoTenKhach"] = TT_Ten.Text;
         dh["DiaCHi"]     = TT_DiaChi.Text;
         dh["SDT"]        = TT_SDT.Text;
         dh["SoLanDat"]   = TT_SoLan.Text;
         XuLyDuLieu.ghiBang("ThongTinKhach", dsKhach);
     }
     else
     {
         MessageBox.Show("Chua Chon Don Hang", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataRow dh = dsDonHang.NewRow();

            dh["HD_MaHD"]     = tbMa.Text;
            dh["HD_DiaCHi"]   = tbDiaChi.Text;
            dh["HD_TenKhach"] = tbTenKhach.Text;
            dh["HD_SDT"]      = tbSDT.Text;
            dh["HD_Gia"]      = tbTongTien.Text;


            dsDonHang.Rows.Add(dh);

            XuLyDuLieu.ghiBang("HoaDon", dsDonHang);

            MessageBox.Show("Bạn Đã Tạo Đơn Hàng Thành Công!!", "Thong Bao", MessageBoxButtons.OK);
        }
Ejemplo n.º 6
0
        /*private void btThemDHC_Click(object sender, EventArgs e)
         * {
         *  DataRow dh = dsDonHang.NewRow();
         *  dh["HD_MaHD"] = DHC_Ma.Text;
         *  dh["HD_TenKhach"] = DHC_tbTen.Text;
         *  dh["HD_DiaCHi"] =  DHC_tbDiaChi.Text;
         *  dh["HD_SDT"] = DHC_tbSDT.Text;
         *  dh["HD_MaMDC"] = DHC_MaTD.Text;
         *  dh["HD_TinhTrang"] = DHC_TinhTrang.Text;
         *
         *  dsDonHang.Rows.Add(dh);
         *
         *  XuLyDuLieu.ghiBang("HoaDon", dsDonHang);
         * }*/

        private void CDH_btSua_Click(object sender, EventArgs e)
        {
            if (dgvdsDonHang3.SelectedRows.Count > 0)
            {
                DataRow dh = ((DataRowView)dgvdsDonHang3.SelectedRows[0].DataBoundItem).Row;
                dh["HD_MaHD"]     = CDH_Ma.Text;
                dh["HD_DiaCHi"]   = CDH_DiaChi.Text;
                dh["HD_MaCN"]     = CDH_CN.Text;
                dh["HD_TenKhach"] = CDH_Ten.Text;
                dh["HD_SDT"]      = CDH_SDT.Text;
                dh["HD_MaMDC"]    = CDH_MaMDC.Text;
                XuLyDuLieu.ghiBang("HoaDon", dsDonHang);
            }
            else
            {
                MessageBox.Show("Chua Chon Don Hang", "Thong Bao", MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 7
0
 private void btSuaDH_Click(object sender, EventArgs e)
 {
     if (dgvdsDSHonHang.SelectedRows.Count > 0)
     {
         DataRow dh = ((DataRowView)dgvdsDSHonHang.SelectedRows[0].DataBoundItem).Row;
         dh["HD_MaHD"]      = tbDHMaDH.Text;
         dh["HD_DiaCHi"]    = tbDHDiaChi.Text;
         dh["HD_MaCN"]      = tbDHMaCN.Text;
         dh["HD_TenKhach"]  = tbDHTen.Text;
         dh["HD_SDT"]       = tbDHSDT.Text;
         dh["HD_Gia"]       = tbDHTien.Text;
         dh["HD_TinhTrang"] = tbDHTinhTrang.Text;
         XuLyDuLieu.ghiBang("HoaDon", dsDonHang);
     }
     else
     {
         MessageBox.Show("Chua Chon Don Hang", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Ejemplo n.º 8
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (dgvdsDonHang5.SelectedRows.Count > 0)
            {
                DataRow dh = ((DataRowView)dgvdsDonHang5.SelectedRows[0].DataBoundItem).Row;
                dh["HD_MaHD"]      = TD_MaDH.Text;
                dh["HD_DiaCHi"]    = TD_DiaChi.Text;
                dh["HD_MaCN"]      = TD_MaCN.Text;
                dh["HD_TenKhach"]  = TD_Ten.Text;
                dh["HD_SDT"]       = TD_SDT.Text;
                dh["HD_Gia"]       = TD_Gia.Text;
                dh["HD_TinhTrang"] = TD_TinhTrang.Text;
                XuLyDuLieu.ghiBang("HoaDon", dsDonHang);

                MessageBox.Show("Đã thay đổi tình trạng đơn hàng", "Thong Bao", MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show("Chua Chon Don Hang", "Thong Bao", MessageBoxButtons.OK);
            }
        }