예제 #1
0
        public async Task<ActionResult> BizCheck10(BizCheck10ViewModel bizCheck10ViewModel)
        {
            ViewBag.LeftMenu = Global.Report;
            int questionSn = bizCheck10ViewModel.QuestionSn;

            if (bizCheck10ViewModel.QuestionSn > 0)
            {
                var quesMaster = await _quesMasterService.GetQuesResult1Async(questionSn);

                if (bizCheck10ViewModel.SubmitType == "N")
                {
                    quesMaster.SaveStatus = 13;
                }

                // A1B108 : 품질관리
                foreach (var item in bizCheck10ViewModel.MarketingPlan)
                {
                    var checkItem = quesMaster.QuesResult1.SingleOrDefault(m => m.QuestionSn == questionSn && m.CheckListSn == item.CheckListSn);
                    if (checkItem == null)
                    {
                        var result1 = new QuesResult1();
                        result1.QuestionSn = questionSn;
                        result1.CheckListSn = item.CheckListSn;
                        result1.AnsVal = item.AnsVal;
                        result1.RegDt = DateTime.Now;
                        result1.RegId = Session[Global.LoginID].ToString();
                        quesMaster.QuesResult1.Add(result1);
                    }
                    else
                    {
                        checkItem.AnsVal = item.AnsVal;
                        checkItem.UpdDt = DateTime.Now;
                        checkItem.UpdId = Session[Global.LoginID].ToString();
                    }
                }

                await _quesMasterService.SaveDbContextAsync();
            }
            else
            {
                //에러처리 필요
                return View(bizCheck10ViewModel);
            }

            if (bizCheck10ViewModel.SubmitType == "T")
            {
                return RedirectToAction("BizCheck10", "Report", new { @questionSn = questionSn });
            }
            else
            {
                return RedirectToAction("BizCheck11", "Report", new { @questionSn = questionSn });
            }
        }
예제 #2
0
        public async Task<ActionResult> BizCheck10(string questionSn, string status)
        {
            ViewBag.LeftMenu = Global.Report;

            if (string.IsNullOrEmpty(questionSn))
            {
                // 오류 처리해야함.
                return View();
            }

            var bizCheck10 = new BizCheck10ViewModel();

            // A1C101 : 마케팅 전략의 수립 및 실행
            var quesResult1s = await _quesResult1Service.GetQuesResult1sAsync(int.Parse(questionSn), "A1C101");

            if (quesResult1s.Count() != 7)
            {
                var quesCheckList = await _quesCheckListService.GetQuesCheckListAsync("A1C101");
                var quesCheckListView = Mapper.Map<List<QuesCheckListViewModel>>(quesCheckList);

                foreach (var item in quesCheckListView)
                {
                    item.QuestionSn = int.Parse(questionSn);
                    item.AnsVal = false;
                }

                bizCheck10.MarketingPlan = quesCheckListView;
            }
            else
            {
                var quesCheckListView = Mapper.Map<List<QuesCheckListViewModel>>(quesResult1s);
                bizCheck10.MarketingPlan = quesCheckListView;
            }

            bizCheck10.Status = status;
            bizCheck10.QuestionSn = int.Parse(questionSn);
            return View(bizCheck10);
        }