Esempio n. 1
0
        private void btLichSu_Click(object sender, EventArgs e)
        {
            if (tbThanhTien.Text == "")
            {
                MessageBox.Show("Bạn Chưa Bấm Tổng Cộng", "Thông Báo", MessageBoxButtons.OK);
            }
            else
            if (tbMaDonHang.Text != "" || tbSoDienThoai.Text != "")
            {
                DataRow ls = dsLichSu.NewRow();
                ls["SoDienThoai"] = tbSoDienThoai.Text;
                ls["MaDonHang"]   = tbMaDonHang.Text;
                ls["NgayMua"]     = dtpNgayMua.Text;
                ls["NgayGiao"]    = dtpNgayGiao.Text;
                ls["TongCong"]    = tbThanhTien.Text;
                ls["MaChiNhanh"]  = cbChiNhanh.SelectedValue;
                dsLichSu.Rows.Add(ls);

                XuLyDuLieu.ghiBang("LichSuMua", dsLichSu);
            }
            else
            {
                MessageBox.Show("Bạn Chưa Nhập Đủ Thông Tin", "Thông Báo", MessageBoxButtons.OK);
            }
        }
Esempio n. 2
0
 private void Lưu_Click(object sender, EventArgs e)
 {
     if (dgvChiNhanh.SelectedRows.Count > 0)
     {
         DataRow cn      = ((DataRowView)dgvChiNhanh.SelectedRows[0].DataBoundItem).Row;
         DataRow k       = ((DataRowView)dgvKhach.SelectedRows[0].DataBoundItem).Row;
         DataRow donhang = dsdonhang.NewRow();
         DataRow ls      = dslichsu.NewRow();
         donhang["MaDonHang"]   = tbMaDonHang.Text;
         donhang["MaChiNhanh"]  = cn["MaChiNhanh"];
         donhang["SoDienThoai"] = k["SoDienThoai"];
         donhang["DiaChi"]      = k["DiaChi"];
         donhang["ThoiDiem"]    = dtp1.Text;
         donhang["TrangThai"]   = cbTrangThai.Text;
         donhang["Loai"]        = "3";
         dsdonhang.Rows.Add(donhang);
         ls["SoDienThoai"] = k["SoDienThoai"];
         ls["MaDonHang"]   = donhang["MaDonHang"];
         ls["NgayMua"]     = donhang["ThoiDiem"];
         ls["NgayGiao"]    = dtp2.Text;
         ls["TongCong"]    = tbThanhTien.Text;
         ls["MaChiNhanh"]  = donhang["MaChiNhanh"];
         dslichsu.Rows.Add(ls);
         XuLyDuLieu.ghiBang("DonHang", dsdonhang);
         XuLyDuLieu.ghiBang("LichSuMua", dslichsu);
     }
     else
     {
         MessageBox.Show("chon Chi Nhanh", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Esempio n. 3
0
 private void button3_Click_1(object sender, EventArgs e)
 {
     if (dgvChiNhanh.SelectedRows.Count > 0)
     {
         DataRow cn = ((DataRowView)dgvChiNhanh.SelectedRows[0].DataBoundItem).Row;
         cn.Delete();
         XuLyDuLieu.ghiBang("ChiNhanh", dsChiNhanh);
     }
 }
Esempio n. 4
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (dgvDonHang.SelectedRows.Count > 0)
     {
         DataRow dh = ((DataRowView)dgvDonHang.SelectedRows[0].DataBoundItem).Row;
         dh.Delete();
         XuLyDuLieu.ghiBang("DonHang", dsdonhang);
     }
 }
Esempio n. 5
0
 private void button8_Click_2(object sender, EventArgs e)
 {
     if (dgvMonAn.SelectedRows.Count > 0)
     {
         DataRow ma = ((DataRowView)dgvMonAn.SelectedRows[0].DataBoundItem).Row;
         ma.Delete();
         XuLyDuLieu.ghiBang("MonAn", dsMonAn);
     }
 }
Esempio n. 6
0
 private void button13_Click_1(object sender, EventArgs e)
 {
     if (dgvDanhMuc.SelectedRows.Count > 0)
     {
         DataRow dm = ((DataRowView)dgvDanhMuc.SelectedRows[0].DataBoundItem).Row;
         dm.Delete();
         XuLyDuLieu.ghiBang("Ban", dsBan);
     }
 }
Esempio n. 7
0
 private void button6_Click(object sender, EventArgs e)
 {
     if (dgvKhach.SelectedRows.Count > 0)
     {
         DataRow k = ((DataRowView)dgvKhach.SelectedRows[0].DataBoundItem).Row;
         k.Delete();
         XuLyDuLieu.ghiBang("Khach", dskhach);
     }
 }
Esempio n. 8
0
 private void button6_Click(object sender, EventArgs e)
 {
     if (dgvBan.SelectedRows.Count > 0)
     {
         DataRow cn = ((DataRowView)dgvBan.SelectedRows[0].DataBoundItem).Row;
         cn.Delete();
         XuLyDuLieu.ghiBang("Ban", dsBan);
     }
 }
Esempio n. 9
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            DataRow kh = dskhach.NewRow();

            kh["SoDienThoai"] = tbSDT.Text;
            kh["DiaChi"]      = tbDiaChi.Text;
            kh["Loai"]        = cbLoai.Text;
            dskhach.Rows.Add(kh);
            XuLyDuLieu.ghiBang("Khach", dskhach);
        }
Esempio n. 10
0
 private void fDonHangMangVe_Load(object sender, EventArgs e)
 {
     dsChiNhanh               = XuLyDuLieu.docBang("select * from ChiNhanh");
     cbChiNhanh.DataSource    = dsChiNhanh;
     cbChiNhanh.DisplayMember = "TenChiNhanh";
     cbChiNhanh.ValueMember   = "MaChiNhanh";
     dsDonHang = XuLyDuLieu.docBang("select * from DonHang");
     dtgvDonHang.DataSource = dsDonHang;
     dsLichSu = XuLyDuLieu.docBang("Select * from LichSuMua");
     dtgvLichSu.DataSource = dsLichSu;
 }
Esempio n. 11
0
        private void btTao_Click(object sender, EventArgs e)
        {
            DataRow kh = dskhach.NewRow();

            kh["SoDienThoai"] = tbSoDienThoai.Text;
            kh["DiaChi"]      = tbDiaChi.Text;
            kh["Loai"]        = "NorMal";

            dskhach.Rows.Add(kh);
            XuLyDuLieu.ghiBang("Khach", dskhach);
        }
Esempio n. 12
0
 private void cbChiNhanh_TextChanged(object sender, EventArgs e)
 {
     dsBan = XuLyDuLieu.docBang("select * from Ban where MaChiNhanh like '" + cbChiNhanh.SelectedValue + "'");
     lvDanhSachBan.Items.Clear();
     for (int i = 0; i < dsBan.Rows.Count; i++)
     {
         lvDanhSachBan.Items.Add(dsBan.Rows[i]["TenBan"].ToString());
         lvDanhSachBan.Items[i].SubItems.Add(dsBan.Rows[i]["TrangThai"].ToString());
         lvDanhSachBan.Items[i].SubItems.Add(dsBan.Rows[i]["MaChiNhanh"].ToString());
     }
 }
Esempio n. 13
0
 private void bophanquanli_Load(object sender, EventArgs e)
 {
     dsChiNhanh             = XuLyDuLieu.docBang("select * from ChiNhanh");
     dsChiNhanhView         = new DataView(dsChiNhanh);
     dgvChiNhanh.DataSource = dsChiNhanhView;
     dsBan                 = XuLyDuLieu.docBang("select * from Ban");
     dgvBan.DataSource     = dsBan;
     dsMonAn               = XuLyDuLieu.docBang("select * from MonAn");
     dgvMonAn.DataSource   = dsMonAn;
     dsDanhMuc             = XuLyDuLieu.docBang("select *from DanhMuc");
     dgvDanhMuc.DataSource = dsDanhMuc;
 }
Esempio n. 14
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            DataRow cn = dsChiNhanh.NewRow();

            cn["MaChiNhanh"]     = tbMaChiNhanh.Text;
            cn["TenChiNhanh"]    = tbTenChiNhanh.Text;
            cn["SDTChiNhanh"]    = tbDienThoai.Text;
            cn["DiaChiChiNhanh"] = tbDiaChi.Text;
            cn["TinhThanh"]      = tbTinhThanh.Text;
            dsChiNhanh.Rows.Add(cn);
            XuLyDuLieu.ghiBang("ChiNhanh", dsChiNhanh);
        }
