示例#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> AgreeCompanyAgreement()
        {
            VcUsrInfo scUsr = await _scUsrService.selectScUsrByTcms(Session[Global.LoginID].ToString());

            scUsr.AgreeYn = "Y";
            _scUsrService.ModifyScUsr(scUsr);
            await _scUsrService.SaveDbContextAsync();

            Session[Global.AgreeYn] = "Y";
            return(RedirectToAction("Index", "Main"));
        }
        // 매핑된 리스트를 보여주는 첫 화면
        //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)));
        }
示例#5
0
        public async Task <ActionResult> MentorCompMapping(JoinMentorViewModel paramodel, string curPage)
        {
            ViewBag.naviLeftMenu = Global.MentorMng;

            var baLoginKey = Session[Global.LoginID].ToString();
            var baInfo     = await _scUsrService.getBaInfoById(baLoginKey);

            // 기업 List
            SqlParameter loginKey = new SqlParameter("TCMS_LOGIN_KEY", Session[Global.LoginID]);

            object[] parameters22 = new object[] { loginKey };

            var obj22 = await procMngService.baGetCompSelectList(parameters22);

            //var obj23 = obj22.Where(bw => bw.MENTOR_SN == null);

            var dropDownCompList22 = Mapper.Map <List <JoinMentorViewModel> >(obj22);

            JoinMentorViewModel title22 = new JoinMentorViewModel();

            title22.CompSn = "0";
            title22.CompNm = "기업선택";
            dropDownCompList22.Insert(0, title22);

            SelectList compSelectList = new SelectList(dropDownCompList22, "CompSn", "CompNm");

            ViewBag.SelectCompList = compSelectList;


            // 멘토 select List
            //SqlParameter loginId2 = new SqlParameter("LOGIN_ID", Session[Global.LoginID]);   // sql 파라미터 값 설정
            //object[] parameters2 = new object[] { loginId2 };                                 // 객체에 데이터 삽입

            //var obj2 = await procBaMentorMapping.getBaMentorMapping(parameters2);  // 해당 기업과 관련된 리스트데이터 가져오기
            var obj2 = await _scUsrService.baGetMappingMentor(baInfo.BaSn);

            var dropDownMentor = Mapper.Map <List <JoinMentorViewModel> >(obj2);

            foreach (var item in dropDownMentor)
            {
                var mentorInfo = await _scUsrService.selectScUsrByTcms(item.MentorLoginKey);

                var mentorNm = mentorInfo.Name;

                item.MentorNm = mentorNm;
            }

            JoinMentorViewModel title = new JoinMentorViewModel();

            title.MentorSn = "0";
            title.MentorNm = "멘토 선택";
            dropDownMentor.Insert(0, title);

            SelectList mentorListSelect = new SelectList(dropDownMentor, "MentorSn", "MentorNm");

            ViewBag.SelectMentorList = mentorListSelect;

            // 분야 select List
            var conCodeList = new List <SelectListItem>();

            conCodeList.Add(new SelectListItem {
                Value = "0", Text = "분야 코드 선택", Selected = true
            });
            SelectList list = new SelectList(conCodeList, "Value", "Text");

            ViewBag.SelectConCodeList = list;


            // 해당 BA에 매핑된 멘토 SelectList
            SqlParameter baSn = new SqlParameter("BA_SN", baInfo.BaSn.ToString());

            object[] baSnSql = new object[] { baSn };

            var obj = await procMngService.baGetCompMentorMappingList(baSnSql);

            var usrViewsInfo = Mapper.Map <List <JoinMentorViewModel> >(obj);

            // mapping 됐는지 안됐는지 확인
            foreach (var item in usrViewsInfo)
            {
                var itemCompSn   = int.Parse(item.CompSn);
                var itemBaSn     = int.Parse(item.BaSn);
                var itemNumSn    = item.NumSn;
                var itemSubNumSn = item.SubNumSn;
                var itemConCode  = item.ConCode;

                var checkMapping = await vcMentorMappingService.checkCompMentorMapping(itemCompSn, itemBaSn, itemNumSn, itemSubNumSn, itemConCode);

                if (checkMapping.Count > 0)
                {
                    item.MappingYn = "Y";
                }
                else
                {
                    item.MappingYn = "N";
                }
            }

            var usrViewsInfos        = Mapper.Map <List <JoinMentorViewModel> >(usrViewsInfo);
            var usrViewsInfosOrderby = usrViewsInfo.OrderBy(bw => bw.MappingYn);

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

            return(View(new StaticPagedList <JoinMentorViewModel>(usrViewsInfosOrderby.ToPagedList(int.Parse(curPage ?? "1"), pagingSize), int.Parse(curPage ?? "1"), pagingSize, usrViewsInfos.Count)));
        }