protected void Page_Load(object sender, EventArgs e) { bool _t; bool _t2; SendMsgResults _res; SendMsgList[] _lists; SendMsgService _svc = new SendMsgService(); _svc.GetMailingListNames(5078, true, "IL110077", out _t, out _t2, out _lists, out _res); List <SendMsgList> _sendMsgLists = _lists.ToList(); if (!IsPostBack) { foreach (SendMsgList item in _lists) { DDL_DestinationList.Items.Add(new ListItem() { Text = item.ExistingListID.ToString() + " - " + item.NewListDescription, Value = item.ExistingListID.ToString() }); DDL_OriginalList.Items.Add(new ListItem() { Text = item.ExistingListID.ToString() + " - " + item.NewListDescription, Value = item.ExistingListID.ToString() }); } } }
protected void Login_Click(object sender, EventArgs e) { bool _userExists_onIL = false; bool _userExists_onWL = false; bool _userExists_onWL2 = false; bool _maillingListExists = false; bool _maillingListExistsRes; bool isSignIn = false; try { using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr)) { //Checking if mail is Existing on I-Send under UserID 5078 #region Check if user\mail exists on WL SendMsgService _svc = new SendMsgService(); _svc.CheckIfUserExistsByMail2(5078, true, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text, out _userExists_onWL, out _userExists_onWL2); #endregion //Checking if MailingList Exists on WL #region Check if Mail List Exists on WL SendMsgList[] _mailList; SendMsgResults _tt; // Get mailing lists _svc.GetMailingListNames(5078, true, "IL110077", out _maillingListExistsRes, out _maillingListExistsRes, out _mailList, out _tt); var SignInML = _mailList.ToList <SendMsgList>().FirstOrDefault(x => x.ExistingListID == 55); if (SignInML == null) { isSignIn = true; } if (GrpID != 0) { var q = _mailList.ToList <SendMsgList>().FirstOrDefault(x => x.ExistingListID == GrpID); if (q != null && q.ExistingListID != 0) { _maillingListExists = true; } } #endregion //Checking if User\Mail existing in Israelikers.org #region Check if user\mail exists on Israelikers.org con.Open(); MySqlCommand _cmd = new MySqlCommand(); _cmd.Connection = con; _cmd.CommandText = string.Format(" SELECT UserID from tblUsers where LoginMailAddress='{0}' OR EmailAddress ='{0}'", ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text.Replace("'", "''")); MySqlDataReader _dr = _cmd.ExecuteReader(); if (_dr.HasRows) { _userExists_onIL = true; } _dr.Close(); con.Close(); #endregion } //acting time: if (!_userExists_onIL) { MyFormHeb.IsInsertRedirect = false; string myguid = Guid.NewGuid().ToString(); ((CMSTRHiddenField)MyFormHeb.FindControl("GuidMyHiddenField")).Value = myguid; ((CMSTRHiddenField)MyFormHeb.FindControl("SignByMailMyHiddenField")).Value = "true"; // save data MyFormHeb.CalldoClick(); if (!isSignIn) { string regurl = siteDefaults.SiteUrl + "/login.aspx?guid=" + myguid + "&grp=" + (GrpID == 0 || !_maillingListExists ? 19 : GrpID); Adduser_WL(5078, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text, GrpID == 0 || !_maillingListExists ? 19 : GrpID, regurl); } //Session["Logged"] = "true"; //Session["LoggedMail"] = ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text; using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr)) { con.Open(); MySqlCommand cmd = new MySqlCommand(); cmd.Connection = con; if (!string.IsNullOrEmpty(Request.QueryString["Sender"])) { cmd.CommandText = String.Format("INSERT into tbljoinregisters (MissionName,CreationDate,GrpID,EmailAddress,FullName,Refferer) Values ('{0}',now(),'{1}','{2}','{3}','{4}')", MissionName, GrpID, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text.Replace("'", "''"), ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text.Replace("'", "''"), Request.QueryString["Sender"]); } else { cmd.CommandText = String.Format("INSERT into tbljoinregisters (MissionName,CreationDate,GrpID,EmailAddress,FullName) Values ('{0}',now(),'{1}','{2}','{3}')", MissionName, GrpID, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text.Replace("'", "''"), ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text.Replace("'", "''")); } cmd.ExecuteNonQuery(); con.Close(); } Response.Redirect("joinusend.aspx?mail=" + ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text); } else { lblRegisterStatus.Text = "* User Already Exists"; } } catch (Exception ex) { } }
protected void LinkButton1_Click(object sender, EventArgs e) { bool _userExists_onIL = false; bool _userExists_onWL = false; bool _userExists_onWL2 = false; bool _maillingListExists = false; bool _maillingListExistsRes; try { using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr)) { //Checking if mail is Existing on I-Send under UserID 5078 #region Check if user\mail exists on WL SendMsgService _svc = new SendMsgService(); _svc.CheckIfUserExistsByMail2(5078, true, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text, out _userExists_onWL, out _userExists_onWL2); #endregion //Checking if MailingList Exists on WL #region Check if Mail List Exists on WL SendMsgList[] _mailList; SendMsgResults _tt; if (GrpID != 0) { _svc.GetMailingListNames(5078, true, "IL110077", out _maillingListExistsRes, out _maillingListExistsRes, out _mailList, out _tt); var q = _mailList.ToList <SendMsgList>().FirstOrDefault(x => x.ExistingListID == GrpID); if (q != null && q.ExistingListID != 0) { _maillingListExists = true; } } #endregion //Checking if User\Mail existing in Israelikers.org #region Check if user\mail exists on Israelikers.org con.Open(); MySqlCommand _cmd = new MySqlCommand(); _cmd.Connection = con; _cmd.CommandText = " SELECT * from tblUsers where EmailAddress ='" + ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text + "'"; MySqlDataReader _dr = _cmd.ExecuteReader(); if (_dr.HasRows) { _userExists_onIL = true; } _dr.Close(); con.Close(); #endregion } //acting time: if (!_userExists_onIL) { MyFormHeb.IsInsertRedirect = false; MyFormHeb.CalldoClick(); if (!_userExists_onWL) { Adduser_WL(5078, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text, GrpID == 0 || !_maillingListExists ? 19 : GrpID); } Session["Logged"] = "true"; Session["LoggedMail"] = ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text; using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr)) { con.Open(); MySqlCommand cmd = new MySqlCommand(); cmd.Connection = con; cmd.CommandText = "INSERT into tbljoinregisters (MissionName,CreationDate,GrpID,EmailAddress,FullName) Values ('" + MissionName + "',now(),'" + GrpID + "','" + ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text + "','" + ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text + "')"; cmd.ExecuteNonQuery(); con.Close(); } Response.Redirect("FacebookConnect.aspx?mail=" + ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text); } else { lblRegisterStatus.Text = "User Already Exists"; } } catch (Exception ex) { } }
protected void Login_Click(object sender, EventArgs e) { bool _userExists_onIL = false; bool _userExists_onWL = false; bool _userExists_onWL2 = false; bool _maillingListExists = false; bool _maillingListExistsRes; bool isSignIn = false; try { using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr)) { //Checking if mail is Existing on I-Send under UserID 5078 #region Check if user\mail exists on WL SendMsgService _svc = new SendMsgService(); _svc.CheckIfUserExistsByMail2(5078, true, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text, out _userExists_onWL, out _userExists_onWL2); #endregion //Checking if MailingList Exists on WL #region Check if Mail List Exists on WL SendMsgList[] _mailList; SendMsgResults _tt; // Get mailing lists _svc.GetMailingListNames(5078, true, "IL110077", out _maillingListExistsRes, out _maillingListExistsRes, out _mailList, out _tt); var SignInML = _mailList.ToList <SendMsgList>().FirstOrDefault(x => x.ExistingListID == 55); if (SignInML == null) { isSignIn = true; } if (GrpID != 0) { var q = _mailList.ToList <SendMsgList>().FirstOrDefault(x => x.ExistingListID == GrpID); if (q != null && q.ExistingListID != 0) { _maillingListExists = true; } } #endregion //Checking if User\Mail existing in Israelikers.org #region Check if user\mail exists on Israelikers.org con.Open(); MySqlCommand _cmd = new MySqlCommand(); _cmd.Connection = con; _cmd.CommandText = string.Format(" SELECT UserID from tblUsers where LoginMailAddress='{0}' OR EmailAddress ='{0}'", ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text.Replace("'", "''")); MySqlDataReader _dr = _cmd.ExecuteReader(); if (_dr.HasRows) { _userExists_onIL = true; } _dr.Close(); con.Close(); #endregion } //acting time: if (!_userExists_onIL) { MyFormHeb.IsInsertRedirect = false; string myguid = Guid.NewGuid().ToString(); ((CMSTRHiddenField)MyFormHeb.FindControl("GuidMyHiddenField")).Value = myguid; ((CMSTRHiddenField)MyFormHeb.FindControl("SignByMailMyHiddenField")).Value = "true"; // save data MyFormHeb.CalldoClick(); if (!isSignIn) { string regurl = siteDefaults.SiteUrl + "/login.aspx?guid=" + myguid + "&grp=" + (GrpID == 0 || !_maillingListExists ? 19 : GrpID); Adduser_WL(5078, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text, GrpID == 0 || !_maillingListExists ? 19 : GrpID, regurl); if (!String.IsNullOrEmpty(Request.QueryString["special"]) && Request.QueryString["special"] == "true") { string SanFransiscoUrl = "https://panel.i-send.co.il/AddUserFromSite.aspx?eMail=" + ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text.Replace("'", "''") + "&1=" + ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text.Replace("'", "''") + "&4=0&5=1&form=6557__d9fda905-f5aa-49ae-b6a6-e186f1f4613d"; HttpWebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create(SanFransiscoUrl); //setting an httpWebRequest with the URL of the API webRequest.Method = "GET"; //the type of method the API returns webRequest.Timeout = 20000; //sets the timeout for the request webRequest.ContentType = "application/x-www-form-urlencoded"; //the content type. most of the times it will be application/x-www-form-urlencoded string responseData = ""; try { StreamReader MyStream = new StreamReader(webRequest.GetResponse().GetResponseStream()); //creating a stream reader to read the results from the API responseData = MyStream.ReadToEnd(); //reading the result from the API into a string } catch (Exception ex) { } } } //Session["Logged"] = "true"; //Session["LoggedMail"] = ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text; using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr)) { con.Open(); MySqlCommand cmd = new MySqlCommand(); cmd.Connection = con; if (!string.IsNullOrEmpty(Request.QueryString["Sender"])) { cmd.CommandText = String.Format("INSERT into tbljoinregisters (MissionName,CreationDate,GrpID,EmailAddress,FullName,Refferer) Values ('{0}',now(),'{1}','{2}','{3}','{4}')", MissionName, GrpID, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text.Replace("'", "''"), ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text.Replace("'", "''"), Request.QueryString["Sender"]); } else { cmd.CommandText = String.Format("INSERT into tbljoinregisters (MissionName,CreationDate,GrpID,EmailAddress,FullName) Values ('{0}',now(),'{1}','{2}','{3}')", MissionName, GrpID, ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text.Replace("'", "''"), ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtFullName")).Text.Replace("'", "''")); } cmd.ExecuteNonQuery(); con.Close(); } Response.Redirect("joinusend.aspx?mail=" + ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text); } else { if (Request.QueryString != null && Request.QueryString["Exists"] != null && Request.QueryString["Exists"] == "true") { Response.Redirect(Request.AppRelativeCurrentExecutionFilePath + "?" + Request.QueryString + "#Header"); } Response.Redirect(Request.AppRelativeCurrentExecutionFilePath + "?Exists=true&" + Request.QueryString + "#Header"); } } catch (Exception ex) { } }