private async void Create_Clicked(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Helpers.Settings.LoginUser))
            {
                Event events = new Event();
                events.Title       = lblEventName.Text;
                events.Body        = lblEventDetails.Text;
                events.Author      = userGroup[organizer.SelectedIndex];
                events.Location    = lblLocation.Text;
                events.Published   = lblDate.Date + lblTime.Time;
                events.ImageSource = "https://www.oldmissioncapital.com/wp-content/uploads/icon-people.png";

                bool x = await restServices.SaveItemAsync(events, true);

                if (x)
                {
                    lblEventName.Text    = "";
                    lblEventDetails.Text = "";
                    lblLocation.Text     = "";
                    Console.WriteLine("EventPortal : successfully upload data..");
                    PopupSingle p = new PopupSingle();
                    await Navigation.PushPopupAsync(p);
                }
                else
                {
                    Console.WriteLine("EventPortal : Error occured uploading data..");
                }
            }
            else
            {
                UnableCreateEvent p = new UnableCreateEvent();
                await Navigation.PushPopupAsync(p);
            }
        }
示例#2
0
        private async void CreateNewUserClicked(object sender, EventArgs e)
        {
            User user = new User();

            user.Username  = lblUsername.Text;
            user.Password  = lblPassword.Text;
            user.Address   = lblAddress.Text;
            user.Email     = lblEmail.Text;
            user.Phone     = lblPhone.Text;
            user.Usergroup = userGroup[picker.SelectedIndex];

            bool x = await restServices.SaveNewUserAsync(user, true);

            if (x)
            {
                lblUsername.Text        = "";
                lblPassword.Text        = "";
                lblAddress.Text         = "";
                lblPhone.Text           = "";
                lblEmail.Text           = "";
                lblConfirmPassword.Text = "";
                Console.WriteLine("EventPortal : successfully upload data..");
                PopupSingle p = new PopupSingle();
                await Navigation.PushPopupAsync(p);
            }
            else
            {
                Console.WriteLine("EventPortal : Error occured uploading data..");
            }
        }