Beispiel #1
0
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            txtMaHD.Text               = gridView1.GetFocusedRowCellValue("MaHoaDon").ToString();
            dateCreate.EditValue       = gridView1.GetFocusedRowCellValue("NgayLap").ToString();
            txtTotalPrice.Text         = gridView1.GetFocusedRowCellValue("TongGia").ToString();
            lookUpNhanvienID.EditValue = int.Parse(gridView1.GetFocusedRowCellValue("NhanVien").ToString());
            lookUpRoomID.EditValue     = int.Parse(gridView1.GetFocusedRowCellValue("Phong").ToString());
            lookUpRentID.EditValue     = int.Parse(gridView1.GetFocusedRowCellValue("MaPhieuThue").ToString());

            gridCBillDetail.DataSource = DTBill.getChiTietHoaDon(int.Parse(gridView1.GetFocusedRowCellValue("MaHoaDon").ToString()));
            lookUpBillID.EditValue     = int.Parse(gridView1.GetFocusedRowCellValue("MaHoaDon").ToString());
        }
Beispiel #2
0
 private void btnDelBill2_Click(object sender, EventArgs e)
 {
     if (procUCBillDetail.delbyid(gridView2.GetFocusedRowCellValue("UUID").ToString()))
     {
         MessageBox.Show("Xóa phiếu thuê thành công !", "Thông báo");
         gridCBillDetail.DataSource = null;
         gridCBillDetail.DataSource = DTBill.getChiTietHoaDon(int.Parse(txtMaHD.Text));
     }
     else
     {
         MessageBox.Show("Mã phiếu thuê không được phép bỏ trống !", "Lỗi");
     }
 }
Beispiel #3
0
        private void btnUpdateBill2_Click(object sender, EventArgs e)
        {
            string[] _value =
            {
                lookUpBillID.EditValue.ToString(),
                lookUpServiceID.EditValue.ToString(),
                dateUsed.EditValue.ToString(),
                lookUpRoomID2.EditValue.ToString()
            };
            string _where = "UUID=N'" + int.Parse(gridView2.GetFocusedRowCellValue("UUID").ToString()) + "'";
            int    flag   = procUCBillDetail.update(_value, _where);

            if (flag == -1)
            {
                MessageBox.Show("Cập nhật chi tiết hóa đơn thành công !", "Thông báo");
                gridCBillDetail.DataSource = null;
                gridCBillDetail.DataSource = DTBill.getChiTietHoaDon(int.Parse(txtMaHD.Text));
            }
            else
            {
                switch (flag)
                {
                case 0:
                    MessageBox.Show(labelControl5.Text + " không được phép bỏ trống !", "Lỗi");
                    break;

                case 1:
                    MessageBox.Show(labelControl7.Text + " không được phép bỏ trống !", "Lỗi");
                    break;

                case 2:
                    MessageBox.Show(labelControl8.Text + " không được phép bỏ trống !", "Lỗi");
                    break;

                case 3:
                    MessageBox.Show(labelControl9.Text + " không được phép bỏ trống !", "Lỗi");
                    break;
                }
            }
        }
Beispiel #4
0
        private void btnAddBill2_Click(object sender, EventArgs e)
        {
            string[] _value =
            {
                txtMaHD.Text,
                lookUpServiceID.EditValue.ToString(),
                dateUsed.EditValue.ToString(),
                lookUpRoomID2.EditValue.ToString()
            };
            if (procUCBillDetail.create(_value) == -1)
            {
                MessageBox.Show("Thêm chi tiết hóa đơn thành công !", "Thông báo");
                gridCBillDetail.DataSource = null;
                gridCBillDetail.DataSource = DTBill.getChiTietHoaDon(int.Parse(txtMaHD.Text));
            }
            else
            {
                switch (procUCBillDetail.create(_value))
                {
                case 0:
                    MessageBox.Show(labelControl5.Text + " không được phép bỏ trống !", "Lỗi");
                    break;

                case 1:
                    MessageBox.Show(labelControl7.Text + " không được phép bỏ trống !", "Lỗi");
                    break;

                case 2:
                    MessageBox.Show(labelControl8.Text + " không được phép bỏ trống !", "Lỗi");
                    break;

                case 3:
                    MessageBox.Show(labelControl9.Text + " không được phép bỏ trống !", "Lỗi");
                    break;
                }
            }
        }