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()
                });
            }
        }
    }
Beispiel #2
0
    protected void Adduser_WL(int SiteID, string Mail, string FullName, int ListID, string sendurl)
    {
        bool               tmp;
        bool               AddUsersToListResult;
        SendMsgResults     _res       = new SendMsgResults();
        SendMsgService     _svc       = new SendMsgService();
        List <SendMsgUser> _UsersList = new List <SendMsgUser>();
        List <SendMsgList> _mailList  = new List <SendMsgList>();

        //_mailList.Add(new SendMsgList() { ExistingListID = ListID, ExistingListIDSpecified = true });
        _mailList.Add(new SendMsgList()
        {
            ExistingListID = 55, ExistingListIDSpecified = true
        });
        _UsersList.Add(new SendMsgUser()
        {
            EmailAddress = Mail, UserSystemFields = new SendMsgFields[4] {
                new SendMsgFields()
                {
                    Key = "שם", Value = FullName
                }, new SendMsgFields()
                {
                    Key = "קישור הרשמה", Value = sendurl
                }, new SendMsgFields()
                {
                    Key = "נרשם דרך מייל", Value = "1"
                }, new SendMsgFields()
                {
                    Key = "מהיכן נרשם", Value = FromToIsender
                }
            }
        });

        _svc.AddUsersToLists(SiteID, true, "IL110077", _UsersList.ToArray(), _mailList.ToArray(), out AddUsersToListResult, out tmp, out _res);
    }
Beispiel #3
0
    protected void Adduser_WL(int SiteID, string Mail, string FullName)
    {
        bool           tmp  = false;
        SendMsgResults _res = new SendMsgResults();
        SendMsgService _svc = new SendMsgService();

        _svc.AddUsersOnly(SiteID, true, "IL110077", new SendMsgUser[]
        {
            new SendMsgUser()
            {
                EmailAddress = Mail, UserSystemFields = new SendMsgFields[2] {
                    new SendMsgFields()
                    {
                        Key = "שם", Value = FullName
                    }, new SendMsgFields()
                    {
                        Key = "נרשם דרך פייסבוק", Value = "1"
                    }
                }
            }
        }, out tmp, out tmp, out _res);
        if (_res.ResultMessage.Contains("Failed:1"))
        {
            using (MySqlConnection conn = new MySqlConnection(cmstrDefualts.ConnStr))
            {
                conn.Open();
                LoginUser.NotAddedToISend(Mail, conn);
            }
        }
    }
Beispiel #4
0
    protected void Adduser_WL(int SiteID, string Mail, string FullName, int ListID)
    {
        bool               tmp;
        bool               AddUsersToListResult;
        SendMsgResults     _res       = new SendMsgResults();
        SendMsgService     _svc       = new SendMsgService();
        List <SendMsgUser> _UsersList = new List <SendMsgUser>();
        List <SendMsgList> _mailList  = new List <SendMsgList>();

        _mailList.Add(new SendMsgList()
        {
            ExistingListID = ListID, ExistingListIDSpecified = true
        });
        _UsersList.Add(new SendMsgUser()
        {
            EmailAddress = Mail, UserSystemFields = new SendMsgFields[1] {
                new SendMsgFields()
                {
                    Key = "שם", Value = FullName
                }
            }
        });

        _svc.AddUsersToLists(SiteID, true, "IL110077", _UsersList.ToArray(), _mailList.ToArray(), out AddUsersToListResult, out tmp, out _res);
    }
Beispiel #5
0
    protected void SignByMailLinkButton_Click(object sender, EventArgs e)
    {
        bool   isExists = false;
        string email    = SendByMailTextBox.Text.Replace("'", "''");

        SendByMailTextBox.Text = "";
        using (MySqlConnection conn = new MySqlConnection(cmstrDefualts.ConnStr))
        {
            conn.Open();
            string          sql = String.Format("Select UserID From tblusers where (EmailAddress='{0}' OR LoginMailAddress='{0}') AND (EmailAddress<>'{1}') ", email, _usermail);
            MySqlCommand    cmd = new MySqlCommand(sql, conn);
            MySqlDataReader dr  = cmd.ExecuteReader();
            if (dr.Read())
            {
                isExists = true;
            }
            dr.Close();
            if (!isExists)
            {
                cmd.CommandText           = String.Format("Update tblusers Set EmailAddress='{0}' , SignInByMail=1 where EmailAddress='{1}'", email, _usermail);
                Session["LoggedUserMail"] = email;
                cmd.ExecuteNonQuery();
                Badge.AddBadge(BadgTypeEnum.Join, conn, Session["LoggedUserMail"].ToString());

                bool           tmp;
                bool           AddUsersToListResult;
                SendMsgService svc = new SendMsgService();

                SendMsgResults     resSendMsgResults = new SendMsgResults();
                List <SendMsgUser> _UsersList        = new List <SendMsgUser>();
                _UsersList.Add(new SendMsgUser()
                {
                    EmailAddress = email, UserSystemFields = new SendMsgFields[2] {
                        new SendMsgFields()
                        {
                            Key = "שם", Value = User_Fullname
                        }, new SendMsgFields()
                        {
                            Key = "נרשם דרך מייל", Value = "1"
                        }
                    }
                });
                svc.AddUsersOnly(5078, true, "IL110077", _UsersList.ToArray(), out tmp, out AddUsersToListResult, out resSendMsgResults);

                Response.Redirect("./");
            }
            else
            {
                maillerror.Text = "mail exists!!!";
            }
        }
    }
