public async Task <ActionResult> RegCompanyQA(RegQaRequestViewModels qaRequestViewModel, string expertType) { ViewBag.LeftMenu = Global.ExpertService; if (ModelState.IsValid) { var scQa = Mapper.Map <ScQa>(qaRequestViewModel); scQa.AskDt = DateTime.Now; scQa.AnsYn = "N"; //저장 int result = await _scQaService.AddQaAsync(scQa); if (result != -1) { return(RedirectToAction("CompanyQAList", "ExpertService", new { expertType = expertType })); } else { ModelState.AddModelError("", "자료요청 등록 실패."); return(View(qaRequestViewModel)); } } ModelState.AddModelError("", "입력값 검증 실패."); return(View(qaRequestViewModel)); }
public async Task <ActionResult> RegCompanyQA(string expertType) { ViewBag.LeftMenu = Global.ExpertService; string questionId = Session[Global.LoginID].ToString(); string compSn = Session[Global.CompSN].ToString(); var scCompMapping = await _scCompMappingService.GetCompMappingAsync(int.Parse(compSn), "A"); var scExpertMapping = await _scExpertMappingService.GetExpertAsync(scCompMapping.BizWorkSn, expertType); var dataQa = new RegQaRequestViewModels { AnswerId = scExpertMapping.ScUsr.LoginId, QuestionId = questionId, QuestionComNm = scCompMapping.ScCompInfo.CompNm }; //전문가 타입 리턴 ViewBag.ExpertType = expertType; return(View(dataQa)); }