public ActionResult Index() { var data = new ViewModel(); data.ContentPage = Models.Page.LoadOrCreatePageCode("ContactUs"); if (data.ContentPage == null) { throw new Exception("Contact Us page not found"); } var companyDetail = Models.CompanyDetail.Load(new Sql("Select Top 1 * from CompanyDetail")); if (companyDetail == null) { companyDetail = new CompanyDetail(); companyDetail.Address = "Lorem ipsum dolor sit amet"; companyDetail.DateAdded = DateTime.Now; companyDetail.Email = "*****@*****.**"; companyDetail.Latitude = 41.4395; companyDetail.Longitude = 72.1936; companyDetail.Phone = "00-0000000-00"; companyDetail.Title = "Lorem ipsum dolor sit amet"; companyDetail.Save(); } data.CompanyDetails = companyDetail; data.ContactUsTextBlock = TextBlockCache.GetRich("Contact Us Text", ""); data.ContactDetails = new ContactUs(); return(View("ContactUs", data)); }
public ActionResult SubmitEntry(string auth, bool wantsToJoin) { if (!ValidateAuthToken(auth)) { return(Json(new { kind = "display", text = "Sorry, your session has timed out. Please refresh the page and try again." })); } var c = new CompetitionEntry(); c.UpdateFromRequest(); c.UserIPAddress = Security.UserIpV4Address(); c.Save(); string thanksGeneral = TextBlockCache.GetRich("Competition Thanks - General").BodyTextHtml; return(Json(new { kind = "display", text = thanksGeneral })); }
public ActionResult SendComment(int?auctionID, int?buyNowID, string name, string email, string comment, string auth, int?parentID, string optin) { if (!ValidateAuthToken(auth)) { return(Content("Sorry, your session has timed out. Please refresh the page and try again.")); } var c = new Comment(); //c.UpdateFromRequest(); //MK why UpdateFromRequest? all values are passed in as parameters right? c.CommentText = comment; c.CommentDate = DateTime.Now; c.Status = Comment.CommentStatus.Submitted.ToString(); // c.AuctionID = auctionID; // c.BuyNowItemID = buyNowID; c.CommenterIP = Security.UserIpV4Address(); c.ParentCommentID = parentID; c.PersonType = Comment.CommentPersonType.Member.ToString(); if (Security.IsLoggedIn) { var p = Person.LoadByPersonID(Security.LoggedInUserID); /*if (p.Role == SecurityRoles.Roles.MODERATOR) { * // a moderator * c.PersonType = Comment.CommentPersonType.Moderator.ToString(); * } */ //c.CommenterName = p.UserName; c.CommenterEmail = p.Email; c.PersonID = p.ID; } else { c.CommenterName = name.Trim(); c.CommenterEmail = email; } c.Save(); if (optin == "true") { //Beweb.SiteCustom.MailChimp.Subscribe(c.CommenterEmail, Person.GetFirstName(c.CommenterName), Person.GetLastName(c.CommenterName), "", ""); } Models.TextBlock thanksTextBlock = TextBlockCache.GetRich("CommentThankYou"); return(View("CommentThankYou", thanksTextBlock)); }