예제 #1
0
        public bool UserValidatonWithFacebook(string email, bool facebook)
        {
            bool result = false;

            if (facebook)
            {
                using (BaseDB.BaseDataAccess baseDataAccess = new BaseDB.BaseDataAccess())
                {
                    using (BaseDB.BaseAdapter adapter = new BaseDB.BaseAdapter())
                    {
                        BaseCommand cmd = new BaseCommand(baseDataAccess.MsConn);
                        cmd.CommandType       = System.Data.CommandType.Text;
                        cmd.CommandText       = "Select * From gnl_kullanicilar Where email=@email";
                        adapter.SelectCommand = cmd.Command;
                        adapter.SelectCommand.Parameters.AddWithValue("email", email);

                        DataSet userDataSet = new DataSet();
                        adapter.Fill(userDataSet, "Table");

                        userTable = userDataSet.Tables[0];

                        if (userTable.Rows.Count == 1)
                        {
                            result = true;
                        }
                    }
                }
            }


            return(result);
        }
예제 #2
0
        public bool UserValidaton(string email, string passWord)
        {
            using (BaseDB.BaseDataAccess baseDataAccess = new BaseDB.BaseDataAccess())
            {
                using (BaseDB.BaseAdapter adapter = new BaseDB.BaseAdapter())
                {
                    string encriptedPassword = this.EncriptText(passWord);

                    System.Text.Encoding enc = System.Text.Encoding.ASCII;

                    BaseCommand cmd = new BaseCommand(baseDataAccess.MsConn);
                    cmd.CommandType       = System.Data.CommandType.Text;
                    cmd.CommandText       = "Select * From gnl_users Where email=@email And password=@password And is_active = 1";
                    adapter.SelectCommand = cmd.Command;
                    adapter.SelectCommand.Parameters.AddWithValue("email", email);
                    adapter.SelectCommand.Parameters.AddWithValue("password", encriptedPassword);

                    DataSet userDataSet = new DataSet();
                    adapter.Fill(userDataSet, "Table");

                    userTable = userDataSet.Tables[0];

                    return(userTable.Rows.Count == 1);
                }
            }
        }
예제 #3
0
        public bool UserValidatonWithAktivasyonKey(string email, string passWord, string key)
        {
            using (BaseDB.BaseDataAccess baseDataAccess = new BaseDB.BaseDataAccess())
            {
                using (BaseDB.BaseAdapter adapter = new BaseDB.BaseAdapter())
                {
                    string encriptedPassword = this.EncriptText(passWord);

                    System.Text.Encoding enc = System.Text.Encoding.ASCII;
                    byte[] byteArray         = enc.GetBytes(encriptedPassword);

                    BaseCommand cmd = new BaseCommand(baseDataAccess.MsConn);
                    cmd.CommandType       = System.Data.CommandType.Text;
                    cmd.CommandText       = "Select * From gnl_kullanicilar Where email=@email And sifre=@sifre And (aktif = 1 or aktif is null) and aktivasyon_key='" + key + "'";
                    adapter.SelectCommand = cmd.Command;
                    adapter.SelectCommand.Parameters.AddWithValue("email", email);
                    adapter.SelectCommand.Parameters.AddWithValue("sifre", byteArray);

                    DataSet userDataSet = new DataSet();
                    adapter.Fill(userDataSet, "Table");

                    userTable = userDataSet.Tables[0];


                    return(userTable.Rows.Count == 1);
                }
            }
        }
예제 #4
0
        public bool UserValidatonWithUserId(Guid user_id)
        {
            bool result = false;

            using (BaseDB.BaseDataAccess baseDataAccess = new BaseDB.BaseDataAccess())
            {
                using (BaseDB.BaseAdapter adapter = new BaseDB.BaseAdapter())
                {
                    BaseCommand cmd = new BaseCommand(baseDataAccess.MsConn);
                    cmd.CommandType       = System.Data.CommandType.Text;
                    cmd.CommandText       = "Select * From gnl_users Where user_id=@user_id";
                    adapter.SelectCommand = cmd.Command;
                    adapter.SelectCommand.Parameters.AddWithValue("user_id", user_id);

                    DataSet userDataSet = new DataSet();
                    adapter.Fill(userDataSet, "Table");

                    userTable = userDataSet.Tables[0];

                    if (userTable.Rows.Count == 1)
                    {
                        result = true;
                    }
                }
            }


            return(result);
        }