Esempio n. 1
0
        public GegShempionatePage()
        {
            InitializeComponent();
            GetUser();
            Criate_CompetentionsPicer();
            // Criate_CompetentionsPicer(false);
            Criate_SelectDate(false);
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            Users_Fon_Images.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "UserFon.png");
            image_fon.Source        = ImageSource.FromResource(picture_lincs.GetFon());
            Back_Button.Clicked    += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(300);

                await Navigation.PopModalAsync();//Переход назад
            };

            Registrations_Button.Clicked += async(s, e) =>
            {
                await Criate();
            };
        }
        public AddPaticipationsPage(int id)
        {
            InitializeComponent();
            // get_infa(id);
            Criate_LoginPicer(false);
            Criate_CompetentionsPicer(false);
            Criate_SelectDate(false);
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            // Fon.BackgroundImageSource = ImageSource.FromResource(picture_lincs.GetFon()); ;//Устанавливаем фон
            Users_Fon_Images.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "UserFon.png");

            Back_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(1000);

                await Navigation.PopModalAsync();//Переход назад
            };
            PoiskLogin.TextChanged += async(s, e) =>
            {
                if (PoiskLogin.Text != null)
                {
                    await Criate_LoginPicer(true);
                }
            };

            PoiskCompetentions.TextChanged += async(s, e) =>
            {
                if (PoiskCompetentions.Text != null)
                {
                    await Criate_CompetentionsPicer(true);
                }
            };

            Registrations_Button.Clicked += async(s, e) =>
            {
                if (id != 0)
                {
                    await Update(id);
                }
                else
                {
                    await Criate();
                }
            };
        }
Esempio n. 3
0
        public PersonalAccountPage(int id, bool IsAdmin)
        {
            InitializeComponent();
            Get(id);
            if (IsAdmin)
            {
                Redact_Button.IsVisible = false;
                Profile_Lable.Text      = "Профиль участника";
            }
            else
            {
                Redact_Button.IsVisible = true;
                Profile_Lable.Text      = "Мой профиль";
            }

            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };
            Redact_Button.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "redact_user.jpg");
            Head_Image.Source    = ImageSource.FromResource(picture_lincs.GetLogo());
            image_fon.Source     = ImageSource.FromResource(picture_lincs.GetFon());

            Head_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Head_Button);
                await Task.Delay(300);

                await Navigation.PopModalAsync();
            };

            Redact_Button.Clicked += async(s, e) =>
            {
                await Navigation.PushModalAsync(new AddUsersPage(ID, "Redacting"), animate);
            };
        }
