private void Refresh()
        {
            StudentRegTxt.Clear();
            NameTxt.Clear();
            SurnameTxt.Clear();
            GenderCmb.ResetText();
            CellNTxt.Clear();
            EmailTxt.Clear();
            Postaltxt.ResetText();
            CourseCmb.ResetText();
            Statuscmb.ResetText();
            SemesterCmb.ResetText();
            dataGridView1.DataSource = DataAccess.GetStudents();

            dataGridView1.Columns["ID"].DisplayIndex            = 0;
            dataGridView1.Columns["Name"].DisplayIndex          = 1;
            dataGridView1.Columns["Surname"].DisplayIndex       = 2;
            dataGridView1.Columns["Gender"].DisplayIndex        = 3;
            dataGridView1.Columns["Cell"].DisplayIndex          = 4;
            dataGridView1.Columns["Email"].DisplayIndex         = 5;
            dataGridView1.Columns["PostalAddress"].DisplayIndex = 6;
            dataGridView1.Columns["CourseId"].DisplayIndex      = 7;
            dataGridView1.Columns["Semester"].DisplayIndex      = 8;
            dataGridView1.Columns["StatusId"].DisplayIndex      = 9;
        }
        private void AddBrrwrBtn_Click(object sender, EventArgs e)
        {
            string Name    = NameTxt.Text;
            string SSN     = SSNTxt.Text;
            string Address = AddressTxt.Text;
            string Phone   = PhoneTxt.Text;
            string Email   = EmailTxt.Text;

            bool SSN_Unique = Check_SSN(SSN);

            if (!string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(SSN) && !string.IsNullOrEmpty(Address))
            {
                SSN = Format_SSN(SSN);

                if (SSN_Unique == true)
                {
                    Execute_Add_Borrower(Name, SSN, Address, Phone, Email);
                }
                else
                {
                    MessageBox.Show("The SSN number provided is already in use.  Please enter another SSN or update the existing record.");
                }
            }
            else
            {
                MessageBox.Show("The values for Name, SSN, and Address must be filled in.");
            }

            NameTxt.Clear();
            SSNTxt.Clear();
            AddressTxt.Clear();
            PhoneTxt.Clear();
            EmailTxt.Clear();
            Load_Borrower_View();
        }
