示例#1
0
        public ActionResult Artwork(UserMessageCommentFile ucf)
        {
            try
            {
                ucf.User = (Octo.Net.Models.User)Session["user"];
                BL.Message blMessage = new BL.Message();
                ucf.Comment.CollectionId = ucf.File.Artwork.CollectionMessageId;
                ucf.Comment.FromUserId = ucf.User.Id;
                ucf.Comment.ToUserId = ucf.File.UserId;
                ucf.Comment.FromUserId = ucf.User.Id;
                /*
                ucf.Comment.CritiqueId = 1;
                ucf.Comment.X = 1;
                ucf.Comment.Y = 2;
                */
                blMessage.Insert(ucf.Comment);
                //return View(ucf);
                return Redirect(Request.UrlReferrer.ToString());

            }
            catch
            {
                System.Diagnostics.Debug.WriteLine(ucf);
                return View();
            }
        }
示例#2
0
        public ActionResult Artwork(int id)
        {

            if (Authenticate.IsAuthenticated())
            {
                UserMessageCommentFile ucf = new UserMessageCommentFile();

                ucf.User = (Octo.Net.Models.User)Session["user"];

                _file = new BL.File();
                ucf.File = _file.LoadByArtworkId(id);

                _message = new BL.Message();

                ucf.Messages = _message.LoadByCollection(ucf.File.Artwork.CollectionMessageId).OrderByDescending(x => x.DateTime).ToList();

                return View(ucf);
            }
            else
            {
                return RedirectToAction("Login", "Login", new { returnurl = HttpContext.Request.Url });
            }

        }