Esempio n. 4
0
        public CompitentionsPage()
        {
            InitializeComponent();
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            showEmployeeAsync(true);

            image_fon.Source  = ImageSource.FromResource(picture_lincs.GetFon());
            Head_Image.Source = ImageSource.FromResource(picture_lincs.GetLogo());
            Device.StartTimer(TimeSpan.FromSeconds(10), OnTimerTickAsync);

            Back_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(1000);

                await Navigation.PopModalAsync();//Переход назад
            };

            PoiskDate.TextChanged += async(s, e) =>
            {
                if (PoiskDate.Text.Length == 10)
                {
                    string a     = PoiskDate.Text;
                    int    day   = Convert.ToInt32(a.Remove(2, 8));
                    int    mouns = Convert.ToInt32(a.Remove(0, 3).Remove(2, 5));
                    int    yars  = Convert.ToInt32(a.Remove(0, 6));
                    SelectedDate = new DateTime(yars, mouns, day);
                    await Poisk("PoiskDate");
                }
                else
                {
                    await showEmployeeAsync(false);
                }
            };

            btnAddRecord.Clicked += async(s, e) =>
            {
                string res = await DisplayActionSheet("Выберите операцию", "Отмена", null, "Добавить данные", "Импортировать данные", "Экспортировать данные");

                switch (res)
                {
                case "Добавить данные":
                    animations.Animations_Button(btnAddRecord);
                    await Task.Delay(300);

                    int nul = 0;
                    await Navigation.PushModalAsync(new AddCompitentionsPage(nul), animate);

                    break;

                case "Импортировать данные":
                    await Import();

                    break;

                case "Экспортировать данные":
                    string res_export = await DisplayActionSheet("Выберите операцию", "Отмена", null, "Скачать шаблон", "Экспортировать");

                    switch (res_export)
                    {
                    case "Скачать шаблон":
                        await DownloadSimple();

                        break;

                    case "Экспортировать":
                        await Export();

                        break;
                    }
                    break;
                }
            };

            PoiskName.TextChanged += async(s, e) =>
            {
                try
                {
                    await Poisk("PoiskName");
                }
                catch { }
            };
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        public DistantionPage()
        {
            InitializeComponent();
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };
            image_fon.Source = ImageSource.FromResource(picture_lincs.GetFon());

            Head_Image.Source = ImageSource.FromResource(picture_lincs.GetLogo());
            showEmployeeAsync();
            Device.StartTimer(TimeSpan.FromSeconds(10), OnTimerTickAsync);
            Back_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(300);

                await Navigation.PopModalAsync();//Переход назад
            };

            btnAddRecord.Clicked += async(s, e) =>
            {
                string res = await DisplayActionSheet("Выберите операцию", "Отмена", null, "Добавить данные", "Импортировать данные", "Экспортировать данные");

                switch (res)
                {
                case "Добавить данные":

                    int nul = 0;
                    await Navigation.PushModalAsync(new AddDistantionsPage(nul), animate);

                    break;

                case "Импортировать данные":
                    await Import();

                    break;

                case "Экспортировать данные":
                    string res_export = await DisplayActionSheet("Выберите операцию", "Отмена", null, "Скачать шаблон", "Экспортировать");

                    switch (res_export)
                    {
                    case "Скачать шаблон":
                        await DownloadSimple();

                        break;

                    case "Экспортировать":
                        await Export();

                        break;
                    }
                    break;
                }
            };

            PoiskName.TextChanged += async(s, e) =>
            {
                try
                {
                    await Poisk("PoiskName");
                }
                catch { }
            };
            PoiskDiscript.TextChanged += async(s, e) =>
            {
                try
                {
                    await Poisk("PoiskDiscript");
                }
                catch { }
            };
            PoiskLengs.TextChanged += async(s, e) =>
            {
                try
                {
                    await Poisk("PoiskLengs");
                }
                catch { }
            };
        }
        public ResultParticipationPage()
        {
            InitializeComponent();
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            image_fon.Source = ImageSource.FromResource(picture_lincs.GetFon());

            Head_Image.Source = ImageSource.FromResource(picture_lincs.GetLogo());
            showEmployeeAsync();
            Device.StartTimer(TimeSpan.FromSeconds(10), OnTimerTickAsync);

            Back_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(300);

                await Navigation.PopModalAsync();//Переход назад
            };

            btnAddRecord.Clicked += async(s, e) =>
            {
                string res = await DisplayActionSheet("Выберите операцию", "Отмена", null, "Добавить", "Импортировать", "Экспортировать", "Сформировать отчет", "Статистика");

                switch (res)
                {
                case "Добавить":
                    animations.Animations_Button(btnAddRecord);
                    await Task.Delay(300);

                    int nul = 0;
                    await Navigation.PushModalAsync(new AddResultParticipationPagePage(nul), animate);

                    break;

                case "Импортировать":
                    await Import();

                    break;

                case "Экспортировать":
                    string res_select = await DisplayActionSheet("Выберите операцию", "Отмена", null, "Скачать шаблон", "Экспортировать");

                    switch (res_select)
                    {
                    case "Скачать шаблон":
                        await DownloadSimple();

                        break;

                    case "Экспортировать":
                        await Export();

                        break;
                    }
                    break;

                case "Сформировать результирующий отчет":
                    await Otchet(1);

                    break;

                case "Статистика":
                    await Navigation.PushModalAsync(new StatisticsPage());

                    break;
                }
            };

            PoiskLogin.TextChanged += async(s, e) =>
            {
                await Poisk("PoiskLogin");
            };

            PoiskNameDistans.TextChanged += async(s, e) =>
            {
                await Poisk("PoiskNameDistans");
            };

            PoiskStatus.TextChanged += async(s, e) =>
            {
                await Poisk("PoiskMesto");
            };

            ItogTime_Entry.TextChanged += async(s, e) =>
            {
                if (ItogTime_Entry.Text.Length == 11)
                {
                    string   a        = ItogTime_Entry.Text;
                    int      hour     = Convert.ToInt32(a.Remove(2, 9));
                    int      min      = Convert.ToInt32(a.Remove(0, 4).Remove(0, 5));
                    int      sec      = Convert.ToInt32(a.Remove(0, 6).Remove(2, 3));
                    int      milisec  = Convert.ToInt32(a.Remove(0, 9));
                    DateTime dateTime = DateTime.Now;
                    TimeSpan ts       = new TimeSpan(1, hour, min, sec, milisec);
                    dateTime = dateTime.Date + ts;
                    ID_Time  = dateTime;
                    await Poisk("PoiskDate");
                }
            };
        }
        public AddCompitentionsPage(int id)
        {
            InitializeComponent();
            get_infa(id);
            Criate_Picer();
            today_date = DateTime.Now.AddDays(3);
            string mons  = "";
            string hours = "";
            string mins  = "";

            if (today_date.Month < 10)
            {
                mons = "0" + today_date.Month.ToString();
            }
            else
            {
                mons = today_date.Month.ToString();
            }
            if (today_date.Hour < 10)
            {
                hours = "0" + today_date.Hour.ToString();
            }
            else
            {
                hours = today_date.Hour.ToString();
            }
            if (today_date.Minute < 10)
            {
                mins = "0" + today_date.Minute.ToString();
            }
            else
            {
                mins = today_date.Minute.ToString();
            }
            Time_Picrt.Text = today_date.Day.ToString() + "-" + mons + "-" + today_date.Year.ToString() + " " + hours + ":" + mins;
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            image_fon.Source        = ImageSource.FromResource(picture_lincs.GetFon());//Устанавливаем фон
            Users_Fon_Images.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "UserFon.png");

            Back_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(300);

                await Navigation.PopModalAsync();//Переход назад
            };

            Time_Picrt.TextChanged += (s, e) =>
            {
                if (Time_Picrt.Text.Length == 16)
                {
                    string   a             = Time_Picrt.Text;
                    int      day           = Convert.ToInt32(a.Remove(2, 14));
                    int      mouns         = Convert.ToInt32(a.Remove(0, 3).Remove(2, 11));
                    int      yars          = Convert.ToInt32(a.Remove(0, 6).Remove(4, 6));
                    int      hour          = Convert.ToInt32(a.Remove(0, 11).Remove(2, 3));
                    int      minuts        = Convert.ToInt32(a.Remove(0, 14));
                    DateTime selectad_time = new DateTime(yars, mouns, day, hour, minuts, 0);
                    if (selectad_time >= today_date.AddDays(-1))
                    {
                    }
                    else
                    {
                        DisplayAlert("Предупреждение", "Создать компетенцию можно не познее чем за 3 дня до соревнования", "Ok");
                    }
                }
            };

            Registrations_Button.Clicked += async(s, e) =>
            {
                if (id != 0)
                {
                    await Update(id);
                }
                else
                {
                    if (Time_Picrt.Text.Length == 16)
                    {
                        string   a             = Time_Picrt.Text;
                        int      day           = Convert.ToInt32(a.Remove(2, 14));
                        int      mouns         = Convert.ToInt32(a.Remove(0, 3).Remove(2, 11));
                        int      yars          = Convert.ToInt32(a.Remove(0, 6).Remove(4, 6));
                        int      hour          = Convert.ToInt32(a.Remove(0, 11).Remove(2, 3));
                        int      minuts        = Convert.ToInt32(a.Remove(0, 14));
                        DateTime selectad_time = new DateTime(yars, mouns, day, hour, minuts, 0);
                        if (selectad_time >= today_date)
                        {
                            Time = selectad_time;
                            IEnumerable <Competentions> competentions = await competentionsServise.Get();

                            IEnumerable <Distantion> distantions = await distantionsServise.Get();

                            var info = from d in distantions
                                       join i in competentions on d.IdDistantion equals i.IdDistantion
                                       select new
                            {
                                d.NameDistantion,
                                i.Date,
                            };
                            info = info.Where(p => p.NameDistantion == picker.Items[picker.SelectedIndex] && p.Date == Time);
                            int res = info.Count();
                            if (res == 0)
                            {
                                await Criate();
                            }
                            else
                            {
                                await DisplayAlert("Ошибка", "Компетенция с такими параметрами существует", "Ok");
                            }
                        }
                        else
                        {
                            await DisplayAlert("Предупреждение", "Создать компетенцию можно не познее чем за 3 дня до соревнования", "Ok");
                        }
                    }
                }
            };
        }
