예제 #1
0
 public SignUp_Window(User_BLL_DTO user, string password)
 {
     InitializeComponent();
     if (user != null)
     {
         txtFirstName.Text = user.Firstname;
         txtLastName.Text  = user.LastName;
         txtLogin.Text     = user.Login;
         txtEmail.Text     = user.Email;
         txtPhone.Text     = user.Phone;
     }
 }
예제 #2
0
 private void Button_Click_Submit(object sender, RoutedEventArgs e)
 {
     if (String.IsNullOrEmpty(txtFirstName.Text) || String.IsNullOrEmpty(txtLastName.Text) || String.IsNullOrEmpty(txtEmail.Text) ||
         String.IsNullOrEmpty(txtLogin.Text) || String.IsNullOrEmpty(txtPhone.Text) || CitiesBox.SelectedItem == null || CountriesBox.SelectedItem == null)
     {
         MessageBox.Show("Please input all info");
     }
     else
     {
         if (txtPassword.Password != txtConfirmPassBox.Password)
         {
             MessageBox.Show("Passwords are different!");
         }
         else
         {
             User_BLL_DTO new_user = new User_BLL_DTO();
             new_user.Firstname = txtFirstName.Text;
             new_user.LastName  = txtLastName.Text;
             new_user.Email     = txtEmail.Text;
             new_user.Login     = txtLogin.Text;
             new_user.Phone     = txtPhone.Text;
             new_user.City      = new City_BLL_DTO()
             {
                 Name = (CitiesBox.SelectedItem as City_BLL_DTO).Name
             };
             try
             {
                 _bll.SignUp(txtFirstName.Text, txtLastName.Text, txtLogin.Text, txtEmail.Text, txtPhone.Text, txtPassword.Password, (CitiesBox.SelectedItem as City_BLL_DTO).Name, (CitiesBox.SelectedItem as City_BLL_DTO).Country.Name);
             }
             catch (FaultException <IncorrectInputData> ex)
             {
                 MessageBox.Show(ex.Detail.Message);
                 return;
             }
             try
             {
                 _bll.SendCode(new_user.Email);
                 ConfirmEmail_Window window = new ConfirmEmail_Window(new_user, txtPassword.Password);
                 window.Show();
                 this.Close();
             }
             catch (FaultException <IncorrectInputData> ex)
             {
                 MessageBox.Show(ex.Detail.Message);
             }
         }
     }
 }
 public ConfirmEmail_Window(User_BLL_DTO user, string password)
 {
     InitializeComponent();
     CurrentUser = user;
     Password    = password;
 }
예제 #4
0
 public static User ToUser(User_BLL_DTO _bll_user, DataModel context)
 {
     return(context.Users.FirstOrDefault(x => x.Login == _bll_user.Login));
 }
예제 #5
0
 public void Subscibe(User_BLL_DTO user, Token_BLL_DTO token)
 {
     ctx.Users.FirstOrDefault(x => x.Login == token.User.Login).Folowers.Add(Converter_BLL_DTO.ToUser(user, ctx));
     ctx.SaveChanges();
 }