Example #1
0
        public ActionResult List(MessageModel model)
        {
            TblUser user = (TblUser)Session["LoginUser"];

            if (user == null)
            {
                return(RedirectToAction("Index", "Default"));
            }
            model.PageInfo.Count = TblMessageDAO.QueryUserCount(user);
            model.MessageList    = TblMessageDAO.QueryUser(model.PageInfo, user);
            return(View(model));
        }
Example #2
0
        public ActionResult Add(MessageModel model)
        {
            TblUser user = (TblUser)Session["LoginUser"];

            if (user == null)
            {
                return(RedirectToAction("Index", "Default"));
            }
            try
            {
                model.Info.Uid = user.Uid;
                TblMessageDAO.Add(model.Info);
            }
            catch (Exception ex)
            {
                model.Message = ex.Message;
            }
            model.PageInfo.Count = TblMessageDAO.QueryUserCount(user);
            model.MessageList    = TblMessageDAO.QueryUser(model.PageInfo, user);
            return(View("List", model));
        }