Esempio n. 8
0
        public AddResultParticipationPagePage(int id)
        {
            InitializeComponent();
            Criate_LoginPicer(false);
            Criate_SelectCompitentions(false, false);
            Info_Editor.IsEnabled = false;
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            image_fon.Source        = ImageSource.FromResource(picture_lincs.GetFon());
            Users_Fon_Images.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "UserFon.png");

            Back_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(1000);

                await Navigation.PopModalAsync();//Переход назад
            };
            PoiskLogin.TextChanged += async(s, e) =>
            {
                if (PoiskLogin.Text != null)
                {
                    await Criate_LoginPicer(true);
                }
            };

            PoiskCompetentions.TextChanged += async(s, e) =>
            {
                if (PoiskCompetentions.Text != null)
                {
                    await Criate_SelectCompitentions(true, false);
                }
            };

            ItogTime_Entry.TextChanged += (s, e) =>
            {
                if (ItogTime_Entry.Text.Length == 11)
                {
                    string   a        = ItogTime_Entry.Text;
                    int      hour     = Convert.ToInt32(a.Remove(2, 9));
                    int      min      = Convert.ToInt32(a.Remove(0, 4).Remove(0, 5));
                    int      sec      = Convert.ToInt32(a.Remove(0, 6).Remove(2, 3));
                    int      milisec  = Convert.ToInt32(a.Remove(0, 9));
                    DateTime dateTime = DateTime.Now;
                    TimeSpan ts       = new TimeSpan(1, hour, min, sec, milisec);
                    dateTime = dateTime.Date + ts;
                    ID_Time  = dateTime;
                }
            };

            Registrations_Button.Clicked += async(s, e) =>
            {
                if (id != 0)
                {
                    await Update(id);
                }
                else
                {
                    await Criate();
                }
            };
        }