Beispiel #6
0
    protected void Adduser_WL(int SiteID, string Mail, string FullName)
    {
        string groupid = "";

        if (Request.Cookies["JoinUsGroup"] != null)
        {
            groupid = Request.Cookies["JoinUsGroup"].Value;
        }

        int groupidInt;

        if (!int.TryParse(groupid, out groupidInt))
        {
            groupidInt = 19;
        }
        bool           tmp  = false;
        bool           tmp2 = false;
        SendMsgResults _res = new SendMsgResults();
        SendMsgService _svc = new SendMsgService();

        List <SendMsgList> _mailList = new List <SendMsgList>();

        List <SendMsgUser> _UsersList = new List <SendMsgUser>();

        _UsersList.Add(new SendMsgUser()
        {
            EmailAddress = Mail, UserSystemFields = new SendMsgFields[2] {
                new SendMsgFields()
                {
                    Key = "שם", Value = FullName
                }, new SendMsgFields()
                {
                    Key = "נרשם דרך פייסבוק", Value = "1"
                }
            }
        });
        _mailList.Add(new SendMsgList()
        {
            ExistingListID = groupidInt, ExistingListIDSpecified = true
        });
        _svc.AddUsersToLists(SiteID, true, "IL110077", _UsersList.ToArray(), _mailList.ToArray(), out tmp2, out tmp, out _res);

        if (_res.ResultMessage.Contains("Failed:1"))
        {
            using (MySqlConnection conn = new MySqlConnection(cmstrDefualts.ConnStr))
            {
                conn.Open();
                LoginUser.NotAddedToISend(Mail, conn);
            }
        }
    }
    protected void btnStartProcedure_Click(object sender, EventArgs e)
    {
        int.TryParse(DDL_DestinationList.SelectedValue, out DestMLID);
        int.TryParse(DDL_OriginalList.SelectedValue, out OriginMLID);


        if (DestMLID != 0 && OriginMLID != 0)
        {
            bool           _t;
            bool           _t2;
            SendMsgUser[]  _users;
            SendMsgResults _res;
            SendMsgService _svc = new SendMsgService();
            _svc.GetMailingListUsers(5078, true, "IL110077", OriginMLID, true, SendMsgUsersRequestType.AllUsers, true, out _t, out _t2, out _users, out _res);
            List <SendMsgUser> _lst = _users.ToList <SendMsgUser>();
            var q = _lst.Where(x => x.DeleteUserSpecified == true).ToList();
            using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr))
            {
                con.Open();
                MySqlCommand cmd = new MySqlCommand();
                cmd.Connection = con;
                foreach (SendMsgUser item in q)
                {
                    cmd.CommandText = "SELECT * from tblusers where EmailAddress='" + item.EmailAddress + "'";
                    MySqlDataReader dr = cmd.ExecuteReader();
                    if (dr.HasRows)
                    {
                        FoundUsersList.Add(item);
                    }
                    dr.Close();
                }
                con.Close();
            }
            foreach (SendMsgUser item in FoundUsersList)
            {
                Adduser_WL(5078, item.EmailAddress, DestMLID);
            }
            Repeater_FoundUsers.DataSource = FoundUsersList;
            Repeater_FoundUsers.DataBind();
            if (FoundUsersList.Count > 0)
            {
                Panel_FoundUsers.Visible = true;
                TotalResults             = FoundUsersList.Count;
            }
        }
        else
        {
            lblStatus.Text = "הייתה בעיה בתהליך, אנא פנה למתכנת";
        }
    }
Beispiel #8
0
 public JsonResult SendValidateCode(string phoneNumber)
 {
     if (phoneNumber.IsNullOrEmpty())
     {
         throw new ArgumentNullException();
     }
     if (SendMsgService.SendValidateCode(phoneNumber))
     {
         return(CustomResult.SuccessMessage("success"));
     }
     else
     {
         return(CustomResult.ErrorMessage("验证码发送失败!"));
     }
 }
Beispiel #9
0
    protected void Adduser_WL(int SiteID, string Mail, string FullName)
    {
        bool           tmp  = false;
        SendMsgResults _res = new SendMsgResults();
        SendMsgService _svc = new SendMsgService();

        _svc.AddUsersOnly(SiteID, true, "IL110077", new SendMsgUser[]
        {
            new SendMsgUser()
            {
                EmailAddress = Mail, UserSystemFields = new SendMsgFields[1] {
                    new SendMsgFields()
                    {
                        Key = "שם", Value = FullName
                    }
                }
            }
        }, out tmp, out tmp, out _res);
    }
Beispiel #10
0
    protected void Adduser_WL(int SiteID, string Mail, string FullName, int ListID, string sendurl)
    {
        bool               tmp;
        bool               AddUsersToListResult;
        SendMsgResults     _res       = new SendMsgResults();
        SendMsgService     _svc       = new SendMsgService();
        List <SendMsgUser> _UsersList = new List <SendMsgUser>();
        List <SendMsgList> _mailList  = new List <SendMsgList>();

        _mailList.Add(new SendMsgList()
        {
            ExistingListID = ListID, ExistingListIDSpecified = true
        });
        //_mailList.Add(new SendMsgList() { ExistingListID = 55, ExistingListIDSpecified = true });
        _UsersList.Add(new SendMsgUser()
        {
            EmailAddress = Mail
        });

        _svc.AddUsersToLists(SiteID, true, "IL110077", _UsersList.ToArray(), _mailList.ToArray(), out AddUsersToListResult, out tmp, out _res);
    }
Beispiel #11
0
    protected void Unnamed_Click(object sender, EventArgs e)
    {
        bool _t;
        bool _t2;

        SendMsgUser[]  _users;
        SendMsgResults _res;
        SendMsgService _svc = new SendMsgService();

        _svc.GetMailingListUsers(5078, true, "IL110077", 17, true, SendMsgUsersRequestType.AllUsers, true, out _t, out _t2, out _users, out _res);
        List <SendMsgUser> _lst = _users.ToList <SendMsgUser>();
        var q = _lst.Where(x => x.DeleteUserSpecified == true).ToList();

        using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr))
        {
            con.Open();
            MySqlCommand _cmd = new MySqlCommand();
            _cmd.Connection = con;
            q.ForEach(p =>
            {
                bool itemExists     = false;
                _cmd.CommandText    = "SELECT * from tblUsers where EmailAddress ='" + p.EmailAddress + "'";
                MySqlDataReader _dr = _cmd.ExecuteReader();
                if (_dr.HasRows)
                {
                    itemExists = true;
                }
                _dr.Close();
                if (!itemExists)
                {
                    _cmd.CommandText = string.Format("INSERT into tblUsers (tblUsers.FullName,tblUsers.EmailAddress,tblUsers.Password) Values('{0}','{1}','{2}')", p.UserSystemFields[0].Value, p.EmailAddress, p.UserSystemFields[1].Value);
                    _cmd.ExecuteNonQuery();
                }
            });

            con.Close();
        }
    }
Beispiel #12
0
        public JsonResult FindPwd(string phoneNumber, string number, string name, string identityNumber, string validateCode)
        {
            string cacheValidateCode = ValidateCodeCache.GetValidateCodeWithExpire(phoneNumber);

            if (cacheValidateCode.IsNullOrEmpty() || !cacheValidateCode.Equals(validateCode))
            {
                return(CustomResult.ErrorMessage("验证码错误或已失效"));
            }

            string newPwd;

            BackMessage backMessage = settingService.FindPassword(number, name, identityNumber, out newPwd);

            if (backMessage.Code == 200)
            {
                SendMsgService.SendNewPassword(phoneNumber, newPwd);
            }

            return(new JsonResult()
            {
                Data = backMessage
            });
        }
