コード例 #1
0
        public ActionResult Edit(long id)
        {
            HSCV_VANBANDENBusiness = Get <HSCV_VANBANDENBusiness>();
            var VanBan = HSCV_VANBANDENBusiness.Find(id);

            AssignUserInfo();
            if (VanBan == null || currentUser.ID != VanBan.NGUOITAO)
            {
                return(RedirectToAction("NotFound", "Home", new { area = "" }));
            }
            HscvVanBanPhatHanhModel model = new HscvVanBanPhatHanhModel();

            DM_DANHMUC_DATABusiness = Get <DM_DANHMUC_DATABusiness>();
            TAILIEUDINHKEMBusiness  = Get <TAILIEUDINHKEMBusiness>();
            //model.ListDoMat = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOMAT);
            model.ListDoKhan                 = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOKHAN);
            model.ListDoUuTien               = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOUUTIEN);
            model.ListLoaiVanBan             = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.LOAI_VANBAN);
            model.ListLinhVucVanBan          = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.LINHVUCVANBAN);
            model.Extension                  = VbDenExtension;
            model.MaxSize                    = VbDenSize;
            model.ListTaiLieu                = TAILIEUDINHKEMBusiness.GetDataByItemID(id, LOAITAILIEU.VANBANDEN);
            model.VanBan                     = VanBan;
            CCTC_THANHPHANBusiness           = Get <CCTC_THANHPHANBusiness>();
            model.TreeDonVi                  = CCTC_THANHPHANBusiness.GetTree(0);
            HSCV_VANBANDEN_DONVINHANBusiness = Get <HSCV_VANBANDEN_DONVINHANBusiness>();
            var ListDonViId = HSCV_VANBANDEN_DONVINHANBusiness.GetData(id);

            model.ListDonVi = model.ListDonVi = CCTC_THANHPHANBusiness.GetDataByIds(ListDonViId.Where(o => o.DONVI_ID.HasValue).Select(x => x.DONVI_ID.Value).ToList());
            return(View("Create", model));
        }
コード例 #2
0
        public ActionResult Index()
        {
            HscvVanBanPhatHanhModel model = new HscvVanBanPhatHanhModel();

            DM_DANHMUC_DATABusiness = Get <DM_DANHMUC_DATABusiness>();
            //model.ListDoMat = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOMAT);
            model.ListDoKhan        = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOKHAN);
            model.ListDoUuTien      = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOUUTIEN);
            model.ListLoaiVanBan    = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.LOAI_VANBAN);
            model.ListLinhVucVanBan = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.LINHVUCVANBAN);
            HSCV_VANBANDENBusiness  = Get <HSCV_VANBANDENBusiness>();
            HSCV_VANBANDEN_SEARCH searchModel = new HSCV_VANBANDEN_SEARCH();

            AssignUserInfo();
            CCTC_THANHPHANBusiness = Get <CCTC_THANHPHANBusiness>();
            List <int> Ids = new List <int>();

            if (IsInActivities(currentUser.ListThaoTac, PermissionVanbanModel.DONVI))
            {
                CCTC_THANHPHAN DonVi = CCTC_THANHPHANBusiness.Find(currentUser.DM_PHONGBAN_ID);
                if (DonVi != null && DonVi.PARENT_ID.HasValue && DonVi.PARENT_ID.Value > 0)
                {
                    Ids = CCTC_THANHPHANBusiness.GetDSChild(DonVi.PARENT_ID.Value).Select(x => x.ID).ToList();
                    Ids.Add(DonVi.PARENT_ID.Value);
                    model.TreeData       = CCTC_THANHPHANBusiness.GetTree(DonVi.PARENT_ID.Value);
                    searchModel.DONVI_ID = DonVi.PARENT_ID.Value;
                }
                else
                {
                    Ids = CCTC_THANHPHANBusiness.GetDSChild(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0).Select(x => x.ID).ToList();
                    Ids.Add(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0);
                    searchModel.DONVI_ID = currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0;
                }
            }
            //Nếu là quản lý phòng ban
            else if (IsInActivities(currentUser.ListThaoTac, PermissionVanbanModel.PHONGBAN))
            {
                Ids = CCTC_THANHPHANBusiness.GetDSChild(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0).Select(x => x.ID).ToList();
                Ids.Add(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0);
                searchModel.DONVI_ID = currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0;
            }
            else
            {
                Ids.Add(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0);
                //searchModel.USER_ID = currentUser.ID;
            }
            searchModel.ListDonVi = Ids;
            if (model.TreeData == null)
            {
                model.TreeData = CCTC_THANHPHANBusiness.GetTree(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0);
            }
            searchModel.pageSize  = MaxPerpage;
            searchModel.pageIndex = 1;
            searchModel.ListIds   = initIds(currentUser.DM_PHONGBAN_ID.HasValue ? currentUser.DM_PHONGBAN_ID.Value : 0);
            model.ListResult      = HSCV_VANBANDENBusiness.GetDaTaByPage(searchModel, MaxPerpage);
            SessionManager.SetValue("VanBanDenSearch", searchModel);
            //model.ListVanBan = initVanBanDi();
            model.UserInfoBO = currentUser;
            return(View(model));
        }
コード例 #3
0
        public ActionResult Create()
        {
            HscvVanBanPhatHanhModel model = new HscvVanBanPhatHanhModel();

            DM_DANHMUC_DATABusiness = Get <DM_DANHMUC_DATABusiness>();
            //model.ListDoMat = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOMAT);
            model.ListDoKhan        = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOKHAN);
            model.ListDoUuTien      = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.DOUUTIEN);
            model.ListLoaiVanBan    = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.LOAI_VANBAN);
            model.ListLinhVucVanBan = DM_DANHMUC_DATABusiness.GetDataByCode(DMLOAI_CONSTANT.LINHVUCVANBAN);
            model.ListTaiLieu       = new List <TAILIEUDINHKEM>();
            model.VanBan            = new HSCV_VANBANDEN();
            model.Extension         = VbDenExtension;
            model.MaxSize           = VbDenSize;
            model.ListDonVi         = new List <CCTC_THANHPHAN>();
            CCTC_THANHPHANBusiness  = Get <CCTC_THANHPHANBusiness>();
            model.TreeDonVi         = CCTC_THANHPHANBusiness.GetTree(0);
            return(View(model));
        }