Пример #1
0
        public async Task <ActionResult> BasicSurveyReport(BasicSurveyReportViewModel paramModel, string curPage)
        {
            ViewBag.LeftMenu = Global.Report;
            //사업년도 DownDown List Data
            ViewBag.SelectBizWorkYearList = ReportHelper.MakeYear(2015);

            var mentorId = Session[Global.LoginID].ToString();

            if (string.IsNullOrEmpty(paramModel.Status))
            {
                paramModel.Status = "";
            }


            //사업 DropDown List Data
            var listScMentorMapping = await scMentorMappingService.GetMentorMappingListByMentorId(mentorId, paramModel.BizWorkYear);

            var listScBizWork = listScMentorMapping.Select(mmp => mmp.ScBizWork).ToList();

            ViewBag.SelectBizWorkList = ReportHelper.MakeBizWorkList(listScBizWork);

            var listScCompMapping = await scCompMappingService.GetCompMappingListByMentorId(mentorId, "A", paramModel.BizWorkSn, paramModel.BizWorkYear);

            var listScCompInfo = listScCompMapping.Select(cmp => cmp.ScCompInfo).ToList();

            ViewBag.SelectCompInfoList = ReportHelper.MakeCompanyList(listScCompInfo);
            ViewBag.SelectStatusList   = ReportHelper.MakeReportStatusList();



            //기초역량 보고서 조회
            int pagingSize = int.Parse(ConfigurationManager.AppSettings["PagingSize"]);

            var rptMsters = await rptMasterService.GetRptMasterList(int.Parse(curPage ?? "1"), pagingSize, mentorId, paramModel.BizWorkYear, paramModel.BizWorkSn, paramModel.CompSn, paramModel.Status);

            //뷰모델 맵핑
            var rptMasterListView = Mapper.Map <List <BasicSurveyReportViewModel> >(rptMsters);

            return(View(new StaticPagedList <BasicSurveyReportViewModel>(rptMasterListView, int.Parse(curPage ?? "1"), pagingSize, rptMsters.TotalItemCount)));
        }
Пример #2
0
        public async Task <IList <BizWorkDropDownModel> > MakeBizWork(string mentorId, int bizWorkYear)
        {
            //사업 DropDown List Data
            var listScMentorMapping = await _scMentorMappingService.GetMentorMappingListByMentorId(mentorId, bizWorkYear);

            var listScBizWork = listScMentorMapping.Select(mmp => mmp.ScBizWork);//.ToList();

            var bizWorkDropDown =
                Mapper.Map <List <BizWorkDropDownModel> >(listScBizWork);

            //사업드롭다운 타이틀 추가
            BizWorkDropDownModel titleBizWork = new BizWorkDropDownModel
            {
                BizWorkSn = 0,
                BizWorkNm = "사업명 선택"
            };

            bizWorkDropDown.Insert(0, titleBizWork);

            //SelectList bizList = new SelectList(bizWorkDropDown, "BizWorkSn", "BizWorkNm");

            return(bizWorkDropDown);
        }
Пример #3
0
        public async Task<ActionResult> BasicSurveyReport(BasicSurveyReportViewModel paramModel, string curPage)
        {

            ViewBag.LeftMenu = Global.Report;
            //사업년도 DownDown List Data
            //ViewBag.SelectBizWorkYearList = ReportHelper.MakeYear(2015);

            var bizWorkYearDropDown = ReportHelper.MakeYear(2015);
            SelectList bizWorkYear = new SelectList(bizWorkYearDropDown, "Value", "Text");
            ViewBag.SelectBizWorkYearList = bizWorkYear;

            var mentorId = Session[Global.LoginID].ToString();
            if (string.IsNullOrEmpty(paramModel.Status))
                paramModel.Status = "";

            //사업 DropDown List Data 
            var listScMentorMapping = await scMentorMappingService.GetMentorMappingListByMentorId(mentorId, paramModel.BizWorkYear);
            var listScBizWork = listScMentorMapping.Select(mmp => mmp.ScBizWork).ToList();
            ViewBag.SelectBizWorkList = ReportHelper.MakeBizWorkList(listScBizWork);

            var listScCompMapping = await scCompMappingService.GetCompMappingListByMentorId(mentorId, "A", paramModel.BizWorkSn, paramModel.BizWorkYear);
            var listScCompInfo = listScCompMapping.Select(cmp => cmp.ScCompInfo).ToList();
            ViewBag.SelectCompInfoList = ReportHelper.MakeCompanyList(listScCompInfo);
            ViewBag.SelectStatusList = ReportHelper.MakeReportStatusList();

            var scCompMapping = await scCompMappingService.GetCompMappingAsync(paramModel.BizWorkSn, paramModel.CompSn);
            //scCompMapping.ScCompInfo.

            //var statusForCom = await sc

            //기초역량 보고서 조회
            int pagingSize = int.Parse(ConfigurationManager.AppSettings["PagingSize"]);

            //// 문진표 작성 완료 후 count
            //var countTest = await _quesMasterService.GetQuesMasterAsync(paramModel.QuestionSn);

            var rptMsters = await rptMasterService.GetRptMasterList(int.Parse(curPage ?? "1"), pagingSize, mentorId, paramModel.BizWorkYear, paramModel.BizWorkSn, paramModel.CompSn, paramModel.Status);
            //var rptMaters2 = scCompMapping.ScCompInfo.RptMasters.Where(rm => rm.BasicYear == paramModel.BizWorkYear && rm.BizWorkSn == paramModel.BizWorkSn && rm.CompSn == paramModel.CompSn).SingleOrDefault();

            // QuesMaster -> stauts ="C"인 애들만 mapping
            var quesMaster = await _quesMasterService.GetQuesMasterAsync(paramModel.RegistrationNo, paramModel.BizWorkYear);
            var quesMasterP = await _quesMasterService.GetQuesMasterAsyncPro(paramModel.RegistrationNo, paramModel.BizWorkYear);


            //paramModel.CompleteCount = 0;
            //paramModel.NotYetCountForMentor = 0;
            //paramModel.TotalCountForMentor = 0;

            // 추가적으로 for 문 돌리거나 그냥 viewModel에 direct로 박아주는 방법
            //if(quesMaster.Status == "C")
            //{
            //    paramModel.CompleteCount++;
            //}
            //else
            //{
            //    paramModel.NotYetCountForMentor++;
            //}

            // 전체 기업 수 count
            //var a = quesMaster.Status;
            //var b = quesMaster.QuesCompInfo;

            //paramModel.Status = quesMaster.Status;
            paramModel.TotalCountForMentor = listScCompMapping.Count;
            // var a = rptMsters.Subset;


            //뷰모델 맵핑
            var rptMasterListView = Mapper.Map<List<BasicSurveyReportViewModel>>(rptMsters);

            return View(new StaticPagedList<BasicSurveyReportViewModel>(rptMasterListView, int.Parse(curPage ?? "1"), pagingSize, rptMsters.TotalItemCount));

        }