Example #1
0
        private void lbdsMaHD_Click(object sender, EventArgs e)
        {
            string HD_MaHD = lbdsMaHD.SelectedValue.ToString();

            dgvdsDSHonHang.DataSource = XuLyDuLieu.docBang("Select * from HoaDon where (HD_MaHD='" + HD_MaHD + "')");
            dgvdsMonAn.DataSource     = XuLyDuLieu.docBang("Select MDC_Loai,MDC_TenMon,MDC_SoLuong,MDC_Gia from HoaDon,MonDaChon where (HD_MaMDC=MDC_Ma and HD_MaHD='" + HD_MaHD + "')");
        }
Example #2
0
        private void lbDHC_Click(object sender, EventArgs e)
        {
            string DHC_Ma = lbDHC.SelectedValue.ToString();

            dgvdsTD2.DataSource = XuLyDuLieu.docBang("Select MDC_Loai,MDC_TenMon,MDC_SoLuong,MDC_Gia from MonDaChon,dsDonHangCho where (DHC_Ma=MDC_Ma and MDC_Ma='" + DHC_Ma + "')");
            //dgvdsMonAn.DataSource = XuLyDuLieu.docBang("Select MDC_Loai,MDC_TenMon,MDC_SoLuong,MDC_Gia from HoaDon,MonDaChon where (HD_MaHD=MDC_Ma and HD_MaHD='" + HD_MaHD + "')");
        }
Example #3
0
        private void QuanLyDatHang_Load(object sender, EventArgs e)
        {
            lbdsMaHD.DataSource = XuLyDuLieu.docBang("Select * from HoaDon");
            //lbdsMaHD.DataSource = dsChiNhanh;
            lbdsMaHD.DisplayMember = "HD_MaMDC";
            lbdsMaHD.ValueMember   = "HD_MaHD";

            lbDHC.DataSource    = XuLyDuLieu.docBang("Select *from dsDonHangCho");
            lbDHC.DisplayMember = "DHC_Ma";
            lbDHC.ValueMember   = "DHC_MaTD";

            /*dsDonHang = XuLyDuLieu.docBang("Select * from ThongTinHoaDon");
             * dsDonHangView = new DataView(dsDonHang);
             * dgvdsDSHonHang.DataSource = dsDonHangView;*/
            //dsMonAn = XuLyDuLieu.docBang("Select * from dsMon");
            //dsMonAnView = new DataView(dsMonAn);
            //dgvdsMonAn.DataSource = dsMonAnView;
            //dsChiNhanh = XuLyDuLieu.docBang("Select * from CHINHANH");
            //dsChiNhanhView = new DataView(dsChiNhanh);
            //dgvdsChiNhanh.DataSource = dsChiNhanhView;
            dsKhach     = XuLyDuLieu.docBang("Select * from ThongTinKhach");
            dsKhachView = new DataView(dsKhach);
            dgvdsKhachHang.DataSource = dsKhachView;
            dgvdsKhach2.DataSource    = dsKhachView;

            Bingding();



            dsMonAn               = XuLyDuLieu.docBang("Select * from dsMon");
            dsMonAnView           = new DataView(dsMonAn);
            dgvThucDon.DataSource = dsMonAnView;

            dsMonChon = XuLyDuLieu.docBang("Select *from MonDaChon");
            dgvCacMonChon.DataSource = dsMonChon;

            dsDonHang = XuLyDuLieu.docBang("Select *from HoaDon");
            dgvdsDonHang2.DataSource = dsDonHang;
            dgvdsDonHang3.DataSource = dsDonHang;
            dgvdsDonHang5.DataSource = dsDonHang;



            dsDonHangChoDuyet        = XuLyDuLieu.docBang("Select HD_MaHD,HD_MaCN,HD_DiaCHi from HoaDon");
            dgvdsDonHang4.DataSource = dsDonHangChoDuyet;

            dsChiNhanh = XuLyDuLieu.docBang("Select *from dsChiNhanh");
            dgvdsChiNhanh2.DataSource = dsChiNhanh;


            BindingDHC();

            /*int sum = 0;
             * for (int i = 0; i < lvCMDC.Rows.Count; i++)
             * {
             *  sum += Convert.ToInt32(lvCMDC.Rows[i].Cells[3].Value);
             * }
             * textBox1.Text = sum.ToString();*/
        }
Example #4
0
 private void dsMonan_Load(object sender, EventArgs e)
 {
     ds = DocDSLOP();
     dataGridView1.DataSource = ds;
     MonBo      = Docmon();
     MonChay    = DocMonchay();
     DoanhthuCN = Doanhthucn();
     SLDH       = Donhang();
     //-----
     dsKhach     = XuLyDuLieu.docBang("select * from thongtinkhach");
     dsKhachView = new DataView(dsKhach);
     dgvdsKhachHang.DataSource = dsKhachView;
 }
Example #5
0
        private void lbdsMaHD_Click(object sender, EventArgs e)
        {
            string HD_MaHD = lbdsMaHD.SelectedValue.ToString();

            dgvdsDSHonHang.DataSource = XuLyDuLieu.docBang("Select * from HoaDon where (HD_MaHD='" + HD_MaHD + "')");
            //dgvdsMonAn.DataSource = XuLyDuLieu.docBang("Select MDC_Loai,MDC_TenMon,MDC_SoLuong,MDC_Gia from HoaDon,MonDaChon where (HD_MaHD=MDC_Ma and HD_MaHD='" + HD_MaHD + "')");

            tbDHMaDH.DataBindings.Clear();
            tbDHMaDH.DataBindings.Add("text", lbdsMaHD.DataSource, "HD_MaHD");
            tbDHDiaChi.DataBindings.Clear();
            tbDHDiaChi.DataBindings.Add("text", lbdsMaHD.DataSource, "HD_DiaCHi");
            tbDHMaCN.DataBindings.Clear();
            tbDHMaCN.DataBindings.Add("text", lbdsMaHD.DataSource, "HD_MaCN");
            tbDHTen.DataBindings.Clear();
            tbDHTen.DataBindings.Add("text", lbdsMaHD.DataSource, "HD_TenKhach");
            tbDHSDT.DataBindings.Clear();
            tbDHSDT.DataBindings.Add("text", lbdsMaHD.DataSource, "HD_SDT");
            tbDHTien.DataBindings.Clear();
            tbDHTien.DataBindings.Add("text", lbdsMaHD.DataSource, "HD_Gia");
            tbDHTinhTrang.DataBindings.Clear();
            tbDHTinhTrang.DataBindings.Add("text", lbdsMaHD.DataSource, "HD_TinhTrang");
        }
Example #6
0
        private void lbDHC_Click(object sender, EventArgs e)
        {
            string DHC_MaTD = lbDHC.SelectedValue.ToString();

            dgvdsTD2.DataSource = XuLyDuLieu.docBang("Select MDC_Ma,MDC_Loai,MDC_TenMon,MDC_SoLuong,MDC_Gia from MonDaChon,dsDonHangCho where (MDC_Ma='" + DHC_MaTD + "')");
        }
Example #7
0
 private void WebDatHang_Load(object sender, EventArgs e)
 {
     dsMon = XuLyDuLieu.docBang("Select *from MonBo");
     dgvdsMonAn3.DataSource = dsMon;
 }