Esempio n. 15
0
        private void btNhap_Click(object sender, EventArgs e)
        {
            DataRow cp = dsChiPhi.NewRow();

            dsChiPhi.Rows.Add(cp);
            cp["Ngay"]           = tbNgay.Text;
            cp["Thang"]          = tbThang.Text;
            cp["Nam"]            = tbNam.Text;
            cp["ChiPhiPhatSinh"] = tbChiPhi.Text;
            XuLyDuLieu.ghiBang("ChiPhiPhatSinh", dsChiPhi);

            MessageBox.Show("Nhập Thành Công");
        }
Esempio n. 16
0
 private void button7_Click(object sender, EventArgs e)
 {
     if (dgvBan.SelectedRows.Count > 0)
     {
         DataRow ban = ((DataRowView)dgvBan.SelectedRows[0].DataBoundItem).Row;
         ban["BMa"]  = tbMaBan.Text;
         ban["BTen"] = tbTenBan.Text;
         XuLyDuLieu.ghiBang("ChiNhanh", dsChiNhanh);
     }
     else
     {
         MessageBox.Show("Chua Chon Chi Nhanh", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Esempio n. 17
0
 private void button9_Click(object sender, EventArgs e)
 {
     if (dgvMonAn.SelectedRows.Count > 0)
     {
         DataRow monan = ((DataRowView)dgvMonAn.SelectedRows[0].DataBoundItem).Row;
         monan["Mama"]   = tbMaMonAn.Text;
         monan["Gia"]    = tbGia.Text;
         monan["GhiChu"] = tbTenMonAn.Text;
         XuLyDuLieu.ghiBang("ChiNhanh", dsChiNhanh);
     }
     else
     {
         MessageBox.Show("Chua Chon Chi Nhanh", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Esempio n. 18
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (dgvChiNhanh.SelectedRows.Count > 0)
     {
         DataRow cn = ((DataRowView)dgvChiNhanh.SelectedRows[0].DataBoundItem).Row;
         cn["TenChiNhanh"]    = tbTenChiNhanh.Text;
         cn["SDTChiNhanh"]    = tbDienThoai.Text;
         cn["DiaChiChiNhanh"] = tbDiaChi.Text;
         cn["MaChiNhanh"]     = tbMaChiNhanh.Text;
         cn["TinhThanh"]      = tbTinhThanh.Text;
         XuLyDuLieu.ghiBang("ChiNhanh", dsChiNhanh);
     }
     else
     {
         MessageBox.Show("Chua Chon Chi Nhanh", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Esempio n. 19
0
 private void button12_Click_1(object sender, EventArgs e)
 {
     if (dgvChiNhanh.SelectedRows.Count > 0)
     {
         DataRow cn = ((DataRowView)dgvChiNhanh.SelectedRows[0].DataBoundItem).Row;
         DataRow dm = dsDanhMuc.NewRow();
         dm["MaDanhMuc"]  = tbMaDanhMuc.Text;
         dm["TenDanhMuc"] = tbTenDanhMuc.Text;
         dm["MaChiNhanh"] = cn["MaChiNhanh"];
         dsDanhMuc.Rows.Add(dm);
         XuLyDuLieu.ghiBang("DanhMuc", dsDanhMuc);
     }
     else
     {
         MessageBox.Show("chon Chi Nhanh", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Esempio n. 20
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (dgvChiNhanh.SelectedRows.Count > 0)
     {
         DataRow cn  = ((DataRowView)dgvChiNhanh.SelectedRows[0].DataBoundItem).Row;
         DataRow ban = dsBan.NewRow();
         ban["MaBan"]      = tbMaBan.Text;
         ban["TenBan"]     = tbTenBan.Text;
         ban["MaChiNhanh"] = cn["MaChiNhanh"];
         ban["TrangThai"]  = tbTrangThai.Text;
         dsBan.Rows.Add(ban);
         XuLyDuLieu.ghiBang("Ban", dsBan);
     }
     else
     {
         MessageBox.Show("chon Chi Nhanh", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Esempio n. 21
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (dgvChiNhanh.SelectedRows.Count > 0)
     {
         DataRow cn    = ((DataRowView)dgvChiNhanh.SelectedRows[0].DataBoundItem).Row;
         DataRow monan = dsMonAn.NewRow();
         monan["Mama"]   = tbMaMonAn.Text;
         monan["Gia"]    = tbGia.Text;
         monan["GhiChu"] = tbTenMonAn.Text;
         monan["MaCN"]   = cn["CNMa"];
         dsMonAn.Rows.Add(monan);
         XuLyDuLieu.ghiBang("MonAn", dsMonAn);
     }
     else
     {
         MessageBox.Show("chon Chi Nhanh", "Thong Bao", MessageBoxButtons.OK);
     }
 }
Esempio n. 22
0
 private void tongdai_Load(object sender, EventArgs e)
 {
     dsMonAn                 = XuLyDuLieu.docBang("select * from MonAn");
     dsMonAnView             = new DataView(dsMonAn);
     dgvMonAn.DataSource     = dsMonAnView;
     dsChiNhanh              = XuLyDuLieu.docBang("select * from ChiNhanh");
     dsChiNhanhView          = new DataView(dsChiNhanh);
     dgvChiNhanh.DataSource  = dsChiNhanhView;
     comboBox1.DataSource    = dsChiNhanh;
     comboBox1.DisplayMember = "TenChiNhanh";
     comboBox1.ValueMember   = "MaChiNhanh";
     dsdonhang               = XuLyDuLieu.docBang("select * from DonHang");
     dgvDonHang.DataSource   = dsdonhang;
     dskhach                 = XuLyDuLieu.docBang("Select * from Khach");
     dgvKhach.DataSource     = dskhach;
     dslichsu                = XuLyDuLieu.docBang("select * from LichSuMua");
     dslichsuview            = new DataView(dslichsu);
     dgvLichSu.DataSource    = dslichsuview;
 }
Esempio n. 23
0
 private void btDonHang_Click(object sender, EventArgs e)
 {
     if (tbMaDonHang.Text != "" || tbSoDienThoai.Text != "" || tbDiaChi.Text != "")
     {
         DataRow donhang = dsDonHang.NewRow();
         dsDonHang.Rows.Add(donhang);
         donhang["MaDonHang"]   = tbMaDonHang.Text;
         donhang["MaChiNhanh"]  = cbChiNhanh.SelectedValue;
         donhang["SoDienThoai"] = tbSoDienThoai.Text;
         donhang["DiaChi"]      = tbDiaChi.Text;
         donhang["ThoiDiem"]    = dtpNgayMua.Text;
         donhang["TrangThai"]   = "Chưa Thanh Toán";
         donhang["Loai"]        = "1";
         XuLyDuLieu.ghiBang("DonHang", dsDonHang);
     }
     else
     {
         MessageBox.Show("Bạn Chưa Nhập Đủ Thông Tin", "Thông Báo", MessageBoxButtons.OK);
     }
 }
Esempio n. 24
0
        private void fDonHangChiNhanh_Load(object sender, EventArgs e)
        {
            dsChiNhanh               = XuLyDuLieu.docBang("select * from ChiNhanh");
            cbChiNhanh.DataSource    = dsChiNhanh;
            cbChiNhanh.DisplayMember = "TenChiNhanh";
            cbChiNhanh.ValueMember   = "MaChiNhanh";
            dsDonHang = XuLyDuLieu.docBang("select * from DonHang");
            dtgvDonHang.DataSource = dsDonHang;
            dsLichSu = XuLyDuLieu.docBang("Select * from LichSuMua");
            dtgvLichSu.DataSource = dsLichSu;

            dsBan = XuLyDuLieu.docBang("select * from Ban where MaChiNhanh like '" + cbChiNhanh.SelectedValue + "'");
            lvDanhSachBan.Items.Clear();
            for (int i = 0; i < dsBan.Rows.Count; i++)
            {
                lvDanhSachBan.Items.Add(dsBan.Rows[i]["TenBan"].ToString());
                lvDanhSachBan.Items[i].SubItems.Add(dsBan.Rows[i]["TrangThai"].ToString());
                lvDanhSachBan.Items[i].SubItems.Add(dsBan.Rows[i]["MaChiNhanh"].ToString());
                lvDanhSachBan.Items[i].SubItems.Add("0");
            }
        }
Esempio n. 25
0
 private void cbChiNhanh_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbChiNhanh.Text == "ChiNhanhToan")
     {
         dsMonAn     = XuLyDuLieu.docBang("select * from MonAn where MaChiNhanh like '%1%' ");
         dsMonAnView = new DataView(dsMonAn);
         dtgvDanhSachMonAn.DataSource = dsMonAnView;
     }
     else
     if (cbChiNhanh.Text == "ChiNhanhSang")
     {
         dsMonAn     = XuLyDuLieu.docBang("select * from MonAn where MaChiNhanh like '%2%'");
         dsMonAnView = new DataView(dsMonAn);
         dtgvDanhSachMonAn.DataSource = dsMonAnView;
     }
     else
     {
         dsMonAn     = XuLyDuLieu.docBang("select * from MonAn where MaChiNhanh like '%3%'");
         dsMonAnView = new DataView(dsMonAn);
         dtgvDanhSachMonAn.DataSource = dsMonAnView;
     }
 }
Esempio n. 26
0
 private void fThongTinCaNhan_Load(object sender, EventArgs e)
 {
     dskhach = XuLyDuLieu.docBang("Select * from Khach");
     dtgvKhachHang.DataSource = dskhach;
 }
Esempio n. 27
0
 private void fChiPhiPhatSinhNgay_Load(object sender, EventArgs e)
 {
     dsChiPhi = XuLyDuLieu.docBang("select * from ChiPhiPhatSinh");
 }
Esempio n. 28
0
 private void button1_Click(object sender, EventArgs e)
 {
     dsDonHang             = XuLyDuLieu.docBang("select * from DonHang where Loai like '%3%' ");
     dtgvNhanDH.DataSource = dsDonHang;
 }
Esempio n. 29
0
 private void fDoanhThuTong_Load(object sender, EventArgs e)
 {
     dsChiPhi = XuLyDuLieu.docBang("select * from ChiPhiPhatSinh");
     dtgvChiPhi.DataSource = dsChiPhi;
 }