public async Task<ActionResult> BizCheck11(BizCheck11ViewModel bizCheck11ViewModel) { ViewBag.LeftMenu = Global.Report; int questionSn = bizCheck11ViewModel.QuestionSn; if (bizCheck11ViewModel.QuestionSn > 0) { var quesMaster = await _quesMasterService.GetQuesResult1Async(questionSn); if (bizCheck11ViewModel.SubmitType == "N") { quesMaster.SaveStatus = 14; } // A1B108 : 품질관리 foreach (var item in bizCheck11ViewModel.CustomerMng) { 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(bizCheck11ViewModel); } if (bizCheck11ViewModel.SubmitType == "T") { return RedirectToAction("BizCheck11", "Report", new { @questionSn = questionSn }); } else { return RedirectToAction("BizCheck12", "Report", new { @questionSn = questionSn }); } }
public async Task<ActionResult> BizCheck11(string questionSn, string status) { ViewBag.LeftMenu = Global.Report; if (string.IsNullOrEmpty(questionSn)) { // 오류 처리해야함. return View(); } var bizCheck11 = new BizCheck11ViewModel(); // A1C102 : 고객관리 var quesResult1s = await _quesResult1Service.GetQuesResult1sAsync(int.Parse(questionSn), "A1C102"); if (quesResult1s.Count() != 5) { var quesCheckList = await _quesCheckListService.GetQuesCheckListAsync("A1C102"); var quesCheckListView = Mapper.Map<List<QuesCheckListViewModel>>(quesCheckList); foreach (var item in quesCheckListView) { item.QuestionSn = int.Parse(questionSn); item.AnsVal = false; } bizCheck11.CustomerMng = quesCheckListView; } else { var quesCheckListView = Mapper.Map<List<QuesCheckListViewModel>>(quesResult1s); bizCheck11.CustomerMng = quesCheckListView; } bizCheck11.Status = status; bizCheck11.QuestionSn = int.Parse(questionSn); return View(bizCheck11); }