Beispiel #1
0
 public override void Handle(LoginChangeReciever reciever)
 {
     if (reciever.NewLogin == reciever.InitialLogin)
     {
     }
     else if (Successor != null)
     {
         Successor.Handle(reciever);
     }
 }
Beispiel #2
0
 public override void Handle(LoginChangeReciever reciever)
 {
     if (string.IsNullOrWhiteSpace(reciever.NewLogin) || string.IsNullOrEmpty(reciever.NewLogin))
     {
         TextBlock dialogContent = new TextBlock();
         dialogContent.Text = "Заполните все необходимые поля";
         ShowDial(reciever.Account, dialogContent);
     }
     else if (Successor != null)
     {
         Successor.Handle(reciever);
     }
 }
Beispiel #3
0
        public static void Login_change(string new_login, string initial_login, My_Account account)
        {
            LoginChangeReciever       info = new LoginChangeReciever(new_login, initial_login, account);
            LoginStringsFilledHandler stringsFilledHandler = new LoginStringsFilledHandler();
            NoChangesHandler          noChangesHandler     = new NoChangesHandler();
            LoginExistsHandler        loginExistsHandler   = new LoginExistsHandler();
            ChangeLoginHandler        changeLoginHandler   = new ChangeLoginHandler();

            stringsFilledHandler.Successor = noChangesHandler;
            noChangesHandler.Successor     = loginExistsHandler;
            loginExistsHandler.Successor   = changeLoginHandler;
            stringsFilledHandler.Handle(info);
        }
        public override void Handle(LoginChangeReciever reciever)
        {
            DataContext db    = new DataContext(DB_connection.connectionString);
            var         query = db.GetTable <TUsers>()
                                .Any(k => k.Login == reciever.NewLogin);

            if (query)
            {
                TextBlock dialogContent = new TextBlock();
                dialogContent.Text = "Данный логин уже занят";
                ShowDial(reciever.Account, dialogContent);
            }
            else if (Successor != null)
            {
                Successor.Handle(reciever);
            }
        }
        public override void Handle(LoginChangeReciever reciever)
        {
            TextBlock dialogContent = new TextBlock();
            TUsers    user          = db.GetTable <TUsers>().Where(k => k.Id == User.CurrentUser.ID).First();

            user.Login = reciever.NewLogin;
            try
            {
                db.SubmitChanges();
            }
            catch (Exception e)
            {
                dialogContent.Text = e.Message;
                ShowDial(reciever.Account, dialogContent);
            }
            dialogContent.Text = "Изменения были успешно внесены";
            ShowDial(reciever.Account, dialogContent);
        }
Beispiel #6
0
 public abstract void Handle(LoginChangeReciever receiver);