Esempio n. 1
0
        public MainViewModel()
        {
            UpdateViewCommand = new UpdateViewCommand(this);
            //UpdateViewCommand.Execute("Login");

            CheckLoggin();
        }
Esempio n. 2
0
        private void Receive(int cmd, string data)
        {
            if (cmd == (int)ResponseInfo.False)
            {
                MessageBox.Show("다시 확인 바랍니다.");
            }

            else if (cmd == (int)ResponseInfo.Already)
            {
                MessageBox.Show("다른 곳에서 접속 중입니다. 연결을 끊고 시도해 주세요.");
            }

            else if (cmd == (int)ResponseInfo.Auth)
            {
                MessageBox.Show("인증받지 않은 아이디입니다. 이메일 인증을 진행해 주세요.");
                Detach();
                UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand;
                update.Execute("Auth");
            }

            else
            {
                Detach();
                UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand;
                update.Execute("Home");
            }
        }
Esempio n. 3
0
        public void GoJoin()
        {
            Detach();
            UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand;

            update.Execute("Join");
        }
Esempio n. 4
0
        public MainWindow()
        {
            InitializeComponent();
            MainView = new MainViewModel();
            ICommand UpdateViewCommand = new UpdateViewCommand(MainView);

            DataContext = MainView;
            UpdateViewCommand.Execute("Login");
        }
Esempio n. 5
0
        public MainViewModel(StorageSerializer storageSerializer)
        {
            var storage           = storageSerializer.Load();
            var seriesCollection  = storage.SeriesCollection ?? new ObservableCollection <Series>();
            var counter           = new Counter(storage.Id ?? 0);
            var updateViewCommand = new UpdateViewCommand(this, storageSerializer, counter, seriesCollection);
            var content           = new EntryListViewModel(seriesCollection);

            CurrentViewModel = new ShowEntryListViewModel(content, updateViewCommand);
        }
Esempio n. 6
0
        public ActualMainVM()
        {
            //UserHandler.Instance.Load();

            Login = new RelayCommand((o) =>
            {
                bool check = false;

                MD5 hash = MD5.Create();

                var schluessel1 = hash.ComputeHash(Encoding.UTF8.GetBytes(Password));
                Password        = Convert.ToBase64String(schluessel1);

                SqlConnection con = new SqlConnection(VERBINDUNG);

                string sql = $"Select UserName, UserPassword from documentFilingPassword where UserName = '******' and UserPassword = '******'";

                con.Open();

                SqlCommand com       = new SqlCommand(sql, con);
                SqlDataReader reader = com.ExecuteReader();

                while (reader.Read())
                {
                    check = true;
                }

                reader.Close();
                com.Dispose();
                con.Close();

                if (check)
                {
                    Window start = new DocumentFilingView();
                    start.ShowDialog();
                }
                else
                {
                    ErrorLogin = "******";
                }

                //if (UserHandler.Instance.GetUsers().Find(u => u.UserName == UserName && u.Password == Password) != null)
                //{
                //    Window start = new DocumentFilingView();
                //    start.ShowDialog();
                //}
                //else
                //{
                //    ErrorLogin = "******";
                //}
            });

            UpdatePage = new UpdateViewCommand(this);
        }
Esempio n. 7
0
        public UserPageViewModel(MainWindowViewModel mainWindowViewModel)
        {
            _mainWindowViewModel            = mainWindowViewModel;
            UpdateViewToEditNoteViewCommand = new UpdateViewToEditNoteViewCommand(this, mainWindowViewModel);
            UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel);
            LogoutCommand     = new LogoutCommand(mainWindowViewModel);

            UserNotesList = new myBindingList <Note>();

            UserNotesList.BeforeRemove += UserNotesList_BeforeRemove;
        }
Esempio n. 8
0
        public BalanceViewModel()
        {
            SingleCurrentAccount currentAccount = SingleCurrentAccount.GetInstance();

            CurrentAccount = currentAccount.Account;
            UnitOfWork     = new UnitOfWork();
            Histories      = new List <History>();
            GetHistories();

            CreateCommand.CheckRepeatHistories();

            Balance           = GetBalance(Histories);
            UpdateViewCommand = new UpdateViewCommand(MainWindow.MainView);
            RefreshHistoryCollectionView();
            DeleteCommand     = new DeleteCommand(this);
            LinkToEditCommand = new LinkToEditCommand();
        }
