예제 #1
0
        public async Task<ActionResult> ModifyNotice(NoticeViewModel noticeViewModel)
        {
            ViewBag.LeftMenu = Global.Cs;

            var scNtc = await _scNtcService.GetNoticeAsync(noticeViewModel.NoticeSn);

            scNtc.Subject = noticeViewModel.Subject;
            scNtc.RmkTxt = noticeViewModel.RmkTxt;
            scNtc.UpdDt = DateTime.Now;
            scNtc.UpdId = Session[Global.LoginID].ToString();

            await _scNtcService.SaveDbContextAsync();

            return RedirectToAction("Notice", "Cs");
        }
예제 #2
0
        public async Task<ActionResult> RegNotice(NoticeViewModel noticeViewModel)
        {
            ViewBag.LeftMenu = Global.Cs;

            var scNtc =
                Mapper.Map<ScNtc>(noticeViewModel);

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

            //Faq 등록
            int result = await _scNtcService.AddNoticeAsync(scNtc);

            if (result != -1)
                return RedirectToAction("Notice", "Cs");
            else
            {
                ModelState.AddModelError("", "공지 등록 실패.");
                return View(noticeViewModel);
            }
        }