예제 #1
0
        public LogoDetails GetLogoDetails(int logoId, int activeUser)
        {
            Photo details = _homeDA.GetLogoDetails(logoId);

            LogoDetails data = new LogoDetails
            {
                LogoId          = details.ID,
                LogoURL         = details.URL,
                Username        = details.User.Username,
                AccountPhotoURL = details.User.AccountPhotoURL,
                AccountURL      = @"/Profile/Index/" + details.User.ID,
                Title           = details.Title,
                Description     = details.Description,
                UploadDate      = details.CreatedDate.ToShortDateString(),
                LikesNum        = details.Likes.Count,
                CommentsNum     = details.Comments.Count,
                Liked           = details.Likes.Where(l => l.UserID == activeUser).Count() > 0,
                Comments        = details.Comments.Select(c => new Common.ViewModels.Comment
                {
                    LogoId          = c.PhotoID,
                    Username        = c.User.Username,
                    AccountPhotoURL = c.User.AccountPhotoURL,
                    AccountURL      = @"/Profile/Index/" + c.User.ID,
                    Content         = c.Content
                }).ToList()
            };

            return(data);
        }
예제 #2
0
        public Guid UpdateLogoInformation(LogoDetailsModel model)
        {
            var entity = new LogoDetails()
            {
                Website  = model.Website,
                Logo     = model.Logo,
                Skype    = model.Skype,
                Language = model.Language,
                DateTime = DateTime.UtcNow,
            };

            Context.LogoDetails.Add(entity);
            Context.SaveChanges();
            return(entity.Id);
        }
예제 #3
0
        public ActionResult LogoDetails(int logoId)
        {
            LogoDetails data = _homeBL.GetLogoDetails(logoId, (int)HttpContext.Session["ActiveUserID"]);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }