private void ChangePassBtn(object sender, RoutedEventArgs e)
 {
     UTIL.ServicesPortTypeClient client = new UTIL.ServicesPortTypeClient();
     if (client.changePassword(PhoneNum.Text, TCNo.Text, newPassword.Password) == 1)
     {
         MainPage wd = new MainPage();
         wd.AccCreated.Content = "Şifre Başarıyla Değiştirildi!";
         Application.Current.MainWindow.Content = wd;
     }
     else
     {
         invalidLabel.Content = "Lütfen Geçerli Bilgiler Giriniz!";
     }
 }
Exemplo n.º 2
0
        private void loginBtnFunction(object sender, RoutedEventArgs e)
        {
            UTIL.ServicesPortTypeClient client = new UTIL.ServicesPortTypeClient();
            int loginSuccess = client.login(phoneNum.Text, password.Password);


            if (loginSuccess == 1)
            {
                UserMainPage pg = new UserMainPage();
                pg.phoneNumLabel.Content = phoneNum.Text;
                pg.nameLabel.Content     = client.showProfile(phoneNum.Text)[0] + " " + client.showProfile(phoneNum.Text)[1];
                pg.packageLabel.Content  = client.showProfile(phoneNum.Text)[3];
                pg.internetLabel.Content = client.getBalances(phoneNum.Text)[0];
                pg.callLabel.Content     = client.getBalances(phoneNum.Text)[1];
                pg.smsLabel.Content      = client.getBalances(phoneNum.Text)[2];
                this.Content             = pg;
            }
            else
            {
                invalidLabel.Content = "Geçersiz Telefon Numarası veya Şifre";
            }
        }
        private void CreateAccountBtn(object sender, RoutedEventArgs e)
        {
            int    index = monthCmb.SelectedIndex + 1;
            string indexStr;

            if (index < 10)
            {
                indexStr = "0" + index.ToString();
            }
            else
            {
                indexStr = index.ToString();
            }

            string birthday = dayCmb.Text + "-" + indexStr + "-" + yearCmb.Text;


            UTIL.ServicesPortTypeClient client = new UTIL.ServicesPortTypeClient();

            if (client.createAccount(FName.Text, LName.Text, PhoneNum.Text, Mail.Text, password.Password, birthday, TCNo.Text) == 1)
            {
                MainPage wd = new MainPage();
                //MainWindow wd = new MainWindow();
                //Application.Current.Windows[0].Close();
                wd.AccCreated.Content = "Hesabınız Oluşturuldu! Giriş Yapabilirsiniz";
                //wd.ShowDialog();
                Application.Current.MainWindow.Content = wd;
            }
            else
            {
                ErrorMsg.Content = "Geçersiz Veya Önceden Girilmiş Bilgi Girdiniz";

                if (String.IsNullOrEmpty(FName.Text))
                {
                    ErrorMsgFName.Content = "*Lütfen Doldurunuz";
                }
                else
                {
                    ErrorMsgFName.Content = "";
                }

                if (String.IsNullOrEmpty(LName.Text))
                {
                    ErrorMsgLName.Content = "*Lütfen Doldurunuz";
                }
                else
                {
                    ErrorMsgLName.Content = "";
                }

                if (String.IsNullOrEmpty(Mail.Text) || !ValidateMail(Mail.Text))
                {
                    ErrorMsgMail.Content = "*Lütfen geçerli ve kullanılmamış bir mail adresi giriniz";
                }
                else
                {
                    ErrorMsgMail.Content = "";
                }

                if (String.IsNullOrEmpty(PhoneNum.Text) || PhoneNum.Text.IndexOf('5') != 0)
                {
                    ErrorMsgPhoneNum.Content = "*Lütfen geçerli bir telefon numarası giriniz";
                }
                else
                {
                    ErrorMsgPhoneNum.Content = "";
                }

                if (String.IsNullOrEmpty(password.Password) || !PasswordValidation(password.Password))
                {
                    ErrorMsgPassword.Foreground = new SolidColorBrush(Colors.Red);
                    ErrorMsgPassword.Content    = "*Geçersiz şifre. Şifreniz en az bir büyük harf, bir küçük harf ve bir rakam içermelidir";
                }
                else
                {
                    ErrorMsgPassword.Foreground = new SolidColorBrush(Colors.Gray);
                    ErrorMsgPassword.Content    = "*Şifreniz en az bir büyük harf, bir küçük harf ve bir rakam içermelidir";
                }


                if (String.IsNullOrEmpty(TCNo.Text) || !ValidateTC(TCNo.Text))
                {
                    ErrorMsgTC.Content = "*Lütfen geçerli bir telefon numarası giriniz";
                }
                else
                {
                    ErrorMsgTC.Content = "";
                }

                if (String.IsNullOrEmpty(dayCmb.Text) || String.IsNullOrEmpty(monthCmb.Text) || String.IsNullOrEmpty(yearCmb.Text))
                {
                    ErrorMsgBirthday.Content = "*Lütfen doğum tarihinizi giriniz";
                }
                else
                {
                    ErrorMsgBirthday.Content = "";
                }
            }
        }