//public async Task<ActionResult> MentoringTotalReportList(SelectedMentorTotalReportParmModel param, string curPage)
        //{
        //    ViewBag.LeftMenu = Global.MentoringReport;

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

        //    //사업 DropDown List Data
        //    var bizWorkDropDown = await MakeBizWork(mentorId, param.BizWorkYear);
        //    SelectList bizList = new SelectList(bizWorkDropDown, "BizWorkSn", "BizWorkNm");
        //    ViewBag.SelectBizWorkList = bizList;

        //    //기업 DropDwon List Data
        //    var compInfoDropDown = await MakeBizComp(mentorId, param.BizWorkSn, param.BizWorkYear);
        //    SelectList compInfoList = new SelectList(compInfoDropDown, "CompSn", "CompNm");
        //    ViewBag.SelectCompInfoList = compInfoList;

        //    //사업년도 DownDown List Data
        //    var bizWorkYearDropDown = MakeBizYear(2015);
        //    SelectList bizWorkYear = new SelectList(bizWorkYearDropDown, "Value", "Text");
        //    ViewBag.SelectBizWorkYearList = bizWorkYear;

        //    //검색조건을 유지하기 위한
        //    ViewBag.SelectParam = param;

        //    //실제 쿼리
        //    int pagingSize = int.Parse(ConfigurationManager.AppSettings["PagingSize"]);

        //    var pagedListscMentoringTotalReport = await _scMentoringTotalReportService.GetPagedListMentoringTotalReportAsync(int.Parse(curPage ?? "1"), pagingSize, mentorId, param.BizWorkYear, param.BizWorkSn, param.CompSn);

        //    //맨토링 종합 레포트 정보 조회
        //    var listTotalReportView =
        //       Mapper.Map<List<MentoringTotalReportViewModel>>(pagedListscMentoringTotalReport);

        //    return View(new StaticPagedList<MentoringTotalReportViewModel>(listTotalReportView, int.Parse(curPage ?? "1"), pagingSize, pagedListscMentoringTotalReport.TotalItemCount));

        //}
        //#endregion


        #region 멘토 일지
        public async Task <ActionResult> MentoringReportList(SelectedMentorReportParmModel param, string curPage)
        {
            ViewBag.naviLeftMenu = Global.MentoringReport;

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

            SqlParameter loginId = new SqlParameter("LOGIN_ID", Session[Global.LoginID].ToString());

            object[] parameters = new object[] { loginId };
            var      compList   = await procMngService.getCompMapping(parameters);

            // 기업명 List
            var compDropDown = Mapper.Map <List <MentoringReportViewModel> >(compList);

            MentoringReportViewModel title = new MentoringReportViewModel();

            title.CompSn = 0;
            title.CompNm = "기업 선택";
            compDropDown.Insert(0, title);

            SelectList compListSelect = new SelectList(compDropDown, "CompSn", "CompNm");

            ViewBag.SelectCompList = compListSelect;


            // 매핑 되어있지 않은 Mentor는 compSn이 없기때문에 우선은 단순 View만 보여줌
            if (compList.Count > 0)
            {
                // MENTOR_ID, COMP_SN을 추출하여 해당 파일 LIST 조회
                SqlParameter loginId2    = new SqlParameter("LOGIN_ID", Session[Global.LoginID].ToString());
                SqlParameter compSn      = new SqlParameter("COMP_SN", compList[0].COMP_SN);
                object[]     parameters2 = new object[] { loginId2, compSn };
                var          compSnList  = await procMngService.getMentoringReport(parameters2);

                var mentoringList = compSnList.Where(bw => bw.CLASSIFY == "A");

                var listTotalReportView =
                    Mapper.Map <List <MentoringReportViewModel> >(mentoringList);

                //검색조건을 유지하기 위한+
                ViewBag.SelectParam = param;

                //맨토링 일지 정보 조회
                int pagingSize = int.Parse(ConfigurationManager.AppSettings["PagingSize"]);
                //var pagedListscMentoringReport = await _scMentoringReportService.GetPagedListMentoringReportAsync(int.Parse(curPage ?? "1"), pagingSize, mentorId, param.BizWorkYear, param.BizWorkSn, param.CompSn);

                return(View(new StaticPagedList <MentoringReportViewModel>(listTotalReportView, int.Parse(curPage ?? "1"), pagingSize, listTotalReportView.Count)));
            }
            else
            {
                return(View());
            }
        }
        public async Task <ActionResult> RegMentoringReport()
        {
            ViewBag.naviLeftMenu = Global.MentoringReport;

            SqlParameter loginId = new SqlParameter("LOGIN_ID", Session[Global.LoginID].ToString());

            object[] parameters = new object[] { loginId };
            var      compList   = await procMngService.getCompMapping(parameters);

            // 기업명 List
            var compDropDown = Mapper.Map <List <MentoringReportViewModel> >(compList);

            MentoringReportViewModel title = new MentoringReportViewModel();

            title.CompSn = 0;
            title.CompNm = "기업 선택";
            compDropDown.Insert(0, title);

            SelectList compListSelect = new SelectList(compDropDown, "CompSn", "CompNm");

            ViewBag.SelectCompList = compListSelect;

            // 멘토링 분야 ( con_code )
            //var conCodeDropDown = Mapper.Map<List<MentoringReportViewModel>>(compList);

            //MentoringReportViewModel title2 = new MentoringReportViewModel();
            //title2.ConCode = "분야 선택";

            //conCodeDropDown.Insert(0, title2);

            //SelectList ConCodeListSelect = new SelectList(conCodeDropDown, "ConCode", "ConCode");
            //ViewBag.SelectConCodeList = ConCodeListSelect;

            // MENTOR_ID, COMP_SN을 추출하여 해당 파일 LIST 조회

            if (compList.Count != 0)
            {
                //SqlParameter loginId2 = new SqlParameter("LOGIN_ID", Session[Global.LoginID].ToString());
                //SqlParameter compSn = new SqlParameter("COMP_SN", compList[0].COMP_SN);

                //object[] parameters2 = new object[] { loginId2, compSn };
                //var compSnList = await procMngService.getMentoringReport(parameters2);
                //var mentoringTitleList = compSnList.Where(bw => bw.CLASSIFY == "A").Select(bw => bw.MENTORING_SUBJECT).ToList();
            }

            return(View());
        }
Esempio n. 3
0
        public async Task <ActionResult> MentoringReportDetail(int reportSn, SelectedMentorReportParmModel selectParam)
        {
            ViewBag.naviLeftMenu = Global.MentorMng;

            var scMentoringReport = await _scMentoringReportService.GetMentoringReportById(reportSn);

            //멘토링 사진
            var listscMentoringImageInfo = scMentoringReport.ScMentoringFileInfoes.Where(mtfi => mtfi.Classify == "P").Select(mtfi => mtfi.ScFileInfo).Where(fi => fi.Status == "N");

            //사진추가
            var listMentoringPhotoView =
                Mapper.Map <List <FileContent> >(listscMentoringImageInfo);

            FileHelper fileHelper = new FileHelper();

            foreach (var mentoringPhoto in listMentoringPhotoView)
            {
                mentoringPhoto.FileBase64String = await fileHelper.GetPhotoString(mentoringPhoto.FilePath);
            }

            //첨부파일
            var listscFileInfo = scMentoringReport.ScMentoringFileInfoes.Where(mtfi => mtfi.Classify == "A").Select(mtfi => mtfi.ScFileInfo).Where(fi => fi.Status == "N");

            var listFileContentView =
                Mapper.Map <List <FileContent> >(listscFileInfo);

            //멘토링 상세 매핑
            var reportViewModel =
                Mapper.Map <MentoringReportViewModel>(scMentoringReport);

            // 멘토명을 이용한 기업명
            var mentorId       = reportViewModel.MentorId;
            var mentorLoginKey = await _scUsrService.SelectScUsrforIf(mentorId);

            SqlParameter loginId = new SqlParameter("LOGIN_ID", mentorLoginKey.TcmsLoginKey);

            object[] parameters = new object[] { loginId };
            var      listObj    = await procMngService.getCompMapping(parameters);

            ViewBag.CompName = listObj[0].COMP_NM;


            //멘토링상세뷰에 파일정보 추가
            reportViewModel.FileContents   = listFileContentView;
            reportViewModel.MentoringPhoto = listMentoringPhotoView;

            //검색조건 유지를 위해
            ViewBag.SelectParam = selectParam;

            return(View(reportViewModel));
        }