Esempio n. 1
0
        public async Task <ActionResult> BasicSurveyReport(BasicSurveyReportViewModel paramModel, string curPage)
        {
            ViewBag.naviLeftMenu = Global.Report;

            int pagingSize = int.Parse(ConfigurationManager.AppSettings["PagingSize"]);
            int pageSize   = int.Parse(ConfigurationManager.AppSettings["PagingSize"]);

            var listPageView = await tcmsCompStatusSelectViewService.getTcmsByWriteBa("Y");

            var selectCompViews = Mapper.Map <List <BasicSurveyReportViewModel> >(listPageView);

            string[] nCheckArray = new string[listPageView.Count];
            //var testview = await vcMentorMappingService.getVcMentorMappingByCompSn(listPageView[i].CompSn);
            if (listPageView.Count > 0)
            {
                for (int i = 0; i < nCheckArray.Length; i++)
                {
                    var obj = await vcMentorMappingService.GetCompSnForTcms(Convert.ToString(listPageView[i].CompSn), Convert.ToString(listPageView[i].BaSn), listPageView[i].NumSn, listPageView[i].SubNumSn, listPageView[i].ConCode);

                    if (obj == null)
                    {
                        nCheckArray[i] = null;
                    }
                    else
                    {
                        selectCompViews[i].MentorSn = Convert.ToString(obj.MentorSn); //mentorsn 저장
                        var mentorid = await vcUsrInfoService.getMentorInfoBySn(selectCompViews[i].MentorSn);

                        var mentorname = await vcUsrInfoService.selectScUsrByTcms(Convert.ToString(mentorid.TcmsLoginKey));

                        selectCompViews[i].MentorNm = mentorname.Name; //mentorname 저장
                    }
                }
            }
            var searchBy = new List <SelectListItem>()
            {
                new SelectListItem {
                    Value = "0", Text = "기업명", Selected = true
                },
                new SelectListItem {
                    Value = "1", Text = "전문기관(BA)명"
                },
            };

            ViewBag.SelectList   = searchBy;
            ViewBag.ListPageView = listPageView;

            return(View(new StaticPagedList <BasicSurveyReportViewModel>(selectCompViews.ToPagedList(1, pageSize), 1, pagingSize, selectCompViews.Count)));
        }
        // 매핑된 리스트를 보여주는 첫 화면
        //public async Task<ActionResult> BASupervise()
        //{
        //    // 여기에서 보일 데이터

        //    // BA명 | BA 전화번호 | BA EMAIL | 컨설팅코드 | 보고서 담당 멘토

        //    ViewBag.naviLeftMenu = Global.BAMng;
        //    var vcCompInfo = await vcCompInfoService.getVcCompInfoById(Session[Global.LoginID].ToString());
        //    SqlParameter compSn = new SqlParameter("COMP_SN", vcCompInfo.CompSn);
        //    object[] parameters = new object[] { compSn };                                 // 객체에 데이터 삽입

        //    var obj = await compBaMngService.getCompMentorMapping(parameters);  // 해당 기업과 관련된 리스트데이터 가져오기

        //    var usrViews = Mapper.Map<List<BASuperviseViewModel>>(obj);

        //    return View(usrViews);
        //}
        //새로 추가 2016-07-13
        public async Task <ActionResult> BASupervise()
        {
            // 여기에서 보일 데이터

            // BA명 | BA 전화번호 | BA EMAIL | 담당 멘토 | 컨설팅 코드
            ViewBag.naviLeftMenu = Global.BAMng;
            var vcCompInfo = await vcCompInfoService.getVcCompInfoById(Session[Global.LoginID].ToString());

            //var getMapping = await vcCompInfoService.getCompMappingForSn(vcCompInfo.CompSn);

            SqlParameter compSn = new SqlParameter("COMP_SN", vcCompInfo.CompSn);

            object[] parameters = new object[] { compSn };                      // 객체에 데이터 삽입

            var obj = await compBaMngService.getCompMentorMapping(parameters);  // 해당 기업과 관련된 리스트데이터 가져오기

            var usrViews = Mapper.Map <List <BASuperviseViewModel> >(obj);

            string[] nCheckArray = new string[usrViews.Count];

            if (usrViews.Count > 0)
            {
                for (int i = 0; i < nCheckArray.Length; i++)
                {
                    var getInfo = await vcMentorMappingService.GetCompSnForTcms(Convert.ToString(usrViews[i].COMP_SN), Convert.ToString(usrViews[i].BA_SN), Convert.ToString(usrViews[i].NUM_SN), Convert.ToString(usrViews[i].SUB_NUM_SN), usrViews[i].CON_CODE);

                    if (getInfo == null)
                    {
                        nCheckArray[i] = null;
                    }
                    else
                    {
                        usrViews[i].MENTOR_SN = getInfo.MentorSn; //mentorSn 저장
                        var mentorid = await vcUsrInfoService.getMentorInfoBySn(Convert.ToString(usrViews[i].MENTOR_SN));

                        var mentorname = await vcUsrInfoService.selectScUsrByTcms(Convert.ToString(mentorid.TcmsLoginKey));

                        usrViews[i].MENTOR_NM = mentorname.Name; //mentorname 저장
                    }
                }
            }

            return(View(usrViews));
        }
        public async Task <ActionResult> CompStateManage(TcmsCompStatusSelectViewModel paramModel, string curPage)
        {
            ViewBag.naviLeftMenu = Global.CompMng;

            int pagingSize = int.Parse(ConfigurationManager.AppSettings["PagingSize"]);
            int pageSize   = int.Parse(ConfigurationManager.AppSettings["PagingSize"]);

            var listPageView = await tcmsCompStatusSelectViewService.getTcmsByCompStatus("B");

            var selectCompViews = Mapper.Map <List <TcmsCompStatusSelectViewModel> >(listPageView);

            string[] nCheckArray = new string[listPageView.Count];

            if (listPageView.Count > 0)
            {
                for (int i = 0; i < nCheckArray.Length; i++)
                {
                    var obj = await vcMentorMappingService.GetCompSnForTcms(Convert.ToString(listPageView[i].CompSn), Convert.ToString(listPageView[i].BaSn), listPageView[i].NumSn, listPageView[i].SubNumSn, listPageView[i].ConCode);

                    if (obj == null)
                    {
                        nCheckArray[i] = null;
                    }
                    else
                    {
                        selectCompViews[i].MentorSn = Convert.ToString(obj.MentorSn); //mentorsn 저장
                        var mentorid = await vcUsrInfoService.getMentorInfoBySn(selectCompViews[i].MentorSn);

                        var mentorname = await vcUsrInfoService.selectScUsrByTcms(Convert.ToString(mentorid.TcmsLoginKey));

                        selectCompViews[i].Name = mentorname.Name; //mentorname 저장
                        var lastreport = await _VcLastReportNSatService.getSatSn(Convert.ToString(selectCompViews[i].CompSn), selectCompViews[i].NumSn, selectCompViews[i].SubNumSn, selectCompViews[i].MentorSn, selectCompViews[i].ConCode);

                        if (lastreport == null)
                        {
                            continue;
                        }
                        else
                        {
                            selectCompViews[i].SatSn             = lastreport.SatSn;
                            selectCompViews[i].SatisfactionGrade = lastreport.SatisfactionGrade ?? default(int);
                            selectCompViews[i].ConStatus         = lastreport.ConStatus;
                        }
                    }
                }
            }

            ViewBag.nCheckArray = nCheckArray;
            var searchBy = new List <SelectListItem>()
            {
                new SelectListItem {
                    Value = "0", Text = "기업명", Selected = true
                },
                new SelectListItem {
                    Value = "1", Text = "전문기관(BA)명"
                },
            };

            ViewBag.SelectList = searchBy;

            return(View(new StaticPagedList <TcmsCompStatusSelectViewModel>(selectCompViews.ToPagedList(1, pageSize), 1, pagingSize, selectCompViews.Count)));
        }