Esempio n. 9
0
        private void Register()
        {
            try
            {
                using (UnitOfWork unit = new UnitOfWork())
                {
                    IEnumerable <User> result = unit.UserRepository.Get(x => x.UserLogin == UserLogin);
                    if (result.Count() != 0)
                    {
                        Message = "Пользователь с таким логином уже существует!";
                        return;
                    }
                    else
                    {
                        User regUser = new User();
                        regUser.Salt         = PasswordHash.GenerateSaltForPassword().ToString();
                        regUser.UserPassword = PasswordHash.ComputePasswordHash(UserPassword, int.Parse(regUser.Salt));
                        regUser.UserLogin    = UserLogin;

                        unit.UserRepository.Create(regUser);
                        unit.Save();

                        User foundUser = unit.UserRepository.Get(x => x.UserLogin == regUser.UserLogin).First();

                        usersDatum.IdData   = foundUser.Id;
                        usersDatum.FullName = UserSurname + " " + UserName + " " + UserLastname;

                        unit.UserDatumRepository.Create(usersDatum);
                        unit.Save();

                        usersParam.IdParams = foundUser.Id;

                        unit.UserParamRepository.Create(usersParam);
                        unit.Save();

                        Message = "Регистрация прошла успешно! Введите логин и пароль";
                        UpdateViewCommand.Execute("LogInPage");
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("Сообщение ошибки: " + exception.Message, "Произошла ошибка");
            }
        }
Esempio n. 10
0
        public NavigationViewModel(IDialogService dialogService, IWindowService windowService, IBrowserService browserService)
        {
            this.User         = new UserRepo().LoginFirst();
            UpdateViewCommand = new UpdateViewCommand(this, WorkStatus, User, dialogService, windowService, browserService);
            UpdateViewCommand.Execute(ViewType.Home);
            this.Title = User.Username;
            Sections   = new ObservableCollection <string>();

            // Initialize commands
            GetSectionsCommand = new RelayCommand(GetSections);

            // Change configuration connection string to writable
            var fi = typeof(ConfigurationElement).GetField("_bReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);

            fi.SetValue(ConfigurationManager.ConnectionStrings["Default"], false);

            // Populate sections
            GetSectionsCommand.Execute(null);
        }
Esempio n. 11
0
        private void Receive(int cmd, string data)
        {
            if (cmd == (int)ResponseInfo.True)
            {
                MessageBox.Show("인증이 완료되었습니다. 정상적인 이용이 가능합니다.");
                Detach();
                UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand;
                update.Execute("Login");
            }

            else if (cmd == (int)ResponseInfo.Ready)
            {
                MessageBox.Show("인증번호가 전송되었습니다. 인증을 진행해 주세요.");
            }

            else
            {
                MessageBox.Show("잘못된 번호입니다. 다시 한번 확인해 주세요.");
            }
        }
Esempio n. 12
0
        private void Receive(int cmd, string data)
        {
            if (cmd == (int)ResponseInfo.Email)
            {
                MessageBox.Show("이미 존재하는 계정입니다.");
            }

            else if (cmd == (int)ResponseInfo.Nickname)
            {
                MessageBox.Show("이미 존재하는 닉네임입니다.");
            }

            else
            {
                MessageBox.Show("가입 완료! 인증을 완료하셔야 이용 가능합니다.");
                Detach();
                UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand;
                update.Execute("Auth");
            }
        }
Esempio n. 13
0
        private async void OnKeyDownHandler(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Up && available)
            {
                available = false;
                data.gamePlay.playerMove(-1, 0);
                await Task.Delay(6000);

                available = true;
            }
            else if (e.Key == Key.Left && available)
            {
                available = false;
                data.gamePlay.playerMove(0, -1);
                await Task.Delay(6000);

                available = true;
            }
            else if (e.Key == Key.Down && available)
            {
                available = false;
                data.gamePlay.playerMove(1, 0);
                await Task.Delay(6000);

                available = true;
            }
            else if (e.Key == Key.Right && available)
            {
                available = false;
                data.gamePlay.playerMove(0, 1);
                await Task.Delay(6000);

                available = true;
            }
            else if (e.Key == Key.Escape)
            {
                data.gamePlay.gameState.stop();

                UpdateViewCommand.getInstaince(MainViewModel.getInstaince()).Execute("mainMenue");
            }
        }
Esempio n. 14
0
        public RegisterPageViewModel()
        {
            try
            {
                UpdateViewCommand     = new UpdateViewCommand(this);
                Message               = "Придумайте логин(от 5 до 20 символов) и пароль(от 8 до 20 символов). Логин и пароль могут содержать латинские символы и цифры";
                usersDatum            = new UsersDatum();
                usersParam            = new UsersParam();
                usersParam.ParamsDate = DateTime.Now;
                usersDatum.Birthday   = DateTime.Now;

                UserLastname = "";
                UserSurname  = "";
                UserName     = "";

                UserWeight = 10;
                UserHeight = 50;
            }
            catch (Exception exception)
            {
                MessageBox.Show("Сообщение ошибки: " + exception.Message, "Произошла ошибка");
            }
        }
Esempio n. 15
0
 private MainViewModel()
 {
     this.updateViewcommand = UpdateViewCommand.getInstaince(this);
 }
Esempio n. 16
0
 public MainViewModel()
 {
     UpdateViewCommand  = new UpdateViewCommand(this);
     LanguageSetCommand = new Command.CommandManager(languageSet);
 }
 public MainViewModel()
 {
     SelectedViewModel = new HRViewModel(this);
     UpdateView        = new UpdateViewCommand(this);
 }
Esempio n. 18
0
 private MainMenueViewModel()
 {
     this.updateViewcommand = UpdateViewCommand.getInstaince(MainViewModel.getInstaince());
 }
Esempio n. 19
0
 public LoginViewModel(MainWindowViewModel mainWindowViewModel)
 {
     LoginCommand      = new LoginCommand(this, mainWindowViewModel);
     UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel);
 }
Esempio n. 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainViewModel"/> class.
 /// </summary>
 /// <param name="main">The main.</param>
 public MainViewModel(MainWindow main)
 {
     UpdateViewCommand = new UpdateViewCommand(this, main);
 }
Esempio n. 21
0
 public EditNoteViewModel(MainWindowViewModel mainWindowViewModel)
 {
     _mainWindowViewModel = mainWindowViewModel;
     EditNoteCommand      = new EditNoteCommand(this, mainWindowViewModel);
     UpdateViewCommand    = new UpdateViewCommand(mainWindowViewModel);
 }
Esempio n. 22
0
 public MainViewModel()
 {
     UpdateViewCommand = new UpdateViewCommand(this);
 }
Esempio n. 23
0
 public MainWindowViewModel(IUnityContainer container)
 {
     _container        = container;
     UpdateViewCommand = new UpdateViewCommand(this);
 }
Esempio n. 24
0
 public AddNewNoteViewModel(MainWindowViewModel mainWindowViewModel)
 {
     _mainWindowViewModel = mainWindowViewModel;
     AddNewNoteCommand    = new AddNewNoteCommand(this, mainWindowViewModel);
     UpdateViewCommand    = new UpdateViewCommand(mainWindowViewModel);
 }
Esempio n. 25
0
 public EditEntryViewModel(EntryViewModel currentContent, UpdateViewCommand updateViewCommand)
 {
     CurrentContent    = currentContent;
     UpdateViewCommand = updateViewCommand;
 }
Esempio n. 26
0
 public SignUpViewModel(MainWindowViewModel mainWindowViewModel)
 {
     SignUpCommand     = new SignUpCommand(this, mainWindowViewModel);
     UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel);
 }
Esempio n. 27
0
 private ControlsViewModel()
 {
     updateViewcommand = UpdateViewCommand.getInstaince(MainViewModel.getInstaince());
 }