예제 #1
0
        public static HtmlTag RenderHouseShowCard(this IHtmlHelper hmtl, HouseShow hs)
        {
            var card = new HtmlTag("div").AddClass("card card-transparent");

            var img1 = new HtmlTag("img", card).AddClass("card-img-top d-lg-none").Attr("height", 320)
                       .Attr("src", hs.FlyerUrl).Attr("width", 200)
                       .Attr("alt", "...");
            var img2 = new HtmlTag("img", card).AddClass("card-img-top d-none d-lg-block").Attr("height", 420)
                       .Attr("src", hs.FlyerUrl).Attr("width", 200)
                       .Attr("alt", "...");

            var body1 = new HtmlTag("div", card).AddClass("card-body");
            var h5    = new HtmlTag("h5", body1).AddClass("card-title text-light mx-auto").Text(hs.Artists);
            var p     = new HtmlTag("p", body1).AddClass("card-text text-light").Text(hs.VenueName);

            var ul  = new HtmlTag("ul", card).AddClass("list-group list-group-flush");
            var li1 = new HtmlTag("li", ul).AddClass("list-group-item make-transparent text-light")
                      .Text(hs.TimeStart.ToLongDateString() + " at " + hs.TimeStart.TimeOfDay);
            var li2 = new HtmlTag("li", ul).AddClass("list-group-item make-transparent text-light");
            // var a = new HtmlTag("a", li2).AddClass("btn btn-dark")
            //     .Attr("href", "/Home/Comments?eventid=" + lc.EventConcertId)
            //     .Text("Comments");
            var a = new HtmlTag("a", li2).AddClass("btn btn-dark nav-link comment-show-button")
                    .Attr("data-widget", "pushmenu")
                    .Text("Comments")
                    .Id(hs.EventConcertId.ToString())
                    .Attr("onclick",
                          "showCommentsForEvent(this.id); changeCommentSectionName('" + hs.Artists + "')");

            return(card);
        }
예제 #2
0
        public async Task <IActionResult> AddToApprovalTrusted(HouseShow houseShow)
        {
            //check if file length is too long
            if (houseShow.FlyerFile.Length > 6000000)
            {
                ModelState.AddModelError("File",
                                         $"The request couldn't be processed (File size exceeded).");
                // Log error
                return(BadRequest(ModelState));
            }

            if (ModelState.IsValid)
            {
                // Scan and upload file
                houseShow.FlyerUrl = await _storageService.StoreImageFile(houseShow.FlyerFile);

                // Get user id
                ClaimsPrincipal currentUser   = User;
                string          currentUserId = currentUser.FindFirst(ClaimTypes.NameIdentifier).Value;
                // Add date to queue; admin must then approve
                _dbAccessLogic.CreateQueuedDate(houseShow, currentUserId);
                // _dbAccessLogic.CreateQueuedDate(localConcert, "371217ea-6458-40eb-ace7-4d5c83df2469");

                return(Ok());
            }

            return(BadRequest());
        }
예제 #3
0
        public int CreateQueuedDate(HouseShow houseShow, string userId)
        {
            bool nullTimeEnd = houseShow.TimeEnd == DateTime.MinValue;
            var  end         = houseShow.TimeEnd;

            return(_dataAccessService.ExecuteProcedureAsync("InsertShowToApprovalQueue", null,
                                                            Pairing.Of("@userId", userId),
                                                            Pairing.Of("@event", houseShow.Artists),
                                                            Pairing.Of("@venueName", houseShow.VenueName),
                                                            Pairing.Of("@timeStart", houseShow.TimeStart),
                                                            Pairing.Of("@flyerurl", houseShow.FlyerUrl),
                                                            Pairing.Of("@timeend", (nullTimeEnd) ? null : end)).Result);
        }