예제 #1
0
        public ActionResult Create(BoardArticles article)
        {
            article.Email    = "*****@*****.**";
            article.BoardIDX = 2000; //1000: 공지사항 게시판 2000:자유게시판 3000:QnA
            //article.ResisterMemberID = "System";
            article.UserName       = "******";
            article.IPAddress      = Commons.GetIpAddress();
            article.ViewCnt        = 0;
            article.RegistDate     = DateTime.Now;
            article.RegistUserName = "******";

            try
            {
                db.BoardArticles.Add(article);
                db.SaveChanges();

                ViewBag.Result = "OK";
            }
            catch (Exception)
            {
                ViewBag.Result = "FAIL";
            }

            return(View(article));
        }
예제 #2
0
        public ActionResult Create()
        {
            BoardArticles article = new BoardArticles();

            return(View(article));
        }