Exemple #3
0
        private void EmailTxt_Validating_1(object sender, CancelEventArgs e)
        {
            try
            {
                System.Text.RegularExpressions.Regex rEMail = new System.Text.RegularExpressions.Regex(@"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$");

                if (EmailTxt.Text.Length > 0)

                {
                    if (!rEMail.IsMatch(EmailTxt.Text))

                    {
                        MessageBox.Show("Invalid Email Address Please enter a valid Email Address", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);

                        EmailTxt.SelectAll();

                        e.Cancel = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        public async void RegisterMethod()
        {
            if (string.IsNullOrEmpty(this.NombreTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Nombre.", "Accept");

                return;
            }

            if (string.IsNullOrEmpty(this.ApellidoTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Apellido.", "Accept");

                return;
            }
            if (string.IsNullOrEmpty(this.EmailTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Email.", "Accept");

                return;
            }

            if (string.IsNullOrEmpty(this.EdadTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Edad.", "Accept");

                return;
            }
            //this.IsVisibleTxt = true;
            //this.isRunning = true;
            //this.isEnabled = true;

            var carros = new Carros
            {
                Nombre   = NombreTxt.ToLower(),
                Apellido = ApellidoTxt.ToLower(),
                Email    = EmailTxt.ToLower(),
                Edad     = EdadTxt.ToLower()
            };



            var obtenerId = await _databaseQuery.SaveCarrosAsync(carros);

            var obtengoRegistro = await _databaseQuery.GetCarros();


            await Application.Current.MainPage.DisplayAlert("Datos guardados", "Perfectamente", "Acectar");



            //this.IsRunningTxt = false;
            //this.IsVisibleTxt = false;
            //this.IsEnabledTxt = true;



            // await Application.Current.MainPage.Navigation.PushAsync(new LoginPage());
        }
 private void CancelBtn_Click(object sender, EventArgs e)
 {
     NameTxt.Clear();
     SSNTxt.Clear();
     AddressTxt.Clear();
     PhoneTxt.Clear();
     EmailTxt.Clear();
 }
Exemple #6
0
 private void PhoneTxt3_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         EmailTxt.Focus();
         e.Handled          = true;
         e.SuppressKeyPress = true;
     }
 }
        protected void TextBox1_TextChanged(object sender, EventArgs e) //Check if email is valid.
        {
            RegexStringValidator emailValid = new RegexStringValidator(regexEmail);

            isValidEmail = false;
            try
            {
                emailValid.Validate(EmailTxt.Text);
                isValidEmail = true;
            }
            catch (ArgumentException)
            {
                isValidEmail = false;
            }
            if (isValidEmail == true)
            {
                SqlConnection myConn = GetConnection();
                myConn.Open();
                bool           alreadyHaveAccount = false;
                string         sqlStr             = "select Email from [User];";
                SqlCommand     myCmd = new SqlCommand(sqlStr, myConn);
                SqlDataAdapter da    = new SqlDataAdapter(myCmd);
                DataSet        ds    = new DataSet();
                da.Fill(ds);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (String.Compare(EmailTxt.Text, ds.Tables[0].Rows[i]["Email"].ToString(), 0) == 0)
                    {
                        alreadyHaveAccount = true;
                    }
                }
                if (alreadyHaveAccount == true)
                {
                    EmailTxt.BorderColor = System.Drawing.Color.Red;
                    EmailHint.Text       = "You already have an account!";
                    EmailHint.Visible    = true;
                    EmailTxt.Focus();
                }
                else
                {
                    EmailTxt.BorderColor = System.Drawing.Color.Black;
                    EmailHint.Text       = "";
                    EmailHint.Visible    = false;
                }
                da.Dispose();
                ds.Dispose();
                myConn.Close();
            }
            else
            {
                EmailTxt.BorderColor = System.Drawing.Color.Red;
                EmailHint.Text       = "Please enter a valid email!";
                EmailHint.Visible    = true;
                EmailTxt.Focus();
            }
        }
Exemple #8
0
 public void LoginToWebApp(string user, string pass)
 {
     Selenium.WaitUntilElementIsClickable(SignInLnk);
     SignInLnk.Click();
     EmailTxt.Clear();
     EmailTxt.SendKeys(user);
     PasswordTxt.Clear();
     PasswordTxt.SendKeys(pass);
     LoginBtn.Click();
 }
Exemple #9
0
 private void PhoneTxt3_TextChanged(object sender, EventArgs e)
 {
     if (Loaded)
     {
         HandlePhoneNumChange();
         if (PhoneTxt3.TextLength == 4)
         {
             EmailTxt.Focus();
         }
     }
 }
Exemple #10
0
 private void login()
 {
     if (EmailTxt.ToString() == "*****@*****.**" && PasswordTxt.ToString() == "123456")
     {
         Application.Current.MainPage.DisplayAlert("Correcto", "Bienvenido", "ok");
     }
     else
     {
         Application.Current.MainPage.DisplayAlert("Incorrecto", "Usario y/o contraseña no valido", "ok");
     }
 }
Exemple #11
0
 private void Login()
 {
     if (EmailTxt.ToString() == "*****@*****.**" && PasswordTxt.ToString() == "1234")
     {
         Application.Current.MainPage.DisplayAlert("Correcto", "Logrado", "ok");
     }
     else
     {
         Application.Current.MainPage.DisplayAlert("Incorrecto", "No fue logrado", "ok");
     }
 }
Exemple #12
0
        public async void LoginMethod()
        {
            if (string.IsNullOrEmpty(this.email))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "You must enter an email.",
                    "Accept");

                return;
            }
            if (string.IsNullOrEmpty(this.password))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "You must enter a password.",
                    "Accept");

                return;
            }

            string WebAPIkey = "AIzaSyDvh8bOMOG0-bRlSI2cmbbpjHW21Bmzgwg";


            var authProvider = new FirebaseAuthProvider(new FirebaseConfig(WebAPIkey));

            try
            {
                var auth = await authProvider.SignInWithEmailAndPasswordAsync(EmailTxt.ToString(), PasswordTxt.ToString());

                var content = await auth.GetFreshAuthAsync();

                var serializedcontnet = JsonConvert.SerializeObject(content);

                Preferences.Set("MyFirebaseRefreshToken", serializedcontnet);
                await Shell.Current.GoToAsync($"//ProfilePage");
            }
            catch (Exception ex)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Invalid useremail or password", "OK");
            }

            this.IsVisibleTxt = true;
            this.IsRunningTxt = true;
            this.IsEnabledTxt = false;

            await Task.Delay(20);


            this.IsRunningTxt = false;
            this.IsVisibleTxt = false;
            this.IsEnabledTxt = true;
        }
        private async void Register()
        {
            if (string.IsNullOrEmpty(this.EmailTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You must enter an email", "Accept");

                return;
            }
            if (string.IsNullOrEmpty(this.PasswordTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You must enter a Password", "Accept");

                return;
            }
            if (string.IsNullOrEmpty(this.UsernameTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You must enter an Username", "Accept");

                return;
            }
            if (AgeTxt.ToString() == null)
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You must enter an Age", "Accept");

                return;
            }
            if (string.IsNullOrEmpty(this.LNameTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You must enter an Last Name", "Accept");

                return;
            }
            if (string.IsNullOrEmpty(this.FNameTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You must enter an First Name", "Accept");

                return;
            }


            var user = new User
            {
                Email         = EmailTxt.ToLower(),
                Password      = PasswordTxt.ToLower(),
                FirstName     = FNameTxt.ToLower(),
                LastName      = LNameTxt.ToLower(),
                Age           = AgeTxt.ToString(),
                Creation_Date = DateTime.UtcNow.Date
            };

            await App.Database.SaveUserAsync(user);//Anade al nuevo usuario creado en el registro
        }
Exemple #14
0
        public async void LoginMethod()
        {
            if (string.IsNullOrEmpty(this.email))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "You must enter an email.",
                    "Accept");

                return;
            }
            if (string.IsNullOrEmpty(this.password))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "You must enter a password.",
                    "Accept");

                return;
            }

            string WebAPIkey = "AIzaSyBJ7GurFSPSpXxhwoJ93KU68Ia6rXIMZb4";


            var authProvider = new FirebaseAuthProvider(new FirebaseConfig(WebAPIkey));

            try
            {
                var auth = await authProvider.SignInWithEmailAndPasswordAsync(EmailTxt.ToString(), PasswordTxt.ToString());

                var content = await auth.GetFreshAuthAsync();

                var serializedcontnet = JsonConvert.SerializeObject(content);

                Preferences.Set("MyFirebaseRefreshToken", serializedcontnet);

                //Puede navegar al tener autorizacion
                await Application.Current.MainPage.Navigation.PushAsync(new ContainerTabbedPags());

                this.IsRunningTxt = false;
                this.IsVisibleTxt = false;
                this.IsEnabledTxt = true;
            }
            catch (Exception ex)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Invalid useremail or password", "OK");

                this.IsRunningTxt = false;
                this.IsVisibleTxt = false;
                this.IsEnabledTxt = true;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (EmailTxt != null)
            {
                EmailTxt.Dispose();
                EmailTxt = null;
            }

            if (Logout != null)
            {
                Logout.Dispose();
                Logout = null;
            }
        }
 public void ResetForm()
 {
     FullNameTxt.Clear();
     PhoneTxt.Clear();
     EmailTxt.Clear();
     if (ActiveRdBtn.Checked)
     {
         DisabledRdBtn.Checked = false;
     }
     if (DisabledRdBtn.Checked)
     {
         ActiveRdBtn.Checked = false;
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (EmailTxt != null)
            {
                EmailTxt.Dispose();
                EmailTxt = null;
            }

            if (FacebookButton != null)
            {
                FacebookButton.Dispose();
                FacebookButton = null;
            }

            if (GirisButton != null)
            {
                GirisButton.Dispose();
                GirisButton = null;
            }

            if (GoogleButton != null)
            {
                GoogleButton.Dispose();
                GoogleButton = null;
            }

            if (SifrenimiUnuttunButton != null)
            {
                SifrenimiUnuttunButton.Dispose();
                SifrenimiUnuttunButton = null;
            }

            if (SifreTxt != null)
            {
                SifreTxt.Dispose();
                SifreTxt = null;
            }

            if (Sozlesmelabel != null)
            {
                Sozlesmelabel.Dispose();
                Sozlesmelabel = null;
            }

            if (UyeOlButton != null)
            {
                UyeOlButton.Dispose();
                UyeOlButton = null;
            }
        }
Exemple #18
0
        void ReleaseDesignerOutlets()
        {
            if (AdText != null)
            {
                AdText.Dispose();
                AdText = null;
            }

            if (EmailTxt != null)
            {
                EmailTxt.Dispose();
                EmailTxt = null;
            }

            if (GeriButton != null)
            {
                GeriButton.Dispose();
                GeriButton = null;
            }

            if (GirisYapButton != null)
            {
                GirisYapButton.Dispose();
                GirisYapButton = null;
            }

            if (KayitOlButton != null)
            {
                KayitOlButton.Dispose();
                KayitOlButton = null;
            }

            if (SifreTekrarTxt != null)
            {
                SifreTekrarTxt.Dispose();
                SifreTekrarTxt = null;
            }

            if (SifreTxt != null)
            {
                SifreTxt.Dispose();
                SifreTxt = null;
            }

            if (SoyadText != null)
            {
                SoyadText.Dispose();
                SoyadText = null;
            }
        }
Exemple #19
0
        private void EmailTxt_Leave(object sender, EventArgs e)
        {
            Regex mRegxExpression;

            if (EmailTxt.Text.Trim() != string.Empty)
            {
                mRegxExpression = new Regex(@"^([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$");

                if (!mRegxExpression.IsMatch(EmailTxt.Text.Trim()))
                {
                    MessageBox.Show("E-mail address format is not correct.", "MojoCRM", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    EmailTxt.Focus();
                }
            }
        }
        public async void RegisterMethod()
        {
            var user = new User
            {
                UserName    = UserNameTxt.ToLower(),
                Password    = PasswordTxt.ToLower(),
                Email       = EmailTxt.ToLower(),
                PhoneNumber = PhoneNumberTxt.ToLower()
            };

            await App.Database.SaveUserAsync(user);

            await Application.Current.MainPage.DisplayAlert("Datos guardados", "Bienvenido" + userName.ToString(), "Acectar");

            await Application.Current.MainPage.Navigation.PushAsync(new LoginPage());

            #endregion
        }
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            if (FullNameTxt.Text == "")
            {
                MessageBox.Show("FullName daxil edin.");
            }
            if (PhoneTxt.Text == "")
            {
                MessageBox.Show("Phone nomreni daxil edin");
            }
            if (EmailTxt.Text == "")
            {
                MessageBox.Show("Email daxil edin");
            }

            if (ActiveRdBtn.Checked == false && DisabledRdBtn.Checked == false)
            {
                MessageBox.Show("Status sechin");
            }
            if (!string.IsNullOrEmpty(FullNameTxt.Text) && !string.IsNullOrEmpty(EmailTxt.Text) && !string.IsNullOrEmpty(PhoneTxt.Text) &&
                (ActiveRdBtn.Checked || DisabledRdBtn.Checked))
            {
                Customer customer = new Customer();

                customer.FullName = FullNameTxt.Text;
                customer.Status   = ActiveRdBtn.Checked ? true : false;
                customer.Phone    = PhoneTxt.Text;
                customer.Email    = EmailTxt.Text;

                _db.Customers.Add(customer);
                _db.SaveChanges();

                MessageBox.Show("Author Added:" + FullNameTxt.Text + "New Author");
                FullNameTxt.Clear();
                PhoneTxt.Clear();
                EmailTxt.Clear();
                ActiveRdBtn.Checked   = false;
                DisabledRdBtn.Checked = false;

                FillCustomers();
            }
        }
Exemple #22
0
 public void EnterEmailAddress(string email)
 {
     EmailTxt.SendKeys(email);
 }
        private async void RegisterMethod()
        {
            if (string.IsNullOrEmpty(this.email))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "You must enter an email.",
                    "Accept");

                return;
            }

            if (string.IsNullOrEmpty(this.password))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "You must enter a password.",
                    "Accept");

                return;
            }

            string WebAPIkey = "AIzaSyBJ7GurFSPSpXxhwoJ93KU68Ia6rXIMZb4";

            try
            {
                var authProvider = new FirebaseAuthProvider(new FirebaseConfig(WebAPIkey));
                var auth         = await authProvider.CreateUserWithEmailAndPasswordAsync(EmailTxt.ToString(), PasswordTxt.ToString());

                string gettoken = auth.FirebaseToken;

                await Application.Current.MainPage.DisplayAlert("Successfully", "Welcome " + name.ToString() + " to your app", "Ok");

                this.IsRunningTxt = false;
                this.IsVisibleTxt = false;
                this.IsEnabledTxt = true;
                await Application.Current.MainPage.Navigation.PushAsync(new LoginPage());
            }
            catch (Exception ex)
            {
            }
        }
