private void CreateValidators() { DataAccess = new ContactDataAccess(); var phoneValidator = new PhoneNumberValidator("areaCode.txt"); Validator = new RolodexValidator(phoneValidator); }
public JsonResult Send(string name, string mobile, string email, string address, string message) { var feedback = new Feedback(); feedback.Name = name; feedback.Phone = mobile; feedback.Email = email; feedback.Address = address; feedback.Message = message; feedback.CreatedDate = DateTime.Now; //goi ham InsertFeedback de them feedback vao csdl var id = new ContactDataAccess().InsertFeedback(feedback); if (id > 0) { string content = System.IO.File.ReadAllText(Server.MapPath("~/assets/client/template/newfeedback.html")); content = content.Replace("{{CustomerName}}", name); content = content.Replace("{{Phone}}", mobile); content = content.Replace("{{Email}}", email); content = content.Replace("{{Address}}", address); content = content.Replace("{{Message}}", message); var toEmail = ConfigurationManager.AppSettings["ToEmailAddress"].ToString(); new MailHelper().SendMail(email, "Phản hồi khách hàng từ ShopHoa", content); new MailHelper().SendMail(toEmail, "Phản hồi khách hàng từ ShopHoa", content); return(Json(new { status = true })); //gui mail cho nguoi quan tri } else { return(Json(new { status = false })); } }
public JsonResult Send(string name, string mobile, string email, string address, string content) { var feedback = new FeedBack(); feedback.Name = name; feedback.Phone = mobile; feedback.Email = email; feedback.Address = address; feedback.Content = content; feedback.CreateDate = DateTime.Now; var id = new ContactDataAccess().InsertFeedBack(feedback); if (id > 0) { return(Json(new { status = true })); } else { return(Json(new { status = false })); } }
public DBResponse SaveContact(ContactEntity objContact) { ContactDataAccess objDataAccess = new ContactDataAccess(); return(objDataAccess.SaveContact(objContact)); }
public HttpResponseMessage GetContacts() { List <GetContactsResult> listContacts = new ContactDataAccess().SelectContacts(); return(Request.CreateResponse <List <GetContactsResult> >(HttpStatusCode.OK, listContacts)); }
// GET: Contact public ActionResult Index() { var model = new ContactDataAccess().GetActiveContact(); return(View(model)); }
public ActivityService() { this.cda = new ContactDataAccess(); }
public ContactDataProcessor(ContactDataAccess _contactDataAccess) : base(new ContactRecordFinder(_contactDataAccess), new AlwaysTrueUpdateRuleChecker <Training.Importer.ImportType.Models.Contact, Contact>()) { contactDataAccess = _contactDataAccess; }
public ContactRecordFinder(ContactDataAccess _contactDataAccess) { this.contactDataAccess = _contactDataAccess; }