Ejemplo n.º 1
0
        private void Подпись_на_услугу_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            BG.Visibility           = Visibility.Hidden;
            data_service.Visibility = Visibility.Hidden;
            grid_h.Visibility       = Visibility.Hidden;
            CloseBtn.Visibility     = Visibility.Hidden;
            web_site.Visibility     = Visibility.Hidden;
            search_needy.Visibility = Visibility.Hidden;
            //
            service_add.Visibility = Visibility.Visible;

            var settings = new ServerMetaDats()
            {
                TypeClassSend = "Employees",
                SendMessage   = true,
                GetItem       = true,
                GetType       = 1
            };
            var curator = string.Empty;

            DataSender.OperationDataSend(JsonSerializer.Serialize(settings));
            DataSender.OperationDataSend(JsonSerializer.Serialize(curator));
            _curators = GetDict(JsonSerializer.Deserialize <List <string> >(DataSender.Message));
            curator_list.ItemsSource = JsonSerializer.Deserialize <List <string> >(DataSender.Message);

            var settings1 = new ServerMetaDats()
            {
                TypeClassSend = "Service",
                SendMessage   = true,
                GetItem       = true
            };
            var services = string.Empty;

            DataSender.OperationDataSend(JsonSerializer.Serialize(settings1));
            DataSender.OperationDataSend(JsonSerializer.Serialize(services));
            _services = GetDict(JsonSerializer.Deserialize <List <Service> >(DataSender.Message)
                                .Select(x => x.ServiceName)
                                .ToList());
            service_list.ItemsSource = JsonSerializer.Deserialize <List <Service> >(DataSender.Message).
                                       Select(x => x.ServiceName);
        }
Ejemplo n.º 2
0
        private void Check_Needy_Btn2(object sender, RoutedEventArgs e)
        {
            datagrid_search_needy.Visibility         = Visibility.Visible;
            datagrid_search_needy_curator.Visibility = Visibility.Hidden;
            f1_btn.Visibility = Visibility.Hidden;
            f2_btn.Visibility = Visibility.Hidden;
            var settings = new ServerMetaDats()
            {
                TypeClassSend = "Help",
                SendMessage   = true,
                GetItem       = true,
                GetType       = 3
            };

            var empty = string.Empty;

            DataSender.OperationDataSend(JsonSerializer.Serialize(settings));
            DataSender.OperationDataSend(JsonSerializer.Serialize(empty));

            datagrid_search_needy.ItemsSource = JsonSerializer.Deserialize <List <Help> >(DataSender.Message);
        }
Ejemplo n.º 3
0
        private void Услуги_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            BG.Visibility          = Visibility.Hidden;
            web_site.Visibility    = Visibility.Hidden;
            grid_h.Visibility      = Visibility.Hidden;
            CloseBtn.Visibility    = Visibility.Hidden;
            service_add.Visibility = Visibility.Hidden;
            //
            data_service.Visibility = Visibility.Visible;
            var settings = new ServerMetaDats()
            {
                TypeClassSend = "Service",
                SendMessage   = true,
                GetItem       = true
            };
            var services = string.Empty;

            DataSender.OperationDataSend(JsonSerializer.Serialize(settings));
            DataSender.OperationDataSend(JsonSerializer.Serialize(services));
            data_service.ItemsSource = JsonSerializer.Deserialize <List <Service> >(DataSender.Message);
        }
Ejemplo n.º 4
0
        private void Out_Click(object sender, RoutedEventArgs e)
        {
            var settings = new ServerMetaDats()
            {
                TypeClassSend = "Help",
                UpdateItem    = true,
                SendMessage   = true,
                GetType       = 1
            };
            var needy = datagrid_search_needy_curator.SelectedItem as Help;

            var help = new Help()
            {
                HelpNeedyName = needy.HelpNeedyName,
                HelpMark      = "Ожидается"
            };


            DataSender.OperationDataSend(JsonSerializer.Serialize(settings));
            DataSender.OperationDataSend(JsonSerializer.Serialize(help));
            Check_Needy_Btn1(sender, e);
        }
Ejemplo n.º 5
0
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            if (Validations.IsNull(needy_name.Text))
            {
                return;
            }

            var settings = new ServerMetaDats()
            {
                TypeClassSend = "Help",
                SendMessage   = true,
                GetItem       = true,
                GetType       = 1
            };

            var helpNeedyName = needy_name.Text;

            DataSender.OperationDataSend(JsonSerializer.Serialize(settings));
            DataSender.OperationDataSend(JsonSerializer.Serialize(helpNeedyName));

            data_subscribe_service.ItemsSource = JsonSerializer.Deserialize <List <Help> >(DataSender.Message);
        }
Ejemplo n.º 6
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var settings = new ServerMetaDats()
            {
                TypeClassSend = "Users",
                SendMessage   = true,
                GetItem       = true,
                GetType       = 1
            };
            var userSend = new Users()
            {
                UserMail     = Mail.Text,
                UserPassword = Password.Password,
            };

            DataSender.OperationDataSend(JsonSerializer.Serialize(settings));
            DataSender.OperationDataSend(JsonSerializer.Serialize(userSend));
            var userGet = JsonSerializer.Deserialize <Users>(DataSender.Message);

            switch (userGet?.UserRoleId)
            {
            case 1:
                var settings2 = new ServerMetaDats()
                {
                    TypeClassSend = "Employees",
                    SendMessage   = true,
                    GetItem       = true,
                    GetType       = 2
                };
                var admin = string.Empty;

                DataSender.OperationDataSend(JsonSerializer.Serialize(settings2));
                DataSender.OperationDataSend(JsonSerializer.Serialize(admin));

                var adm = (JsonSerializer.Deserialize <List <Employees> >(DataSender.Message))
                          .First(x => x.EmployeesMail == userGet.UserMail);
                var adminWindow = new AdminWindow(userGet, adm);
                adminWindow.Show();
                Close();
                break;

            case 2:
                var userWindow = new UserWindow(userGet);
                userWindow.Show();
                Close();
                break;

            case 3:
                var guestWindow = new GuestWindow();
                guestWindow.Show();
                Close();
                break;

            case 4:
                var settings1 = new ServerMetaDats()
                {
                    TypeClassSend = "Employees",
                    SendMessage   = true,
                    GetItem       = true,
                    GetType       = 2
                };
                var curator = string.Empty;

                DataSender.OperationDataSend(JsonSerializer.Serialize(settings1));
                DataSender.OperationDataSend(JsonSerializer.Serialize(curator));

                var eml = (JsonSerializer.Deserialize <List <Employees> >(DataSender.Message))
                          .First(x => x.EmployeesMail == userGet.UserMail);

                var employeesWindow = new EmployeeWindow(userGet, eml);
                employeesWindow.Show();
                Close();
                break;
            }
        }