Пример #1
0
        private void addGroup_Clicked(object sender, RoutedEventArgs e)
        {
            Popup popup = new Popup();

            popup.Height         = 300;
            popup.Width          = 400;
            popup.VerticalOffset = 100;
            PopUP control = new PopUP();

            popup.Child  = control;
            popup.IsOpen = true;
            popup.HorizontalAlignment = HorizontalAlignment.Center;
            popup.VerticalAlignment   = VerticalAlignment.Center;
            Button        btnOK       = (global::Windows.UI.Xaml.Controls.Button)control.FindName("btnOK");
            TextBox       txt_Remarks = (global::Windows.UI.Xaml.Controls.TextBox)control.FindName("tbx");
            MessageDialog result;

            btnOK.Click += async(s, args) =>
            {
                popup.IsOpen = false;
                string        t     = txt_Remarks.Text;
                CreateGroupVM group = new CreateGroupVM();

                if (t != "")
                {
                    group.email = GlobalData.email;
                    group.name  = t;

                    CreateGroupRP res = await ApiCall.MakeCall <CreateGroupVM, CreateGroupRP>("createGroup", group);

                    if (res.success)
                    {
                        result = new MessageDialog("Your group was created successfully !");
                        await result.ShowAsync();

                        listView_Loaded(s, args);
                    }
                    popup.IsOpen = false;
                }
                else
                {
                    result = new MessageDialog("Error: The group wasn't able to be created.");
                    await result.ShowAsync();
                }
            };
        }
Пример #2
0
        private void addGroup_Clicked(object sender, RoutedEventArgs e)
        {
            Popup popup = new Popup();
            popup.Height = 300;
            popup.Width = 400;
            popup.VerticalOffset = 100;
            PopUP control = new PopUP();
            popup.Child = control;
            popup.IsOpen = true;
            popup.HorizontalAlignment = HorizontalAlignment.Center;
            popup.VerticalAlignment = VerticalAlignment.Center;
            Button btnOK = (global::Windows.UI.Xaml.Controls.Button)control.FindName("btnOK");
            TextBox txt_Remarks = (global::Windows.UI.Xaml.Controls.TextBox)control.FindName("tbx");
            MessageDialog result;
            btnOK.Click += async (s, args) =>
            {
               popup.IsOpen = false;
               string t = txt_Remarks.Text;
                CreateGroupVM group = new CreateGroupVM();

               if (t != "")
                {
                    group.email = GlobalData.email;
                   group.name = t;

                    CreateGroupRP res = await ApiCall.MakeCall<CreateGroupVM, CreateGroupRP>("createGroup", group);

                    if (res.success)
                    {
                        result = new MessageDialog("Your group was created successfully !");
                        await result.ShowAsync();
                        listView_Loaded(s, args);
                    }
                    popup.IsOpen = false;
                }
                else
                {
                    result = new MessageDialog("Error: The group wasn't able to be created.");
                    await result.ShowAsync();
                }
            };
        }