// GET: Vendor/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Vendor sponsor = await VendorLogic.GetVendorById(id.Value); if (sponsor == null) { return(HttpNotFound()); } return(View(sponsor)); }
public async Task <ActionResult> VendorById(string Token, int id, int eventID) { VendorsLogic attendesBusiness = new VendorsLogic(); EventLogic eventLogic = new EventLogic(); var x = await attendesBusiness.GetVendorById(id); var vendorEvent = x.VendorsEvents.FirstOrDefault(y => y.EventID == eventID); var VendorQuestions = await eventLogic.VendorSurveyQuestions(CurrentUserSession.AttendesID.Value, id); var floorMapping = vendorEvent?.FloorMapLocation?.FloorRegionMappings.FirstOrDefault(); return(Json(new { data = new { x.ID, x.Name, x.Description, x.DocURL, Thumbnail = imageToUrlConvertionHandler(x.Thumbnail), //Helpers.ImageToBase64(MvcCustom.APiImagePath(x.Thumbnail)), x.Status, x.TwitterURL, x.WebsiteURL, vendorEvent?.BoothNo, vendorEvent?.StartTime, VendorPackageType = x.VendorsEvents.FirstOrDefault(y => y.EventID == eventID)?.UserPackageType?.Name, vendorEvent?.EndTime, SurveyQuestions = VendorQuestions.Select(a => new QuestionsWithOptions { QID = a.QID, QuestionText = a.QuestionText, IsAtActiivtyLevel = a.IsAtActiivtyLevel, QuestionResponseType = a.QuestionResponseType, HideorShowQuestion = a.HideorShowQuestion, options = a.options, IsSubmitted = a.IsSubmitted, IsAtVendorLevel = a.IsAtVendorLevel, IsAtSponsorLevel = a.IsAtSponsorLevel }), Note = x.Notes.FirstOrDefault(y => y.UserID == CurrentUserSession.AttendesID.Value && y.EventID == eventID)?.Text, FloorMap = floorMapping != null ? new { floorMapping?.FloorMapping?.ID, FloorName = vendorEvent?.FloorMapLocation?.Location } : null, Activities = x.VendorActivities.Select(y => y.Activite).Select(y => new { y.ID, y.Name, y.StartTime, y.EndTime }), Vendors = x.VendorActivities.SelectMany(y => y.Activite.BookMarks.Select(z => z.Attende)) .Where(y => y.IsSpeaker).Distinct(new AttendeeComparer()). Select(y => new { y.FirstName, y.Lastname, y.TitleName, Thubnail = compressedImageConvertionHandler(y.Thumbnail) }) } }, JsonRequestBehavior.AllowGet)); }