//protected void btnChapNhan_Click(object sender, EventArgs e)
        //{
        //    if (txtNguoiNhan.Text != "" && txtSoTiepNhan.Text != "" && txtNgayNhan.Text != "")
        //    {
        //        string MaHoSoKeKhaiDuBi = Session["MaHoSo"].ToString();
        //        Response.Redirect(@"~/VanPhong/ChapNhanHoSo.aspx?MaHoSoKeKhaiDuBi='" + MaHoSoKeKhaiDuBi + "'");
        //    }
        //    else
        //    {
        //        Response.Write("<script>alert('Lỗi ! \n Thông tin tiếp nhận hồ sơ chưa đầy đủ, vì vậy hồ sơ chưa được gửi tới cơ quan chức năng')</script>");
        //    }


        //}


        #region "NHẬP THÔNG TIN GỬI, NHẬN HỒ SƠ"
        protected void LoadThongTinGuiNhanHoSo()
        {
            try
            {
                string        s = Session["MaHoSo"].ToString();
                tblHoSoKeKhai HSKeKhaiHienTai = don.LayThongTinHoSoKeKhai(Session["MaHoSo"].ToString());
                txtTieuDeKinhGui.Text            = HSKeKhaiHienTai.KinhGuiCoQuanChucNang;
                txtNguoiVietDon.Text             = HSKeKhaiHienTai.NguoiVietDon;
                drLoaiDeNghiCapGCN.SelectedValue = HSKeKhaiHienTai.MaLoaiDeNghi;
                txtNghiaVuTaiChinh.Text          = HSKeKhaiHienTai.NghiaVuTaiChinh;
                txtGiayToKemTheo.Text            = HSKeKhaiHienTai.GiayToKemTheo;
                txtDeNghiKhac.Text            = HSKeKhaiHienTai.DeNghiKhac;
                txtEmailNguoiVietDon.Text     = HSKeKhaiHienTai.DiaChiMail;
                txtDienThoaiNguoiVietDon.Text = HSKeKhaiHienTai.SoDienThoaiLienHe;


                txtNguoiNhan.Text  = HSKeKhaiHienTai.NguoiNhanHoSo;
                txtNgayNhan.Text   = HSKeKhaiHienTai.NgayNhanHoSo.ToString();
                txtSoTiepNhan.Text = HSKeKhaiHienTai.SoTiepNhan;
                txtQuyen.Text      = HSKeKhaiHienTai.Quyen;
            }
            catch (Exception ex)
            {
                string s = ex.Message;
            }
        }
 public tblHoSoKeKhai LayThongTinHoSoKeKhai(string MaHoSo)
 {
     try
     {
         long          _maHS = long.Parse(MaHoSo);
         tblHoSoKeKhai HS    = db.tblHoSoKeKhais.Single(h => h.MaHoSo == _maHS);
         return(HS);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Пример #3
0
        protected void LoadThongTin(string MaHoSo)
        {
            try
            {
                long _maHoSo = long.Parse(MaHoSo);

                XuLyDonXinCapGCN don = new XuLyDonXinCapGCN();

                tblHoSoKeKhai kk = don.LayThongTinHoSoKeKhai(MaHoSo);
                if (kk != null)
                {
                    lblTieuDeDon.Text       = kk.KinhGuiCoQuanChucNang;
                    lblNguoiVietDon.Text    = kk.NguoiVietDon;
                    lblEmail.Text           = kk.DiaChiMail;
                    lblDienThoai.Text       = kk.SoDienThoaiLienHe;
                    lblDeNghi.Text          = kk.MaLoaiDeNghi;
                    lblDeNghiKhac.Text      = kk.DeNghiKhac;
                    lblNgayNhanHoSo.Text    = ((DateTime)kk.NgayNhanHoSo).ToString("dd/MM/yyyy");
                    lblNguoiNhanHoSo.Text   = kk.NguoiNhanHoSo;
                    lblSoVaoSo.Text         = kk.SoTiepNhan;
                    lblQuyen.Text           = kk.Quyen;
                    lblNghiaVuTaiChinh.Text = kk.NghiaVuTaiChinh;
                    lblGiayToKemTheo.Text   = kk.GiayToKemTheo;
                }

                grvChu.DataSource = don.dsChu(MaHoSo);
                grvChu.DataBind();

                grvThuaDat.DataSource = don.dsThuaDat(MaHoSo);
                grvThuaDat.DataBind();

                grvNhaO.DataSource = don.dsNhaO(MaHoSo);
                grvNhaO.DataBind();


                // thong tin rung cay lau nam...

                // thong tin rung san xuat...

                // thong tin xet duyet cap co so
                tblXacNhanCapCoSo xd1 = don.LayThongTinXacNhanCapCoSo(MaHoSo);
                if (xd1 != null)
                {
                    lblNoiDungKeKhaiSoVoiHienTai.Text = xd1.NoiDungKeKhaiSoVoiHienTrang;
                    lblNguonGoc.Text           = xd1.NguonGocSuDungDat;
                    lblThoiDiemSuDungDat.Text  = ((DateTime)xd1.ThoiDiemSuDungDatVaoMucDichDangKy).ToString("dd/MM/yyyy");
                    lblThoiDiemTaoTaiSan.Text  = ((DateTime)xd1.ThoiDiemTaoLapTaiSanGanLienVoiDat).ToString("dd/MM/yyyy");
                    lblTinhTrangTranhChap.Text = xd1.TinhTrangTranhChapDatDaiVaTaiSan;
                    lblPhuHopQuyHoach.Text     = xd1.SuPhuHopVoiQuyHoachSuDungDatVaQuyHoachXayDung;
                    lblNoiDungKhac.Text        = xd1.NoiDungKhac;
                    lblDiaChinhNgay.Text       = ((DateTime)xd1.DiaChinh_NgayXacNhan).ToString("dd/MM/yyyy");
                    lblDiaChinhNguoi.Text      = xd1.DiaChinh_CanBo;
                    lblDiaChinhTieuDe.Text     = xd1.DiaChinh_TieuDeKy;
                    lblUBNDNgay.Text           = ((DateTime)xd1.UBND_NgayKy).ToString("dd/MM/yyyy");
                    lblUBNDNguoi.Text          = xd1.UBND_NguoiKy;
                    lblUBNDTieuDe.Text         = xd1.UBND_TieuDeKy;
                }

                // thong tin xac nhan co quan dang ky
                tblXacNhanCoQuanDangKyDatDai xd2 = don.LayThongTinXacNhanCoQuanDangKy(MaHoSo);
                if (xd2 != null)
                {
                    lblNgayKiemTra.Text        = ((DateTime)xd2.NgayKiemTra).ToString("dd/MM/yyyy");
                    lblNguoiKiemTra.Text       = xd2.NguoiKiemTra;
                    lblChucVuNguoiKiemTra.Text = xd2.ChucVuNguoiKiemTra;
                    lblNoiDungYKien.Text       = xd2.NoiDungYKien;
                    lblGhiChuYKien.Text        = xd2.GhiChu;
                    lblNgayKyVPDK.Text         = ((DateTime)xd2.NgayKy).ToString("dd/MM/yyyy");
                    lblGiamDocVPDK.Text        = xd2.GiamDoc;
                }
            }
            catch (Exception)
            {
                return;
            }
        }
        public bool ChapNhanHoSo(string MaHoSoKeKhai)
        {
            try
            {
                long _maHS           = long.Parse(MaHoSoKeKhai);
                tblHoSoKeKhaiDuBi HS = db.tblHoSoKeKhaiDuBis.Single(h => h.MaHoSoKeKhai == _maHS);

                //-- tao ho so moi
                tblHoSo HoSoMoi = new tblHoSo();
                db.tblHoSoes.Add(HoSoMoi);

                //-- them vao bang ho so

                tblHoSoKeKhai HSKK = new tblHoSoKeKhai();
                HSKK.KinhGuiCoQuanChucNang = HS.KinhGuiCoQuanChucNang;
                HSKK.NgayNhanHoSo          = HS.NgayNhanHoSo;
                HSKK.NguoiNhanHoSo         = HS.NguoiNhanHoSo;
                HSKK.SoTiepNhan            = HS.SoTiepNhan;
                HSKK.Quyen             = HS.Quyen;
                HSKK.NguoiVietDon      = HS.NguoiVietDon;
                HSKK.DonViHanhChinh    = HS.DonViHanhChinh;
                HSKK.GiayToKemTheo     = HS.GiayToKemTheo;
                HSKK.NghiaVuTaiChinh   = HS.NghiaVuTaiChinh;
                HSKK.DeNghiKhac        = HS.DeNghiKhac;
                HSKK.SoDienThoaiLienHe = HS.SoDienThoaiLienHe;
                HSKK.DiaChiMail        = HS.DiaChiMail;
                HSKK.MaLoaiDeNghi      = HS.MaLoaiDeNghi;

                HSKK.MaHoSo = _maHS;
                db.tblHoSoKeKhais.Add(HSKK);

                //-- insert vao bang hosokekhaiduocchapnhan

                tblHoSoKeKhaiDuocChapNhan HSKKDCN = new tblHoSoKeKhaiDuocChapNhan();
                HSKKDCN.MaHoSoKeKhai     = HSKK.MaHoSoKeKhai;
                HSKKDCN.MaHoSoKeKhaiDuBi = HS.MaHoSoKeKhai;
                HSKKDCN.NgayThucHien     = DateTime.Today;

                db.tblHoSoKeKhaiDuocChapNhans.Add(HSKKDCN);

                //-- insert vao bang hoso

                HoSoMoi.LoaiDoiTuong        = HS.MaLoaiDoiTuong;
                HoSoMoi.DonViHanhChinh      = HS.DonViHanhChinh;
                HoSoMoi.TrangThaiHoSoCapGCN = "1";
                //HoSoMoi.TongSoThua se cap nhat o phan thua dat...

                //-- insert vao bang thuadat
                List <tblThuaDatDuBi> dsThuaDat = (from td in db.tblThuaDatDuBis
                                                   where td.MaHoSoKeKhai == HS.MaHoSoKeKhai
                                                   select td).ToList <tblThuaDatDuBi>();

                if (dsThuaDat.Count > 0)
                {
                    HoSoMoi.TongSoThua = dsThuaDat.Count;
                    for (int i = 0; i < dsThuaDat.Count; i++)
                    {
                        tblThuaDat ThuaDaMoi = new tblThuaDat();

                        ThuaDaMoi.MaHoSo              = dsThuaDat[i].MaHoSoKeKhai;
                        ThuaDaMoi.ToBanDo             = dsThuaDat[i].ToBanDo;
                        ThuaDaMoi.SoThua              = dsThuaDat[i].SoThua;
                        ThuaDaMoi.DiaChi              = dsThuaDat[i].DiaChi;
                        ThuaDaMoi.DienTich            = dsThuaDat[i].DienTich;
                        ThuaDaMoi.SuDungChung         = dsThuaDat[i].SuDungChung;
                        ThuaDaMoi.SuDungRieng         = dsThuaDat[i].SuDungRieng;
                        ThuaDaMoi.MucDichSuDung       = dsThuaDat[i].MucDichSuDung;
                        ThuaDaMoi.ThoiHanSuDung       = dsThuaDat[i].ThoiHanSuDung;
                        ThuaDaMoi.NgayBatDauSuDung    = dsThuaDat[i].NgayBatDauSuDung;
                        ThuaDaMoi.LoaiNguonGocSuDung  = dsThuaDat[i].LoaiNguonGocSuDung;
                        ThuaDaMoi.CoHanCheSuDung      = dsThuaDat[i].CoHanCheSuDung.ToString();
                        ThuaDaMoi.NoiDungHanCheSuDung = dsThuaDat[i].NoiDungHanCheSuDung;

                        db.tblThuaDats.Add(ThuaDaMoi);
                    }
                }
                //-- insert vao bang nhao
                List <tblThongTinNhaODuBi> dsNhaO = (from n in db.tblThongTinNhaODuBis
                                                     where n.MaHoSoKeKhai == _maHS
                                                     select n).ToList <tblThongTinNhaODuBi>();
                if (dsNhaO.Count > 0)
                {
                    for (int i = 0; i < dsNhaO.Count; i++)
                    {
                        tblThongTinNhaO NhaMoi = new tblThongTinNhaO();
                        NhaMoi.MaHoSo               = dsNhaO[i].MaHoSoKeKhai;
                        NhaMoi.LoaiNhaO             = dsNhaO[i].LoaiNhaO;
                        NhaMoi.DienTichXayDung      = dsNhaO[i].DienTichXayDung;
                        NhaMoi.DienTichSan          = dsNhaO[i].DienTichSan;
                        NhaMoi.SoHuuChung           = dsNhaO[i].SoHuuChung;
                        NhaMoi.SoHuuRieng           = dsNhaO[i].SoHuuRieng;
                        NhaMoi.KetCau               = dsNhaO[i].KetCau;
                        NhaMoi.SoTang               = dsNhaO[i].SoTang;
                        NhaMoi.CoHanCheThoiHanSoHuu = dsNhaO[i].CoHanCheThoiHanSoHuu;
                        NhaMoi.ThoiHanSoHuu         = dsNhaO[i].ThoiHanSoHuu;

                        db.tblThongTinNhaOs.Add(NhaMoi);
                    }
                }
                //-- insert vao bang chuhoso va bang chu
                List <tblChuHoSoDuBi> dsChuHS = (from chs in db.tblChuHoSoDuBis
                                                 where chs.MaHoSoKeKhai == _maHS
                                                 select chs).ToList <tblChuHoSoDuBi>();

                if (dsChuHS.Count > 0)
                {
                    for (int i = 0; i < dsChuHS.Count; i++)
                    {
                        tblChuHoSo ChuHS = new tblChuHoSo();
                        ChuHS.MaChu  = dsChuHS[i].MaChu;
                        ChuHS.MaHoSo = _maHS;

                        db.tblChuHoSoes.Add(ChuHS);

                        long       ma      = (long)dsChuHS[i].MaChu;
                        tblChuDuBi chudubi = db.tblChuDuBis.Single(c => c.MaChu == ma);
                        tblChu     Chu     = new tblChu();
                        Chu.DanhXung   = chudubi.DanhXung;
                        Chu.HoTen      = chudubi.HoTen;
                        Chu.NamSinh    = chudubi.NamSinh;
                        Chu.DiaChi     = chudubi.DiaChi;
                        Chu.DinhDanh   = chudubi.DinhDanh;
                        Chu.SoDinhDanh = chudubi.SoDinhDanh;
                        Chu.NoiCap     = chudubi.NoiCap;
                        Chu.NgayCap    = chudubi.NgayCap;
                        Chu.QuocTich   = chudubi.QuocTich;

                        db.tblChus.Add(Chu);
                    }
                }


                //LƯU LẠI LẦN 1
                db.SaveChanges();



                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }