protected void imgBtnSubmit_Click(object sender, ImageClickEventArgs e) { if (ValidateFields()) { string emailContents = null; CallMeTableAdapters.CallMeTableAdapter ta = new CallMeTableAdapters.CallMeTableAdapter(); CallMeTableAdapters.CallMeProductTableAdapter prodTA = new CallMeTableAdapters.CallMeProductTableAdapter(); IEnumerator ie = ta.InsertAndReturn(txtFirstName.Text, txtSurName.Text, txtTelephone.Text, txtMobile.Text, txtEmail.Text, txtCompanyName.Text, txtCompanyWebsite.Text, txtPostalAddress.Text, txtPostCode.Text, txtComments.Text, viewDemo,(Request[WebConstants.Request.RECEIVE_EMAILS] != "")? true : false ).GetEnumerator(); if (ie.MoveNext()) { CallMe.CallMeEntityRow callMe = (CallMe.CallMeEntityRow)ie.Current; emailContents = GetEmailContent(callMe); if (cbHS.Selected) { prodTA.Insert(callMe.call_me_id, "Simplicity H&S Live"); emailContents += "<B> Product: </B>Simplicity H&S Live<BR/>"; } if (cbHandyGas.Selected) { prodTA.Insert(callMe.call_me_id, "SimplicityHandyGas"); emailContents += "<B> Product: </B>SimplicityHandyGas<BR/>"; } if (cbHandyLEC.Selected) { prodTA.Insert(callMe.call_me_id, "SimplicityHandyLEC"); emailContents += "<B> Product: </B>SimplicityHandyLEC<BR/>"; } if (cbHandyServe.Selected) { prodTA.Insert(callMe.call_me_id, "SimplicityHandyServe"); emailContents += "<B> Product: </B>SimplicityHandyServe<BR/>"; } if (cbEAS.Selected) { prodTA.Insert(callMe.call_me_id, "SimplicityEAS"); emailContents += "<B> Product: </B>SimplicityEAS<BR/>"; } } if (ViewDemo) { Session[WebConstants.Session.VIEW_DEMO] = true; EmailUtility.SendViewDemoEmailToUser(txtEmail.Text); EmailUtility.SendViewDemoEmailToAdmin(emailContents); Response.Redirect("~/pages/WatchDemo.aspx"); } else { lblInfoMessage.Visible = true; EmailUtility.SendCallMeEmailToAdmin(emailContents); EmailUtility.SendCallMeEmailToUser(txtEmail.Text); Response.Redirect("~/pages/RequestSubmitted.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { CallMeTableAdapters.CallMeTableAdapter ta = new CallMeTableAdapters.CallMeTableAdapter(); gvList.DataSource = ta.GetAllRecords(IsViewDemo); gvList.DataBind(); }