Esempio n. 9
0
        public LoginPage()
        {
            InitializeComponent();
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();                                 //Проверка интернет соединения
            }
            string PIN = App.Current.Properties["pin_code"].ToString();

            if (PIN.Length > 0)
            {
                AutoLogin_CheckBox.IsChecked = true;
            }
            else
            {
                AutoLogin_CheckBox.IsChecked = false;
            }
            image_fon.Source             = ImageSource.FromResource(picture_lincs.GetFon());
            password_status_image.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "anvisible_password.png");
            Users_Fon_Images.Source      = ImageSource.FromResource(picture_lincs.LinksResourse() + "UserFon.png");
            Password_Entry.Text          = "";

            AutoLogin_CheckBox.CheckedChanged += async(s, e) => { await AutoLogin_CheckedChangedAsync(); };

            Head_Lable.FontSize   = Device.GetNamedSize(NamedSize.Large, typeof(Label));
            Login_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Login_Button);
                await Login_Async();
            };
            TapGestureRecognizer tapGesture = new TapGestureRecognizer //Распознание жеста косания
            {
                NumberOfTapsRequired = 1
            };

            tapGesture.Tapped += async(s, e) => //Обработка касания
            {
                try
                {
                    if (Login_Entry.Text.Length == 17 && Login_Entry.Text.Length > 0)
                    {
                        string id = await GetClient();

                        if (id != null)
                        {
                            Error_Password_Lable.TextColor = Color.Red;
                            await Task.Delay(300);

                            await PopupNavigation.Instance.PushAsync(new DoubleAuthPage(Convert.ToInt32(id), "ReplisPasswd"));
                        }
                        else
                        {
                            await DisplayAlert("Ошибка", "Логин не указан,необходимо указать логин", "Ok");
                        }
                    }
                    else
                    {
                        await DisplayAlert("Предупреждение", "Необходимо указать логин", "Ok");
                    }
                }
                catch { await DisplayAlert("Предупреждение", "Необходимо указать логин", "Ok"); }
            };
            Passwd_Lable.GestureRecognizers.Add(tapGesture);
            Back_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(300);

                await Navigation.PopModalAsync();//Переход назад
            };
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };                                                                                                                        // обработка изменения состояния подключения
        }
Esempio n. 10
0
        public AddDistantionsPage(int id)
        {
            InitializeComponent();
            get_infa(id);
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            image_fon.Source        = ImageSource.FromResource(picture_lincs.GetFon());//Устанавливаем фон
            Users_Fon_Images.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "UserFon.png");

            Back_Button.Clicked += async(s, e) =>
            {
                animations.Animations_Button(Back_Button);
                await Task.Delay(1000);

                await Navigation.PopModalAsync();//Переход назад
            };

            Lengh_Entry.TextChanged += async(s, e) =>
            {
                try
                {
                    decimal num;
                    if (!decimal.TryParse(Lengh_Entry.Text, out num))
                    {
                        Lengh_Entry.Text = null;
                    }
                    if (Lengh_Entry.Text.Length > 0)
                    {
                        await test_length();
                    }
                }
                catch { }
            };

            Name_Entry.TextChanged += async(s, e) =>
            {
                try
                {
                    if (Name_Entry.Text.Length > 2)
                    {
                        await test_distans();
                    }
                }
                catch { }
            };

            Registrations_Button.Clicked += async(s, e) =>
            {
                if (id != 0)
                {
                    await Update(id);
                }
                else
                {
                    await Criate();
                }
            };
        }