コード例 #1
0
        private void Exit(object sender, RoutedEventArgs e)
        {
            RunnerManage runnerManage = new RunnerManage();

            runnerManage.Show();
            this.Close();
        }
コード例 #2
0
        private void Exit(object sender, RoutedEventArgs e)
        {
            RunnerManage editRunner = new RunnerManage();

            editRunner.Show();
            this.Close();
        }
コード例 #3
0
        private void Edit(object sender, RoutedEventArgs e)
        {
            string a = dgUsers.SelectedIndex.ToString();        // заготовка для исправления колхоза
            var    b = (RunnerControl)dgUsers.SelectedItems[0]; // выбираем одну строку поэтому и [0]

            ActiveUser.runnerControls = runners.Where(i => i.Email == b.Email).ToList();
            RunnerManage runnerManage = new RunnerManage();

            UserClass.UserId = context.Runner.Where(i => i.Email == b.Email).Select(i => i.RunnerId).First();
            UserClass.RegId  = context.Registration.Where(i => i.RunnerId == UserClass.UserId).Select(i => i.RegistrationId).First();

            runnerManage.NameLbl.Content              = runners.Where(i => i.Email == b.Email).Select(i => i.Name).First();
            runnerManage.SurLbl.Content               = runners.Where(i => i.Email == b.Email).Select(i => i.Surname).First();
            runnerManage.MaleLbl.Content              = runners.Where(i => i.Email == b.Email).Select(i => i.GenderCSV).First();
            runnerManage.DateOfBithLbl.Content        = runners.Where(i => i.Email == b.Email).Select(i => i.DateOfBith).First();
            runnerManage.CountryLbl.Content           = runners.Where(i => i.Email == b.Email).Select(i => i.CountryCSV).First();
            runnerManage.CharityLbl.Content           = runners.Where(i => i.Email == b.Email).Select(i => i.CharityName).First();
            runnerManage.CountCharityMoneyLbl.Content = runners.Where(i => i.Email == b.Email).Select(i => i.SponsorTarget).First();
            runnerManage.NaborLbl.Content             = runners.Where(i => i.Email == b.Email).Select(i => i.NuborCSV).First();
            runnerManage.DistanceLbl.Content          = runners.Where(i => i.Email == b.Email).Select(i => i.EventTypeMar).First();

            switch (runners.Where(i => i.Email == b.Email).Select(i => i.Status).First())
            {
            case "Registered":
                runnerManage.A.Background = Brushes.Green;
                break;

            case "Payment Confirmed":
                runnerManage.A.Background = Brushes.Green;
                runnerManage.B.Background = Brushes.Green;
                break;

            case "Race Kit Sent":
                runnerManage.A.Background = Brushes.Green;
                runnerManage.B.Background = Brushes.Green;
                runnerManage.C.Background = Brushes.Green;
                break;

            case "Race Attended":
                runnerManage.A.Background = Brushes.Green;
                runnerManage.B.Background = Brushes.Green;
                runnerManage.C.Background = Brushes.Green;
                runnerManage.D.Background = Brushes.Green;
                break;
            }

            runnerManage.EmailLbl.Content = b.Email.ToString();
            runnerManage.Show();
            this.Close();
        }