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

            Fon.BackgroundImageSource = ImageSource.FromResource(picture_lincs.GetFon());
            Head_Image.Source         = ImageSource.FromResource(picture_lincs.GetLogo());
            image_fon.Source          = ImageSource.FromResource(picture_lincs.GetFon());

            Save_More_Button.Clicked += async(s, e) =>
            {
                if (images.Length != 0)
                {
                    for (int i = 0; i < images.Length; i++)
                    {
                        await DownloadAndSaveImage(images[i]);
                    }
                }
            };

            Head_Button.Clicked            += async(s, e) => { await Navigation.PopModalAsync(); };
            Save_NewPicture_Button.Clicked += async(s, e) => { await getPhotoingaleriAsync(); };
            _client = new HttpClient();
            OnAppearing();
        }
Пример #2
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();
            };
        }
Пример #3
0
        public PhotoGaleri()
        {
            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());
            _client           = new HttpClient();
            LoadingAsync();

            Save_More_Button.Clicked += async(s, e) =>
            {
                for (int i = 0; i < images.Length; i++)
                {
                    await DownloadAndSaveImage(images[i]);
                }
            };
            Head_Button.Clicked += async(s, e) => { await Navigation.PopModalAsync(); };
        }
Пример #4
0
        public AdminPage()
        {
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };
            InitializeComponent();

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

            Block_Button_Main_Profil.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Main_One);
                //await Task.Delay(300);
                InfoUser loginUsers = await loginUsersService.Get(App.Current.Properties["token"].ToString());

                await Navigation.PushModalAsync(new PersonalAccountPage(loginUsers.IdUsers, false), animate);
            };

            Block_Button_Main_One.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Main_One);
                //await Task.Delay(300);
                await Navigation.PushModalAsync(new PartisipantMenuPage(), animate);
            };

            Block_Button_Main_Two.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Main_Two);
                //await Task.Delay(300);
                await Navigation.PushModalAsync(new UsersСontrolPage(), animate);
            };

            Block_Button_Main_Three.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Main_Three);
                //await Task.Delay(300);
                await Navigation.PushModalAsync(new RedactingGaleriPage(), animate);
            };

            //Block_Button_Main_Fore.Clicked += async (s, e) =>
            //{
            //    animations.Animations_Button(Block_Button_Main_Fore);
            //    await Task.Delay(300);
            //    await DisplayAlert("");
            //};
            Head_Button.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Head_Button);
                App.Current.Properties["token"] = "";
                //await Task.Delay(300);
                await Navigation.PushModalAsync(new MainPage(), animate);
            };
        }
Пример #5
0
        public MyResultPatisipantPage()
        {
            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();

            Back_Button.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Back_Button);
                //await Task.Delay(300);
                await Navigation.PopModalAsync();//Переход назад
            };

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

            ItogTime_Entry.TextChanged += async(s, e) =>
            {
                try
                {
                    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");
                    }
                }
                catch { }
            };
        }
Пример #6
0
        public PartisipantMenuPage()
        {
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };
            InitializeComponent();

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

            Block_Button_Main_One.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Main_One);
                //await Task.Delay(300);
                await Navigation.PushModalAsync(new DistantionPage(), animate);
            };

            Block_Button_Main_Two.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Main_Two);
                //await Task.Delay(300);
                await Navigation.PushModalAsync(new CompitentionsPage(), animate);
            };

            Block_Button_Main_Three.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Main_Three);
                //await Task.Delay(300);
                await Navigation.PushModalAsync(new ParticipationsPage(), animate);
            };

            Block_Button_Main_Fore.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Main_Fore);
                //await Task.Delay(300);
                await Navigation.PushModalAsync(new ResultParticipationPage(), animate);//новое соревнование
            };

            Head_Button.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Head_Button);
                //await Task.Delay(300);
                await Navigation.PopModalAsync(animate);
            };
        }
