Ejemplo n.º 1
0
        private async void dataGrid_CellEditEnded(object sender, Microsoft.Toolkit.Uwp.UI.Controls.DataGridCellEditEndedEventArgs e)//Проверка ячеек после изменения
        {
            usersclone = await De_Serialization.Deserialisation <List <UserData> >("UserData.xml", CreationCollisionOption.OpenIfExists, users);

            if (e.Column.Header.ToString() == "DisciplineType")
            {
                var  item    = (UserData)dataGrid.SelectedItem;
                bool confirm = false;
                if (item.AccountType == 0)
                {
                    foreach (string group in groups)
                    {
                        if (group == item.DisciplineType)
                        {
                            confirm = true;
                            break;
                        }
                    }
                }
                if (!confirm)
                {
                    users[dataGrid.SelectedIndex].DisciplineType = usersclone[dataGrid.SelectedIndex].DisciplineType;
                    dataGrid.ItemsSource = new List <UserData>();
                    dataGrid.ItemsSource = users;
                }
            }

            if (e.Column.Header.ToString() == "AccountType")
            {
                if (users[dataGrid.SelectedIndex].AccountType > 2 || users[dataGrid.SelectedIndex].AccountType < 0)
                {
                    users[dataGrid.SelectedIndex].AccountType = usersclone[dataGrid.SelectedIndex].AccountType;
                }
            }
        }
Ejemplo n.º 2
0
 private void UsersGrid_CellEditEnded(object sender, Microsoft.Toolkit.Uwp.UI.Controls.DataGridCellEditEndedEventArgs e)
 {
     if (users[UsersGrid.SelectedIndex].Role != "Student")
     {
         users[UsersGrid.SelectedIndex].Group = "";
     }
     DataAccessClass.ChangeUserData(users[UsersGrid.SelectedIndex].Id, users[UsersGrid.SelectedIndex].Login, users[UsersGrid.SelectedIndex].Password, users[UsersGrid.SelectedIndex].Role, users[UsersGrid.SelectedIndex].Group);
 }
Ejemplo n.º 3
0
 private void ProfileCategoryDataGrid_CellEditEnded(object sender, Microsoft.Toolkit.Uwp.UI.Controls.DataGridCellEditEndedEventArgs e)
 {
     this.SaveProfleCategoriesButton.Visibility = Visibility.Visible;
 }