Esempio n. 1
0
        public ETO.Contact ReceiveHtml()
        {


            ETO.Contact contact = new ETO.Contact();
            contact.ContactID = 0;

            contact.Email = Email.Value.Trim();
            contact.Name = NameContact.Value.Trim();
            contact.Address = Address.Value.Trim();
            contact.Tel = Telephone.Value.Trim();
            contact.Fax = Fax.Value.Trim();

            contact.City = City.Value.Trim();
            contact.Company = Company.Value.Trim();


            contact.Date = DateTime.Now;


            contact.Attact = "";

            contact.Require = Require.Value;

            return contact;
        }
Esempio n. 2
0
        public void Check_SendMail(Contact contact)
        {
            string host = Request.Url.Host.ToLower();
            int port = Request.Url.Port;
            string subject = "Giải đáp câu hỏi " + host;
            if (port != 0)
            {
                host += ":" + port.ToString();
            }

            string body = "   Chào bạn <b>" + contact.Name + "</b>, <p>Câu hỏi " + contact.Require + " của bạn đã có câu trả lời:  </p>" + txtAnswer.Text.ToString();
            SendMail(contact.Email, subject, body);
        }
Esempio n. 3
0
        public Contact ReceiveHtml()
        {
            Contact contact = new Contact();
            contact.ContactID = (hddContactID.Value != "") ? Convert.ToInt32(hddContactID.Value) : 0;

            contact.Email = (txtEmail.Text != "") ? txtEmail.Text.Trim() : "";
            contact.Name = (txtName.Text != "") ? txtName.Text.Trim() : "";
            contact.Address = (txtAddress.Text != "") ? txtAddress.Text.Trim() : "";
            contact.Tel = (txtTel.Text != "") ? txtTel.Text.Trim() : "";
            contact.Fax = (txtFax.Text != "") ? txtFax.Text.Trim() : "";

            contact.City = (txtCity.Text != "") ? txtCity.Text.Trim() : "";
            contact.Company = (txtCompany.Text != "") ? txtCompany.Text.Trim() : "";


            contact.Date = new DateTime(Convert.ToInt16(cboYear1.SelectedValue),
                                        Convert.ToInt16(cboMonth1.SelectedValue),
                                        Convert.ToInt16(cboDay1.SelectedValue),
                                        Convert.ToInt16(cboHour1.SelectedValue),
                                        Convert.ToInt16(cboMinutes1.SelectedValue), 0);


            contact.Attact = "";
            contact.Require = txtRequire.Value;
            contact.Answer = txtAnswer.Text.Trim();
            if (chkSendMail.Checked == true)
            {
                contact.Sendmail = true;
            }
            else
            {
                contact.Sendmail = false;
            }
            return contact;
        }