public ActionResult List(string preLoaded) { var page = 1; var pageAmount = 20; var sortDirection = -1; var listState = State.GetCollection(); var listCity = Address.GetCities(); var pagedListShowcaseItem = new PagedList <ShowcaseItem>(new List <ShowcaseItem>(), page, pageAmount, 0, 0); if (string.IsNullOrEmpty(preLoaded)) { pagedListShowcaseItem = ShowcaseItem.GetCollection(null, null, null, null, null, null, null, null, null, null, sortDirection, null, page, pageAmount, null); } var showcaseItemTags = new string[0]; this.ViewBag.PagedListShowcaseItem = pagedListShowcaseItem; this.ViewBag.ListState = listState; this.ViewBag.ListCity = listCity; this.ViewBag.ShowcaseItemTags = showcaseItemTags; this.ViewBag.SortDirection = sortDirection; this.ViewBag.Page = page; this.ViewBag.PageAmount = pageAmount; return(this.View()); }
/// <summary> /// /// </summary> /// <returns></returns> public ActionResult VirtualMagazine() { PagedList <ShowcaseItem> pagedListShowcaseItem = ShowcaseItem.GetCollection(1, 6); this.ViewBag.PagedListShowcaseItem = pagedListShowcaseItem; return(this.View()); }
public ShowcaseItemModel(ShowcaseItem showcaseEntity) { Entity = showcaseEntity; SellPrice = CalcPrice(); Discount = CalcDiscount(); Dessert = new DessertModel(showcaseEntity.Dessert); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Listing(long id) { var agent = Agent.Get(id); var listShowcaseItem = ShowcaseItem.GetCollectionByAgent(id); this.ViewBag.Agent = agent; this.ViewBag.ListShowcaseItem = listShowcaseItem; return(this.View()); }
/// <summary> /// (Debug View Only) /// </summary> /// <returns></returns> public ActionResult Home2() { var listFeaturedShowcaseItem = ShowcaseItem.GetCollection(1, true); var listState = State.GetCollection(); var listCity = Address.GetCities(); this.ViewBag.ListFeaturedShowcaseItem = listFeaturedShowcaseItem; this.ViewBag.ListState = listState; this.ViewBag.ListCity = listCity; return(this.View()); }
/// <summary> /// Displays a specific showcase item (property) /// </summary> /// <param name="Id">The Id of the showcase item.</param> /// <returns></returns> public ActionResult Index(long Id) { var showcaseItem = ShowcaseItem.Get(Id); var listShowcaseMedia = ShowcaseMedia.GetCollection(showcaseItem.ShowcaseItemId, true); var listAgent = Agent.GetCollectionByTeam(showcaseItem.TeamId); this.ViewBag.ShowcaseItem = showcaseItem; this.ViewBag.ListShowcaseMedia = listShowcaseMedia; this.ViewBag.ListAgent = listAgent; return(this.View()); }
public ActionResult List(int?stateId, string city, double?listPriceMin, double?listPriceMax, int?bedsMin, int?bedsMax, int?bathsMin, int?bathsMax, string genericFilter, int?page, int?pageAmount, int?sortDirection, string sortBy, string[] showcaseItemTags) { page = page ?? 1; pageAmount = pageAmount ?? 20; sortDirection = sortDirection ?? -1; var pagedListShowcaseItem = ShowcaseItem.GetCollection(stateId, city, listPriceMin, listPriceMax, bedsMin, bedsMax, bathsMin, bathsMax, genericFilter, sortBy, sortDirection.Value, null, page, pageAmount, showcaseItemTags); var listState = State.GetCollection(); var listCity = Address.GetCities(); showcaseItemTags = showcaseItemTags ?? new string[0]; this.ViewBag.PagedListShowcaseItem = pagedListShowcaseItem; this.ViewBag.ListState = listState; this.ViewBag.ListCity = listCity; this.ViewBag.StateId = stateId; this.ViewBag.City = city; this.ViewBag.ListPriceMin = listPriceMin; this.ViewBag.ListPriceMax = listPriceMax; this.ViewBag.BedsMin = bedsMin; this.ViewBag.BedsMax = bedsMax; this.ViewBag.BathsMin = bathsMin; this.ViewBag.BathsMax = bathsMax; this.ViewBag.GenericFilter = genericFilter; this.ViewBag.ShowcaseItemTags = showcaseItemTags; this.ViewBag.SortBy = sortBy; this.ViewBag.SortDirection = sortDirection; this.ViewBag.Page = page; this.ViewBag.PageAmount = pageAmount; return(this.View()); }
public void DeleteShowcaseItem(ShowcaseItem showcaseItem) => _pastryDbContext.ShowcaseItems.Remove(showcaseItem);
public ShowcaseItem AddShowcaseItem(ShowcaseItem showcaseItem) { _pastryDbContext.ShowcaseItems.Add(showcaseItem); return(showcaseItem); }
public static void SendSubmissionEmail(Contact contactEntity, ContactTypes contactFormType) { string toAddress = contactFormType == ContactTypes.ContactUs ? Settings.ContactSubmissionEmailAddress : contactFormType == ContactTypes.HomeValuationRequest ? Settings.HomeValuationEmailAddress : Settings.MaintenanceRequestEmailAddress; string templatePath = contactFormType == ContactTypes.ContactUs ? EmailTemplates.ContactSubmission : contactFormType == ContactTypes.HomeValuationRequest ? EmailTemplates.HomeValuation : EmailTemplates.MaintenanceRequest; string propertyInfo = string.Empty; string microsite = string.Empty; ShowcaseItem showcaseItem = null; if (contactEntity.ShowcaseItemID.HasValue) { showcaseItem = Classes.Showcase.ShowcaseItem.GetByID(contactEntity.ShowcaseItemID.Value, new string[] { "Agent", "Showcase.CMMicrosite", "Team", "Address" }); if (showcaseItem.AgentID.HasValue) { toAddress = showcaseItem.Agent.Email; } else if (showcaseItem.TeamID.HasValue) { toAddress = showcaseItem.Team.Email; } else { toAddress = Classes.Contacts.Settings.DefaultAgentContactEmail; } templatePath = EmailTemplates.PropertyInfoRequest; propertyInfo = showcaseItem.Address.FormattedAddress + (showcaseItem.MlsID.HasValue ? "<br />MLS ID #" + showcaseItem.MlsID : ""); microsite = showcaseItem.Showcase.CMMicrosite.Name.ToLower().Replace(" ", "-"); } else if (contactEntity.AgentID.HasValue) { Classes.Media352_MembershipProvider.User agent = Classes.Media352_MembershipProvider.User.GetByID(contactEntity.AgentID.Value, new[] { "UserOffice.Office" }); if (agent.UserOffice != null && agent.UserOffice.Any(o => o.Office != null && o.Office.Active)) { toAddress = agent.Email; } else { toAddress = Classes.Contacts.Settings.DefaultAgentContactEmail; } templatePath = EmailTemplates.ContactAgentSubmission; } else if (contactEntity.TeamID.HasValue) { Classes.Media352_MembershipProvider.Team team = Classes.Media352_MembershipProvider.Team.GetByID(contactEntity.TeamID.Value); toAddress = team.Email; templatePath = EmailTemplates.ContactAgentSubmission; } if (string.IsNullOrWhiteSpace(toAddress)) { return; } string contactMethodName = ContactMethod.GetByID(contactEntity.ContactMethodID).Name; MailMessage email = new MailMessage(); email.IsBodyHtml = true; email.From = new MailAddress(Globals.Settings.FromEmail); //TODO: Remove this when done testing. Put in place to prevent spamming of meybohm agents if (System.Web.HttpContext.Current.IsDebuggingEnabled && toAddress.ToLower().EndsWith("@meybohm.com")) { toAddress = "*****@*****.**"; } email.To.Add(toAddress); if (contactFormType == ContactTypes.PropertyInformation && toAddress != Settings.PropertyInfoCCEmailAddress) { email.CC.Add(Settings.PropertyInfoCCEmailAddress); } else if (contactFormType == ContactTypes.Agent && toAddress != Settings.AgentContactCCEmailAddress) { email.CC.Add(Settings.AgentContactCCEmailAddress); } Classes.StateAndCountry.Address addressEntity = null; if (contactEntity.AddressID.HasValue) { addressEntity = Classes.StateAndCountry.Address.GetByID(contactEntity.AddressID.Value, new string[] { "State" }); } email.Body = EmailTemplateService.HtmlMessageBody(templatePath, new { FirstName = contactEntity.FirstName, LastName = contactEntity.LastName, Address1 = (addressEntity != null ? addressEntity.Address1 : string.Empty), Address2 = (addressEntity != null ? addressEntity.Address2 : string.Empty), City = (addressEntity != null ? addressEntity.City : string.Empty), State = (addressEntity != null ? addressEntity.State.Name : string.Empty), Zip = (addressEntity != null ? addressEntity.Zip : string.Empty), Message = contactEntity.Message, ContactMethod = contactMethodName, Email = contactEntity.Email, PhoneOrEmail = (contactEntity.ContactMethodID == (int)ContactMethods.Email ?"": "Phone: " + contactEntity.Phone), ContactTime = ContactTime.GetByID(contactEntity.ContactTimeID).Name, PropertyInfo = propertyInfo, Microsite = microsite }); string subjectText = contactEntity.ShowcaseItemID.HasValue ? "Property Information Request" : contactFormType == ContactTypes.ContactUs ? "Contact Form Submission" : contactFormType == ContactTypes.HomeValuationRequest ? "Home Valuation Request" : contactFormType == ContactTypes.MaintenanceRequest ? "Maintenance Request" : "Contact Agent Submission"; if (showcaseItem != null) { if (showcaseItem.ShowcaseID == (int)MeybohmShowcases.AugustaRentalHomes || showcaseItem.ShowcaseID == (int)MeybohmShowcases.AikenRentalHomes) { subjectText += " - Lease"; } } email.Subject = Globals.Settings.SiteTitle + " - " + subjectText; // Apply MLS ID and address information to the subject line if this is a property information // request. if (showcaseItem != null && (showcaseItem.MlsID != null || showcaseItem.Address != null)) { string subjectDetails = "["; if (showcaseItem.MlsID != null) { subjectDetails += showcaseItem.MlsID; } if (showcaseItem.MlsID != null && showcaseItem.Address != null) { subjectDetails += " - "; } if (showcaseItem.Address != null) { subjectDetails += showcaseItem.Address.Address1; } subjectDetails += "] Property Information Request"; if (showcaseItem.ShowcaseID == (int)MeybohmShowcases.AugustaRentalHomes || showcaseItem.ShowcaseID == (int)MeybohmShowcases.AikenRentalHomes) { subjectDetails += " - Lease"; } email.Subject = subjectDetails; } SmtpClient smtp = new SmtpClient(); smtp.Send(email); }