Exemple #1
0
        public ActionResult NewDetail(New_t n)
        {
            n.UpdateIssueDateByTime();
            if (SessionData.Current.NewId.HasValue)
            {
                n.Id = SessionData.Current.NewId.Value;
            }
            if (ModelState.IsValid)
            {
                if (CurrentUserID.HasValue)
                {
                    _ins.AddOrUpdate(n, CommonData.Current.UserId.Value);
                }
                else
                {
                    throw new Exception("User must be loged in");
                }

                return(RedirectToAction("News"));
            }
            else
            {
                n.AlbumIds = SessionData.Current.AlbumIds;
                return(View(n));
            }
        }