Exemple #1
0
        private void SendNotification_Clicked(object sender, EventArgs e)
        {
            OMGITWebServices.OMGLocationNotificationMessage lm = new OMGITWebServices.OMGLocationNotificationMessage();
            lm.Message = NotificationMessage.Text;
            lm.Subject = SubjectMessage.Text;

            string selLocation = (string)LocationPicker.Items[LocationPicker.SelectedIndex];

            foreach (KeyValuePair <int, string> entry in validLocations)
            {
                if (entry.Value == selLocation)
                {
                    lm.ClinicID = entry.Key;
                }
            }
            //     lm.ClinicID = 8;
            _client = new OMGITServiceClient(binding, EndPoint);
            _client.SendOMGNotificationToLocationsAsync(lm, GlobalData.loginData);
            DisplayAlert("NotificationSent", "Location Notification was successfully sent", "Close");
        }
Exemple #2
0
        private void SendNotification_Clicked(object sender, EventArgs e)
        {
            OMGITWebServices.OMGLocationNotificationMessage lm = new OMGITWebServices.OMGLocationNotificationMessage();
            lm.Message = NotificationMessage.Text;
            lm.Subject = SubjectMessage.Text;

            //string selLocation = (string)LocationPicker.Items[LocationPicker.SelectedIndex];
            //foreach (KeyValuePair<int, string> entry in ValidLocations)
            //{
            //    if (entry.Value == selLocation)
            //        lm.ClinicID = entry.Key;

            //}
            //     lm.ClinicID = 8;


            List <int> SendClinicIDs = new List <int>();

            foreach (StackLayout s in AllClinicsLayout.Children)
            {
                var curClinicName = s.Children[1] as Label;
                var curID         = s.Children[2] as Label;
                var curSwitch     = s.Children[0] as Switch;
                if (curSwitch.IsToggled)
                {
                    try
                    {
                        SendClinicIDs.Add(Int32.Parse(curID.Text));
                    }
                    catch (Exception ex) {; }
                }
            }

            foreach (int id in SendClinicIDs)
            {
                lm.ClinicID = id;
                _client     = new OMGITServiceClient(binding, EndPoint);
                _client.SendOMGNotificationToLocationsAsync(lm, GlobalData.loginData);
                DisplayAlert("NotificationSent", "Location Notification was successfully sent", "Close");
            }
        }