示例#1
0
        public PartialViewResult FormHoSo(long?id = 0)
        {
            DM_DANHMUC_DATABusiness     = Get <DM_DANHMUC_DATABusiness>();
            QuanLyHoSoBusiness          = Get <QuanLyHoSoBusiness>();
            DM_NGUOIDUNGBusiness        = Get <DM_NGUOIDUNGBusiness>();
            QuanLyHoSoNguoiNhapBusiness = Get <QuanLyHoSoNguoiNhapBusiness>();
            QuanLyHoSoModel model = new QuanLyHoSoModel();
            var             HoSo  = new QUANLY_HOSO();

            model.ListNamHoSo = GetListNam(DateTime.Now.Year - 20, DateTime.Now.Year + 20, DateTime.Now.Year);
            model.NamChinhLy  = GetListNam();
            if (id > 0)
            {
                HoSo = QuanLyHoSoBusiness.Find(id);
                if (HoSo.HOSO_NAM.HasValue)
                {
                    model.ListNamHoSo = GetListNam(HoSo.HOSO_NAM.Value - 20, HoSo.HOSO_NAM.Value + 20, HoSo.HOSO_NAM);
                }
                if (HoSo.NAM_CHINHLY.HasValue)
                {
                    model.NamChinhLy = GetListNam(HoSo.NAM_CHINHLY.Value - 20, HoSo.NAM_CHINHLY.Value + 20, HoSo.NAM_CHINHLY);
                }
                model.ListNguoiNhap = DM_NGUOIDUNGBusiness.GetDropDow(QuanLyHoSoNguoiNhapBusiness.GetByHoSo(id.Value));
            }
            else
            {
                model.ListNguoiNhap = DM_NGUOIDUNGBusiness.GetDropDow();
            }
            model.HoSo               = HoSo;
            model.ListThoiHan        = DM_DANHMUC_DATABusiness.GetDropDow(DMLOAI_CONSTANT.QLHS_THOI_HAN_BAO_QUAN, HoSo.THOIHAN_BAOQUAN_ID);
            model.ListAccessModifier = DM_DANHMUC_DATABusiness.GetDropDow(DMLOAI_CONSTANT.QLHS_MUC_DO_TRUY_CAP, HoSo.MUCDO_TRUYCAP);
            model.ListKho            = DM_DANHMUC_DATABusiness.GetDropDow(DMLOAI_CONSTANT.QLHS_KHO, HoSo.KHO_ID);
            model.ListPhong          = DM_DANHMUC_DATABusiness.GetDropDow(DMLOAI_CONSTANT.QLHS_PHONG, HoSo.PHONG_ID);

            return(PartialView("_FormHoSo", model));
        }