Пример #7
0
        public InfoMemuPage()
        {
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            InitializeComponent();
            image_fon.Source  = ImageSource.FromResource(picture_lincs.GetFon());
            Head_Image.Source = ImageSource.FromResource(picture_lincs.GetLogo());

            Head_Button.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Head_Button);
                //await Task.Delay(1000);
                await Navigation.PopModalAsync();//Переход назад
            };
            Block_Button_One.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_One);
                //await Task.Delay(1000);
                await Navigation.PushModalAsync(new PhotoGaleri());
            };
            Block_Button_Two.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Two);
                //await Task.Delay(1000);
                await Navigation.PushModalAsync(new InfoUsersPage());
            };
            Block_Button_Three.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Three);
                //await Task.Delay(1000);
                await Navigation.PushModalAsync(new InfoMapsPage());
            };
            Block_Button_Fore.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Block_Button_Fore);
                //await Task.Delay(1000);
                await Navigation.PushModalAsync(new InfoContactsPage());
            };
        }
        public MyPatisipantPage()
        {
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            InitializeComponent();
            Head_Image.Source = ImageSource.FromResource(picture_lincs.GetLogo());
            image_fon.Source  = ImageSource.FromResource(picture_lincs.GetFon());
            showEmployeeAsync(true);

            Back_Button.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Back_Button);
                //await Task.Delay(300);
                await Navigation.PopModalAsync();//Переход назад
            };

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

            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);
                }
            };
        }
Пример #9
0
        public PinLoginPage()
        {
            InitializeComponent();

            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            Fingers();
            Get_User();
            image_fon.Source  = ImageSource.FromResource(picture_lincs.GetFon());
            Head_Image.Source = ImageSource.FromResource(picture_lincs.GetLogo());
            //Button_del.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "Del_text.png");
            //One_Image.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "Circle_PIN.png");
            //Two_Image.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "Circle_PIN.png");
            //Three_Image.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "Circle_PIN.png");
            //Fore_Image.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "Circle_PIN.png");

            Exit_Button.Clicked += async(s, e) =>
            {
                App.Current.Properties["Login"]    = "";
                App.Current.Properties["Password"] = "";
                App.Current.Properties["pin_code"] = "";
                await Navigation.PushModalAsync(new LoginPage());
            };

            Button1.Clicked    += (s, e) => PIN_Validate(Button1.Text);
            Button2.Clicked    += (s, e) => PIN_Validate(Button2.Text);
            Button3.Clicked    += (s, e) => PIN_Validate(Button3.Text);
            Button4.Clicked    += (s, e) => PIN_Validate(Button4.Text);
            Button5.Clicked    += (s, e) => PIN_Validate(Button5.Text);
            Button6.Clicked    += (s, e) => PIN_Validate(Button6.Text);
            Button7.Clicked    += (s, e) => PIN_Validate(Button7.Text);
            Button8.Clicked    += (s, e) => PIN_Validate(Button8.Text);
            Button9.Clicked    += (s, e) => PIN_Validate(Button9.Text);
            Button0.Clicked    += (s, e) => PIN_Validate(Button0.Text);
            Button_del.Clicked += (s, e) => PIN_Del();
        }
Пример #10
0
        public InfoMapsPage()
        {
            InitializeComponent();
            InfoUser_WebView.Source = "http://90.189.158.10/Maps/index.html";
            Head_Image.Source       = ImageSource.FromResource(picture_lincs.GetLogo());
            image_fon.Source        = ImageSource.FromResource(picture_lincs.GetFon());
            LoadingAsync();

            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };

            Head_Button.Clicked += async(s, e) => { await Navigation.PopModalAsync(); };
        }
Пример #11
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);
            };
        }
Пример #12
0
        public InfoUsersPage()
        {
            _client = new HttpClient();

            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());
            InitializeComponent();
            LoadingAsync();
            Save_Button.Clicked += async(s, e) => { await DownloadAndSaveImage(pdfUrl); };
            Head_Button.Clicked += async(s, e) => { await Navigation.PopModalAsync(); };
        }
Пример #13
0
        public InfoContactsPage()
        {
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };
            InitializeComponent();

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

            Head_Button.Clicked += async(s, e) => await Navigation.PopModalAsync();

            Block_Button_One.Clicked += async(s, e) => await SetPhoneCellAsync();

            Block_Button_Two.Clicked += (s, e) => PopupNavigation.Instance.PushAsync(new GetMasagesPopupPage());
        }
Пример #14
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();
                                                                         }
            };                                                                                                                        // обработка изменения состояния подключения
        }
Пример #15
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();
                }
            };
        }
Пример #16
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 { }
            };
        }
Пример #17
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 { }
            };
        }
Пример #18
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();
                }
            };
        }
        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");
                }
            };
        }
Пример #20
0
        public AddUsersPage(int id, string status_form)
        {
            InitializeComponent();

            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += (s, e) => { if (!connectClass.CheckConnection())
                                                                         {
                                                                             Connect_ErrorAsync();
                                                                         }
            };
            get_users(id);
            GetPicerAsync();

            if (id == 0 && status_form == "MainPage" || status_form == "Redacting")
            {
                Rol_Picker.IsEnabled = false;
                RolUser = "******";
            }

            Pol_Picer.SelectedIndex  = 1;
            Rol_Picker.SelectedIndex = 1;
            pol = true;

            User_Image.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "nophotouser.png");
            image_fon.Source  = ImageSource.FromResource(picture_lincs.GetFon());
            //Users_Fon_Images.Source = ImageSource.FromResource(picture_lincs.LinksResourse() + "UserFon.png");
            password_status_image.Source   = ImageSource.FromResource(picture_lincs.LinksResourse() + "anvisible_password.png");//Инициализация статуса пароля
            password_status_image.Clicked += (s, e) => { Password_IsVisible(); };

            Pol_Picer.SelectedIndexChanged += (s, e) =>
            {
                if (Pol_Picer.Items[Pol_Picer.SelectedIndex].ToString() == "Мужской")
                {
                    pol = true;
                }
                else
                {
                    pol = false;
                }
            };
            Rol_Picker.SelectedIndexChanged += (s, e) =>
            {
                if (Rol_Picker.Items[Rol_Picker.SelectedIndex].ToString() == "Администратор")
                {
                    RolUser = "******";
                }
                else
                {
                    RolUser = "******";
                }
            };

            Registrations_Button.Clicked += async(s, e) =>
            {
                if (id == 0)
                {
                    await reg_userAsync(status_form);
                }
                else
                {
                    await update_userAsync(id);
                }
            };

            Save_Picture_Button.Clicked += async(s, e) =>
            {
                if (Device.RuntimePlatform == Device.Android)
                {
                    await getPhotoingaleriAsync();
                }
                else
                {
                    if (await DisplayAlert("", "Сделать снимок ?", "Да", "Нет"))
                    {
                        await takePhotoAsync();
                    }
                    else
                    {
                        await getPhotoingaleriAsync();
                    }
                }
            };

            Back_Button.Clicked += async(s, e) =>
            {
                //animations.Animations_Button(Back_Button);
                //await Task.Delay(1000);
                await Navigation.PopModalAsync();//Переход назад
            };
            Generate_Password_CheckBox.CheckedChanged += (s, e) =>
            {
                if (!Generate_Password_CheckBox.IsChecked)
                {
                    Password_Entry.Text        = "";
                    Password_Replay_Entry.Text = "";
                }
                else
                {
                    string password = get_Password.GetPassword();
                    Password_Entry.Text        = password;
                    Password_Replay_Entry.Text = password;
                }
            };
            Login_Entry.TextChanged += async(s, e) =>
            {
                if (Login_Entry.Text.Length == 17 && id == 0)
                {
                    IEnumerable <InfoUser> info = await registrationUsersService.Get_user();

                    var get = info.FirstOrDefault(x => x.Login == Login_Entry.Text);
                    if (get != null)
                    {
                        Error_Login_RowDefinition.Height = 40;
                        Error_Login_Lable.Text           = "Пользоватьль с таким логином уже существует";
                    }
                    else
                    {
                        Error_Login_RowDefinition.Height = 0;
                        Error_Login_Lable.Text           = "";
                    }
                }
            };
            Fam_Entry.TextChanged += (s, e) =>
            {
                if (Fam_Entry.Text != null && Fam_Entry.Text.Length == 1)
                {
                    Fam_Entry.Text = Fam_Entry.Text.Substring(0, 1).ToUpper() + Fam_Entry.Text.Substring(1);
                }
            };
            Name_Entry.TextChanged += (s, e) =>
            {
                if (Name_Entry.Text != null && Name_Entry.Text.Length == 1)
                {
                    Name_Entry.Text = Name_Entry.Text.Substring(0, 1).ToUpper() + Name_Entry.Text.Substring(1);
                }
            };
            Patronymic_Entry.TextChanged += (s, e) =>
            {
                if (Patronymic_Entry.Text != null && Patronymic_Entry.Text.Length == 1)
                {
                    Patronymic_Entry.Text = Patronymic_Entry.Text.Substring(0, 1).ToUpper() + Patronymic_Entry.Text.Substring(1);
                }
            };
            Yars_Entry.TextChanged += (s, e) =>
            {
                if (!Int32.TryParse(Yars_Entry.Text, out int num))
                {
                    Yars_Entry.Text = "";
                }
            };
            Password_Entry.TextChanged += (s, e) =>
            {
            };
            Password_Replay_Entry.TextChanged += (s, e) =>
            {
            };
        }
