Пример #1
0
 //
 // GET: /Versions/
 public ActionResult Index(VersionsData data)
 {
     Compression.SetCompression();
     var versions = Model.GetVersions(data.CodeGuid);
     data.Versions = new List<Version>();
     foreach (var v in versions)
     {
         data.Versions.Add(new Version()
             {
                 Author = v.Author,
                 CreationDate = v.DateCreated,
                 Guid = v.VersionGuid,
                 Wall_id = v.Wall_Id,
                 Title = v.Title
             });
     }
     data.IsLive = Model.IsLive(data.CodeGuid);
     data.Author = Model.GetUserByGuid(data.CodeGuid);
     var code = Model.GetCode(data.CodeGuid, false);
     if (code == null)
     {
         throw new HttpException(404, "not found");
     }
     data.CreationDate = code.Date;
     data.Title = code.Title;
     return View(data);
 }
        //
        // GET: /Versions/

        public ActionResult Index(VersionsData data)
        {
            Compression.SetCompression();
            var versions = Model.GetVersions(data.CodeGuid);

            data.Versions = new List <Version>();
            foreach (var v in versions)
            {
                data.Versions.Add(new Version()
                {
                    Author       = v.Author,
                    CreationDate = v.DateCreated,
                    Guid         = v.VersionGuid,
                    Wall_id      = v.Wall_Id
                });
            }
            data.IsLive = Model.IsLive(data.CodeGuid);
            data.Author = Model.GetUserByGuid(data.CodeGuid);
            var code = Model.GetCode(data.CodeGuid, false);

            if (code == null)
            {
                throw new HttpException(404, "not found");
            }
            data.CreationDate = code.Date;
            return(View(data));
        }