Exemple #24
0
        public async void ActualizarMethod()
        {
            if (string.IsNullOrWhiteSpace(this.EmailTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Email.", "Accept");

                return;
            }


            //Valida que el formato del correo sea valido
            bool isEmail = Regex.IsMatch(EmailTxt, @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z", RegexOptions.IgnoreCase);

            if (!isEmail)
            {
                await Application.Current.MainPage.DisplayAlert("Advertencia", "El formato del correo electrónico es incorrecto, revíselo e intente de nuevo.", "OK");

                return;
            }


            if (string.IsNullOrEmpty(this.PasswordTxt))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Password.", "Acceptar");

                return;
            }


            if (string.IsNullOrEmpty(this.RepetircontrasenaTXT))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "You mus enter Password.", "Acceptar");

                return;
            }



            var user = new User
            {
                Email    = EmailTxt.ToLower(),
                Password = PasswordTxt.ToLower(),
            };


            //if (user.Id != 0)
            //{

            //}
            //else {
            //    await Application.Current.MainPage.DisplayAlert("Usuario no encontrado", "ok", "Aceptar");

            //    await Application.Current.MainPage.Navigation.PushAsync(new CambiarContraseña());

            //    return;
            //}


            await App.Database.SaveUserAsync(user);


            await Application.Current.MainPage.DisplayAlert("Datos Actualizados", "Bien echo", "Acectar");



            await Application.Current.MainPage.Navigation.PushAsync(new LoginPage());
        }
        private async void OnRegisterClicked()
        {
            if (string.IsNullOrEmpty(this.email))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "You must enter an email.",
                    "Accept");

                return;
            }

            if (string.IsNullOrEmpty(this.password))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "You must enter a password.",
                    "Accept");

                return;
            }

            string WebAPIkey = "AIzaSyDvh8bOMOG0-bRlSI2cmbbpjHW21Bmzgwg";

            try
            {
                var authProvider = new FirebaseAuthProvider(new FirebaseConfig(WebAPIkey));
                var auth         = await authProvider.CreateUserWithEmailAndPasswordAsync(EmailTxt.ToString(), PasswordTxt.ToString());

                string gettoken = auth.FirebaseToken;

                await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
            }
            catch (Exception ex)
            {
                await App.Current.MainPage.DisplayAlert("Alert", ex.Message, "OK");
            }

            /*
             * if (string.IsNullOrEmpty(this.name))
             * {
             *  await Application.Current.MainPage.DisplayAlert(
             *      "Error",
             *      "You must enter a name.",
             *      "Accept");
             *  return;
             * }
             * if (string.IsNullOrEmpty(this.age))
             * {
             *  await Application.Current.MainPage.DisplayAlert(
             *      "Error",
             *      "You must enter an age.",
             *      "Accept");
             *  return;
             * }
             * this.IsVisibleTxt = true;
             * this.IsRunningTxt = true;
             * this.IsEnabledTxt = false;
             * var user = new UserModel
             * {
             *  EmailField = email,
             *  PasswordField = password,
             *  NamesField = name,
             *  AgeField = age,
             *  Creation_Date = DateTime.Now,
             * };
             * await App.Database.SaveUserModelAsync(user);
             * await Application.Current.MainPage.DisplayAlert("Successfully", "Welcome " + name.ToString() + " to your app", "Ok");
             * this.IsRunningTxt = false;
             * this.IsVisibleTxt = false;
             * this.IsEnabledTxt = true;
             * await Application.Current.MainPage.Navigation.PushAsync(new LoginPage());
             */
        }