Пример #21
0
        public MainPage()
        {
            InitializeComponent();
            if (!App.Current.Properties.TryGetValue("Login", out object Login))
            {
                App.Current.Properties.Add("Login", "");
            }

            if (!App.Current.Properties.TryGetValue("Password", out object Password))
            {
                App.Current.Properties.Add("Password", "");
            }
            if (!App.Current.Properties.TryGetValue("token", out object token))
            {
                App.Current.Properties.Add("token", "");
            }
            if (!App.Current.Properties.TryGetValue("pin_code", out object pin_code))
            {
                App.Current.Properties.Add("pin_code", "");
            }
            if (!connectClass.CheckConnection())
            {
                Connect_ErrorAsync();
            }                                                             //Проверка интернета при загрузке формы
            CrossConnectivity.Current.ConnectivityChanged += async(s, e) =>
            {
                if (!connectClass.CheckConnection())
                {
                    await Connect_ErrorAsync();
                }
                else
                {
                    GetImageListAsync();
                }
            };

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

            Head_Image.Source = ImageSource.FromResource(picture_lincs.GetLogo());

            _client = new HttpClient();
            //Device.StartTimer(TimeSpan.FromSeconds(20), OnTimerTick);
            Slider_Left_Bt.Clicked  += (s, e) => Slider_Left_Function();
            Slider_Right_Bt.Clicked += (s, e) => Slider_Right_Function();
            Head_Button.Clicked     += async(s, e) =>
            {
                alive = false;
                await LoginAsync();
            };
            Block_Button_One.Clicked += async(s, e) =>
            {
                alive = false;
                await Navigation.PushModalAsync(new AddUsersPage(0, "MainPage"), animate);
            };
            Block_Button_Tho.Clicked += async(s, e) =>
            {
                alive = false;
                await LoginAsync();
            };
            Block_Button_Three.Clicked += async(s, e) =>
            {
                alive = false;
                await Navigation.PushModalAsync(new InfoMemuPage(), animate);
            };

            GetImageListAsync();
        }
Пример #22
0
        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");
                        }
                    }
                }
            };
        }