Beispiel #1
0
 public static async Task<User> UpdateUser(User u)
 {
     await user.UpdateAsync(u);
     u = (await user.Where(uu => uu.UserId == u.UserId).ToListAsync()).First() ;
     return u;
 }
Beispiel #2
0
        public static async void InsertNewUser(User u)
        {
            try
            {
                await user.InsertAsync(u);
            }
            catch (MobileServiceInvalidOperationException e)
            {
                Debug.WriteLine(e.Message);
            }

        }
Beispiel #3
0
 public static async void DeleteUser(User u)
 {
     await user.DeleteAsync(u);
 }
        async void fillDoctors()
        {
            doctorsList = await User.ReadUsersList();
            tempList = doctorsList.Select(u => (u.LName + ", " + u.FName)).ToList();
            DoctorsComboBox.ItemsSource = tempList;
            DoctorsComboBox.SelectedIndex = 0;

            Doc = (string)DoctorsComboBox.SelectedValue;
            string ln = Doc.Substring(0, doc.IndexOf(","));
            string fn = Doc.Substring(doc.IndexOf(",") + 2);
            try
            {
                User temp = doctorsList.Where(u => (u.LName.Equals(ln) && u.FName.Equals(fn))).ToList().First();
                //whList = (await WorkHours.ReadListAsync()).Where(w => w.EmployeeId == temp.UserId).ToList();
                //appList = (await Appointment.ReadAppointmentsList()).Where(a => a.UserID == temp.UserId).ToList();
                //invList = (await Invitation.ReadInvitationsList()).Where(i => i.ToUserId == temp.UserId).ToList();

                SelectedDoctor = temp;
            }
            catch
            {

            }

            await Dispatcher.RunAsync(CoreDispatcherPriority.Low, async () =>
            {
                while (true)
                {
                    await Task.Delay(1000);
                    if (oldChanged != Changed)
                    {
                        fillWeeklyCalendar();
                        oldChanged = Changed;
                    }
                }
            });


        }