Пример #1
0
 private void CancelClick(object sender, RoutedEventArgs e)
 {
     ClientServerController.SaveChangesEvents(list);
     db.EventsList.Remove((EventsList)DataGrid.SelectedItem);
     db.SaveChangesAsync();
     DataGrid.ItemsSource = db.EventsList.Local;
 }
Пример #2
0
        public Page2()
        {
            InitializeComponent();

            list = ClientServerController.eventsLists();
            db.EventsList.LoadAsync();
            DataGrid.ItemsSource = db.EventsList.Local;
        }
Пример #3
0
        public PointsPage()
        {
            InitializeComponent();

            array = ClientServerController.currnetPoints();
            MessageBox.Show(array[0] + "\n" + array[1] + "\n" + array[2]);
            //TimeBlock.Text = array[0].ToString();
            //WeightBlock.Text = array[1].ToString();
            //TwBlock.Text = array[2].ToString();
        }
        public ExpertsListPage()
        {
            InitializeComponent();


            List <Experts> experts = ClientServerController.expertsList();

            DataGrid.ItemsSource = experts;

            dbEntities.Experts.Load();
            DataGrid.ItemsSource = dbEntities.Experts.Local;
        }
Пример #5
0
        public MainWindow()
        {
            InitializeComponent();
            ClientServerController.Connect();

            #region Debug!!!

            //Window1 menuWindow = new Window1();
            //menuWindow.Show();
            //this.Close();

            #endregion
        }
 private void SaveChanges_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ClientServerController.SaveChangesExperts(list);
         dbEntities.SaveChangesAsync();
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
         //throw;
     }
 }
Пример #7
0
        private void RegistrationButtonClick(object sender, RoutedEventArgs e)
        {
            int result = ClientServerController.Regitration(LoginField.Text, PasswordField.Password);

            switch (result)
            {
            case 0:
                MessageBox.Show("Регистрация не произведена", "Ошибка");
                break;

            case 1:
                MessageBox.Show("Регистрация прошла успешно", "Успех");
                break;
            }
        }
Пример #8
0
        private void SaveChanges_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ClientServerController.SaveChangesEvents(list);
                db.SaveChanges();
            }
            catch (Exception exception)
            {
                MessageBox.Show(
                    exception.Message + "\n" +
                    "Can't add data. Hint:\n \"UserId\" and \"Username\" fields must be unique and not empty\n \"Status\" field must be filled",
                    "Error");
                return;
            }

            MessageBox.Show("Data was added!");
        }
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            Experts item = (Experts)DataGrid.SelectedItem;

            if (item != null)
            {
                dbEntities.Experts.Remove(item);
            }

            try
            {
                ClientServerController.SaveChangesExperts(list);
                dbEntities.SaveChanges();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Пример #10
0
        private void LogInButtonClick(object sender, RoutedEventArgs e)
        {
            int result = ClientServerController.Login(LoginField.Text, PasswordField.Password);

            switch (result)
            {
            case 0:
                MessageBox.Show("Пользователя не существует", "Ошибка");
                break;

            case 1:
                MessageBox.Show("Неправильный пароль", "Ошибка");
                break;

            case 2:
                MessageBox.Show("Вход успешен", "Успех");
                OpenWindow();
                break;
            }
        }
Пример #11
0
 public Window1()
 {
     InitializeComponent();
     //Debug
     ClientServerController.Connect();
 }