예제 #1
0
        private void btThemCTT_Click(object sender, EventArgs e)
        {
            string s = "false";

            if (txtKiemTraGhiChu.Text == s.ToString())
            {
                MessageBox.Show("Phòng Đang Sửa , chưa sử dụng được!");
            }
            else
            {
                loadTinhTrangPhongThue();
                string   map, makh;
                DateTime nt, ndk, ntr;
                map  = cbbMaP.Text.Trim();
                makh = cbbMaKH.Text.Trim();
                nt   = Convert.ToDateTime(dtpNgayThue.Text);
                ndk  = Convert.ToDateTime(dtpNgayThue.Text);
                ntr  = Convert.ToDateTime(dtpNgayThue.Text);
                DTOChiTietThue ctt = new DTOChiTietThue(map, makh, nt, ndk, ntr);
                try
                {
                    int i = new BUSChiTietThue().Add(ctt);
                    dgvChiTietThue.DataSource = GetCTT();
                    load();
                    loadChiTietGiaThem();
                    kiemtraghichu();
                }
                catch (SqlException ex)
                {
                    MessageBox.Show("Bị Trùng!!" + ex.Message);
                }
            }
        }
예제 #2
0
        private void btThemCTT_Click(object sender, EventArgs e)
        {
            string   map, makh;
            DateTime nt, ndk, ntr;

            map  = cbbMaPhong.Text.Trim();
            makh = cbbMaKH.Text.Trim();
            nt   = Convert.ToDateTime(dtpNgayThue.Text);
            ndk  = Convert.ToDateTime(dtpNgayThue.Text);
            ntr  = Convert.ToDateTime(dtpNgayThue.Text);
            DTOChiTietThue ctt = new DTOChiTietThue(map, makh, nt, ndk, ntr);

            try
            {
                int i = new BUSChiTietThue().Add(ctt);
                dgvChiTietThue.DataSource = GetCTT();
                load();
                xoaCTT();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }