protected void submit_Click(object sender, EventArgs e) { //string con_string = ConfigurationManager.ConnectionStrings["cembs_connectionstring"].ConnectionString; //sqlcon = new SqlConnection(con_string); //sqlcon.Open(); contact = ContactTextBox.Text; if (IsPostBack) { try { if (sendmail() == true) { //Response.Write("<script type='text/javascript'>alert('Thankyou for your interest in CEM Business Solutions. <br/>You can now start your downloads');</script>"); resultLabel.Text = "Thank you for downloading our FAQ document"; QuoteInsertClass myquote = new QuoteInsertClass(); myquote = myclass.insert_quote(name, designation, company, contact, website, email, "", requestdate, formname); Session["visitor"] = NameTextBox.Text; ClientScript.RegisterStartupScript(this.GetType(), "alertwindow", "<script type='text/javascript'>alertwindow('Thank you! Please click on the download link.');</script>"); //Server.Transfer("Index.aspx"); } else { resultLabel.Text = "Mail was not successful"; } } catch (Exception ex) { resultLabel.Text = ex.ToString(); } } }
public QuoteInsertClass insert_quote(string name, string designation, string company, string contact, string website, string email, string message, DateTime requestdate, string formname) { QuoteInsertClass customerDetails = new QuoteInsertClass(); customerDetails.nameField = name; customerDetails.designationField = designation; customerDetails.companyField = company; customerDetails.contactField = contact; customerDetails.websiteField = website; customerDetails.emailField = email; customerDetails.messageField = message; customerDetails.requestdateField = requestdate; customerDetails.formnameField = formname; db.proc_ins_quote(name, designation, company, contact, website, email, message, requestdate, formname); //var savedata = db.proc_ins_quote(customerDetails.nameField , customerDetails.designationField , customerDetails.companyField , customerDetails.contactField , customerDetails.websiteField , customerDetails.emailField , customerDetails.messageField , customerDetails.requestdateField , customerDetails.formnameField); //db.Request_quotes.InsertOnSubmit(customerDetails); db.SubmitChanges(); return customerDetails; }
//protected void submit_Click(object sender , EventArgs e) //{ // //string con_string = ConfigurationManager.ConnectionStrings["cembs_connectionstring"].ConnectionString; // contact = ContactTextBox.Text; // if (IsPostBack) // { // try // { // if (sendmail() == true) // { // resultLabel.Text = "Registration successful.<br/>Thankyou for showing interest."; // QuoteService myquote = new QuoteService(); // myquote = objserviceClient.insert_quote(name , designation , company , contact , website , email , message , requestdate , formname); // } // else // { // resultLabel.Text = "Mail was not successful"; // } // } // catch (Exception ex) // { // resultLabel.Text = ex.ToString(); // } // } //} protected void submit_Click(object sender , EventArgs e) { //string con_string = ConfigurationManager.ConnectionStrings["cembs_connectionstring"].ConnectionString; contact = ContactTextBox.Text; if (IsPostBack) { try { if (sendmail() == true) { resultLabel.Text = "Registration successful.<br/>Thankyou for showing interest."; QuoteInsertClass myquote = new QuoteInsertClass(); myquote = myclass.insert_quote(name , designation , company , contact , website , email , message , requestdate , formname); resetvalues(); } else { resultLabel.Text = "Mail was not successful"; } } catch (Exception ex) { resultLabel.Text = ex.ToString(); } } }