コード例 #1
0
        public async Task<ActionResult> ModifyFaq(FaqViewModel faqViewModel)
        {
            ViewBag.LeftMenu = Global.Cs;

            //Faq 조회
            var scFaq = await _scFaqService.GetFaqAsync(faqViewModel.FaqSn);

            scFaq.QstTxt = faqViewModel.QstTxt;
            scFaq.AnsTxt = faqViewModel.AnsTxt;
            scFaq.QclSn = faqViewModel.QclSn;
            scFaq.UpdDt = DateTime.Now;
            scFaq.UpdId = Session[Global.LoginID].ToString();

            await _scFaqService.SaveDbContextAsync();

            return RedirectToAction("Faq", "Cs");
        }
コード例 #2
0
        public async Task<ActionResult> RegFaq(FaqViewModel faqViewModel)
        {
            ViewBag.LeftMenu = Global.Cs;

            var scFaq =
                Mapper.Map<ScFaq>(faqViewModel);

            scFaq.Stat = "N";
            scFaq.RegDt = DateTime.Now;
            scFaq.RegId = Session[Global.LoginID].ToString();

            //Faq 등록
            int result = await _scFaqService.AddFaqAsync(scFaq);

            if (result != -1)
                return RedirectToAction("Faq", "Cs");
            else
            {
                ModelState.AddModelError("", "FAQ 등록 실패.");
                return View(faqViewModel);
            }
        }