public async Task<ActionResult> BasicSurveyComplete(QuesViewModel quesViewModel) { ViewBag.LeftMenu = Global.Report; int questionSn = quesViewModel.QuestionSn; string compSn = Session[Global.CompSN].ToString(); if (quesViewModel.QuestionSn > 0) { var quesMaster = await _quesMasterService.GetQuesMasterAsync(questionSn); quesMaster.Status = "C"; await _quesMasterService.SaveDbContextAsync(); var compMappings = await _scCompMappingService.GetCompMappingsForCompanyAsync(int.Parse(compSn)); for(int i = 0; i < compMappings.Count; i++) { RptMaster rptMaster = new RptMaster(); rptMaster.BasicYear = quesMaster.BasicYear.Value; rptMaster.BizWorkSn = compMappings[i].BizWorkSn; rptMaster.Status = "T"; rptMaster.QuestionSn = questionSn; rptMaster.CompSn = int.Parse(compSn); rptMaster.MentorId = compMappings[i].MentorId; rptMaster.RegDt = DateTime.Now; rptMaster.RegId = Session[Global.LoginID].ToString(); await _rptMasterService.AddRptMasterAsync(rptMaster); } } else { //에러처리 필요 return View(quesViewModel); } return RedirectToAction("BasicSurvey", "Report", new { area = "Company" }); }
public async Task<int> AddRptMasterAsync(RptMaster rptMaster) { var rstScUsr = rptMasterRepository.Insert(rptMaster); if (rstScUsr == null) { return -1; } return await SaveDbContextAsync(); }
public void ModifyRptMaster(RptMaster rptMaster) { rptMasterRepository.Update(rptMaster); }
public RptMaster Insert(RptMaster rptMaster) { return rptMasterRepository.Insert(rptMaster); }