public ActionResult AddThread(ThreadPO form)
        {
            ActionResult response = null;

            if (ModelState.IsValid)
            {
                try
                {
                    //maps and adds the user inputted thread information to the database
                    ThreadDO dataObject = ThreadMapper.ThreadPOToDO(form);
                    _threadDataAccess.AddThread(dataObject);
                    //sends user back to the list of threads page
                    response = RedirectToAction("Index", "Thread");
                }
                catch (Exception ex)
                {
                    Logger.Log("Fatal", ex.TargetSite.ToString(), ex.Message, ex.StackTrace);
                }
            }
            else
            {
                response = View(form);
            }
            return(response);
        }
示例#2
0
        public bool AddThread(ThreadDTO td)
        {
            ThreadDAO t  = new ThreadDAO();
            bool      kq = t.AddThread(td);

            if (kq == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }