protected void zipValBut_Click(object sender, EventArgs e)
    {
        //string Name = GeneralFunc.ToProper(txtContcname.Text).Trim();
        //string Phone = txtphone.Text;
        //string Email = txtemail.Text;
        clsMailFormats format = new clsMailFormats();
        MailMessage msg = new MailMessage();
        if (Session["CustEmail"] != null)
        {
            if (Session["CustEmail"].ToString() != "")
            {
                msg.From = new MailAddress(txtcemail.Text);
                msg.To.Add(Session["CustEmail"].ToString());
                msg.CC.Add("*****@*****.**");
                msg.Bcc.Add(CommonVariable.ArchieveMail);
                msg.Subject = "Regarding Buyer requestbu";
                msg.IsBodyHtml = true;
                string text = string.Empty;

                string Comments = string.Empty;
                if (txtComments.Text == "Enter your message here")
                {
                    Comments = "";
                }
                else
                {
                    Comments = txtComments.Text;
                }

                text = format.SendContactSellar(lblSellerName.Text, zipCode1.Text, txtPhone.Text, txtcemail.Text, GeneralFunc.ToProper(txtfirstName.Text), txtlastName.Text,
                    Comments, ref text, lblYear.Text, lblMake.Text, lblModel.Text, lblPrice.Text);

                msg.Body = text.ToString();

                SmtpClient smtp = new SmtpClient();

                //smtp.Host = "smtp.gmail.com";
                //smtp.Port = 587;
                //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad");
                //smtp.EnableSsl = true;
                //smtp.Send(msg);

                smtp.Host = "127.0.0.1";
                smtp.Port = 25;
                smtp.Send(msg);

                MpeEmail.Hide();

                lblAlertMsg.Text = "Email request sent to seller.";

                mpealert.Show();

                //Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>alert('');</script>");

                Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>hide();</script>");

                Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>pageLoad();</script>");

                BuyerTranBL objBuyerTranBL = new BuyerTranBL();

                bool bSuccess = true;
                String strHostName = HttpContext.Current.Request.UserHostAddress.ToString();
                string strIp = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();

                bSuccess = objBuyerTranBL.SaveBuyerRequest(txtcemail.Text, zipCode1.Text, txtPhone.Text, GeneralFunc.ToProper(txtfirstName.Text),
                    txtlastName.Text, Comments, strIp, lblphone.Text, lblPrice.Text, hdnCarid.Value, "0");

                zipCode1.Text = "Zip or City";

                txtPhone.Text = "my phone number";

                txtcemail.Text = "my email address";

                txtfirstName.Text = "First Name";

                txtlastName.Text = "Last Name";

                txtComments.Text = "Enter your message here";

            }
            else
            {
                Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>alert('Seller Email id doesnot exists');</script>");
            }
        }
    }
Пример #2
0
    public bool SaveBuyerRequestMobile(string BuyerEmail, string BuyerCity,
           string BuyerPhone, string BuyerFirstName, string BuyerLastName, string BuyerComments,
           string IpAddress, string Sellerphone, string Sellerprice, string Carid,
           string sYear, string Make, string Model, string price, string ToEmail, string AuthenticationID, string CustomerID)
    {
        BuyerTranBL objBuyerTranBL = new BuyerTranBL();
        MobileBL objMobileBL = new MobileBL();

        if (CustomerID.Trim() != "")
        {
              string parameters=BuyerPhone+","+Sellerphone+","+Carid;
            DataSet dsSaveCustInfo = objMobileBL.SaveMobileCustomerInfo("SaveBuyerRequestMobile", CustomerID,AuthenticationID,parameters);
        }
        if (AuthenticationID == ConfigurationManager.AppSettings["AppleID"].ToString())
        {
            objBuyerTranBL.SaveBuyerRequestMobile(BuyerEmail, BuyerCity,
               BuyerPhone, BuyerFirstName, BuyerLastName, BuyerComments,
               IpAddress, Sellerphone, Sellerprice, Carid,
                sYear, Make, Model, price, "1", ToEmail);

            return true;
        }
        else
        {
            return false;
        }
    }
    public bool SaveBuyerRequestMobile(string BuyerEmail, string BuyerCity,
          string BuyerPhone, string BuyerFirstName, string BuyerLastName, string BuyerComments,
          string IpAddress, string Sellerphone, string Sellerprice, string Carid,
           string sYear, string Make, string Model, string price, string ToEmail)
    {
        BuyerTranBL objBuyerTranBL = new BuyerTranBL();

        objBuyerTranBL.SaveBuyerRequestMobile(BuyerEmail, BuyerCity,
           BuyerPhone, BuyerFirstName, BuyerLastName, BuyerComments,
           IpAddress, Sellerphone, Sellerprice, Carid,
            sYear, Make, Model, price, "1", ToEmail);

        return true;
    }