Exemple #1
0
        private void CreateValidators()
        {
            DataAccess = new ContactDataAccess();
            var phoneValidator = new PhoneNumberValidator("areaCode.txt");

            Validator = new RolodexValidator(phoneValidator);
        }
Exemple #2
0
        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
                }));
            }
        }
Exemple #3
0
        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));
        }
Exemple #6
0
        // GET: Contact
        public ActionResult Index()
        {
            var model = new ContactDataAccess().GetActiveContact();

            return(View(model));
        }
 public ActivityService()
 {
     this.cda = new ContactDataAccess();
 }
Exemple #8
0
 public ContactDataProcessor(ContactDataAccess _contactDataAccess) : base(new ContactRecordFinder(_contactDataAccess), new AlwaysTrueUpdateRuleChecker <Training.Importer.ImportType.Models.Contact, Contact>())
 {
     contactDataAccess = _contactDataAccess;
 }
 public ActivityService()
 {
     this.cda = new ContactDataAccess();
 }
Exemple #10
0
 public ContactRecordFinder(ContactDataAccess _contactDataAccess)
 {
     this.contactDataAccess = _contactDataAccess;
 }