Beispiel #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Request.Url.ToString().StartsWith("https://israelikers.org") && !Request.Url.ToString().Contains("localhost:"))
        {
            Response.Redirect("https://israelikers.org" + Request.Url.PathAndQuery);
        }
        else
        {
        }
        if (!string.IsNullOrEmpty(Request.QueryString["lang"]))
        {
            _UserLang = Request.QueryString["lang"].ToString();
        }
        if (!string.IsNullOrEmpty(Request.QueryString["mail"]))
        {
            _Usermail = Request.QueryString["mail"].ToString();
        }
        if (_Usermail == "")
        {
            Panel_Error.Visible = true;
        }
        if (_Usermail != "")
        {
            bool           _userAllowed  = false;
            bool           _userAllowed2 = false;
            SendMsgService _srvc         = new SendMsgService();
            SendMsgList    _lst          = new SendMsgList();
            _srvc.CheckIfUserExistsByMail2(5078, true, _Usermail, out _userAllowed, out _userAllowed2);

            if (!_userAllowed)
            {
                Response.Redirect("./");
            }

            using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr))
            {
                con.Open();
                MySqlCommand _cmd = new MySqlCommand();
                _cmd.Connection  = con;
                _cmd.CommandText = "select * from tblusers where EmailAddress='" + _Usermail + "'";
                MySqlDataReader _dr = _cmd.ExecuteReader();
                if (_dr.HasRows)
                {
                    _UserExists = true;
                }
                _dr.Close();
            }
            if (_UserLang == "")
            {
                _UserLang = "Heb";
            }
            if (!_UserExists)
            {
                switch (_UserLang.ToLower())
                {
                case "heb":
                    Panel_HebReg.Visible = true;
                    ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormHeb.FindControl("txtMail")).Text = _Usermail;
                    MyFormHeb.BackURL = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang;
                    break;

                case "eng":
                    Panel_EngReg.Visible = true;
                    ((ASP.controls_cmstrtextboxcontrol_ascx)MyFormEng.FindControl("txtMail")).Text = _Usermail;
                    MyFormEng.BackURL = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang;
                    break;

                default:
                    break;
                }
            }
            else
            {
                Response.Redirect("FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang);
                if (_UserLang == "Heb")
                {
                    Panel_HebExists.Visible = true;
                    ProceedLinkHeb.HRef     = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang;
                }
                else
                {
                    Panel_EngExists.Visible = true;
                    ProceedLinkEng.HRef     = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang;
                }
            }
            MyFormHeb.BackURL = "FacebookConnect.aspx?mail=" + _Usermail + "&lang=" + _UserLang;
        }
    }
Beispiel #14
0
    public static List <string> GetUserMissions(string UserMail)
    {
        List <string>  MissionList  = new List <string>();
        bool           UsersAllowed = false;
        SendMsgService _svc         = new SendMsgService();
        bool           _t3;
        bool           _t4;
        int            _t;
        bool           _t2;

        SendMsgStatistics[] Messages_List = new SendMsgStatistics[0];
        SendMsgResults      _results;

        //_svc.GetSentMessages(5078, true, "IL110077", out _t, out _t2, out Messages_List, out  _results);
        _svc.GetUserByMail(5078, true, UserMail, out _t, out _t2);//convert mail to UserID on Isend
        if (_t != 0)
        {
            _svc.GetUserMessages(5078, true, "IL110077", _t, true, out _t3, out _t4, out Messages_List, out _results); //Getting User Messages
            List <SendMsgStatistics> _lst = Messages_List.ToList();
            if (_lst.Count > 0)
            {
                using (MySqlConnection con = new MySqlConnection(siteDefaults.ConnStr))
                {
                    con.Open();
                    MySqlCommand cmd = new MySqlCommand();
                    cmd.Connection = con;
                    MySqlDataReader dr;
                    foreach (SendMsgStatistics item in _lst)
                    {
                        bool MsgExists = false;

                        cmd.CommandText = string.Format("SELECT * from tblmission2msgs where MessageID={0}", item.MessageID);
                        dr = cmd.ExecuteReader();
                        if (dr.Read())
                        {
                            MsgExists = true;
                            if (!MissionList.Contains(dr["MissionName"].ToString()))
                            {
                                MissionList.Add(dr["MissionName"].ToString());
                            }
                        }

                        dr.Close();
                        if (!MsgExists)
                        {
                            bool _x1;
                            bool _x2;
                            SendMsgStatistics _tmpMsg;
                            SendMsgResults    _tmpResults;
                            _svc.GetMsgBasicStatistics(5078, true, "IL110077", item.MessageID, true, out _x1, out _x2, out _tmpMsg, out _tmpResults);

                            if (_tmpResults.ResultID == 200)
                            {
                                string _msg     = _tmpMsg.OriginalMessage.MessageContent;
                                Regex  _reg     = new Regex("name=[a-zA-Z0-9\\-]{36}\\&");
                                Match  regMatch = _reg.Match(_msg);
                                if (regMatch != null && regMatch.ToString() != "")
                                {
                                    string missionNameReg = regMatch.ToString().Replace("name=", "").Replace("&", "");
                                    if (missionNameReg != "")
                                    {
                                        cmd.CommandText = "INSERT into tblmission2msgs (MissionName,MessageID) Values ('" + missionNameReg + "','" + item.MessageID + "')";
                                        cmd.ExecuteNonQuery();
                                        if (!MissionList.Contains(missionNameReg))
                                        {
                                            MissionList.Add(missionNameReg);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    con.Close();
                }
            }
        }
        return(MissionList);
    }
Beispiel #15
0
    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)
        {
        }
    }
Beispiel #16
0
    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)
        {
        }
    }
Beispiel #17
0
    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)
        {
        }
    }