Пример #1
0
        private void CheckUpdateProfile()
        {
            if (App.LoginResponse == null || App.LoginResponse.Email == "" || App.LoginResponse.Email == null)
            {
                // Do nothing if no data is available
            }
            else
            {
                Name            = App.LoginResponse.basicInfo.Name;
                Height          = App.LoginResponse.basicInfo.Height;
                Weight          = App.LoginResponse.basicInfo.Weight;
                TelephoneNumber = App.LoginResponse.basicInfo.PhoneNumber;
                DateOfBirth     = DateTime.Parse(App.LoginResponse.basicInfo.DateOfBirth);
                MedicalInfo     = App.LoginResponse.basicInfo.AnyMedicalCondition;

                GenderIndex = GenderList.IndexOf(App.LoginResponse.basicInfo.Gender);
                TitleIndex  = TitleList.IndexOf(App.LoginResponse.basicInfo.Title);

                if (App.SelectedView == "Trainer")
                {
                    SpecialityIndex = SpecialityList.IndexOf(App.LoginResponse.professionalInfo.Speciality);
                    Experience      = App.LoginResponse.professionalInfo.Experience;
                    Accolades       = App.LoginResponse.professionalInfo.Accolades;
                    Certification   = App.LoginResponse.professionalInfo.certifications[0].Certification;
                    Services        = App.LoginResponse.professionalInfo.services[0].ServiceName;
                    ServiceInfo     = App.LoginResponse.professionalInfo.services[0].ChargingPeriod;
                    ServicesPrice   = App.LoginResponse.professionalInfo.services[0].Charges;
                }

                EmailAddress = App.LoginResponse.Email;
                Password     = App.LoginResponse.Password;
                User64String = "NA";
                SelectedView = App.SelectedView;
            }
        }
Пример #2
0
        private void CheckUpdateProfile()
        {
            if (App.LoginResponse == null || App.LoginResponse.Email == "" || App.LoginResponse.Email == null)
            {
                // Do nothing if no data is available
            }
            else
            {
                StaticListData = new ObservableCollection <Models.CustomSignupModel>();

                Models.CustomSignupModel basicSignUpModel = new Models.CustomSignupModel {
                    HeaderName = "Basic Information"
                };

                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Label", PlaceholderText = "Name", IsAdditionAvailable = false
                });
                // Index Number 1 (Name)
                basicSignUpModel.Add(new Models.SignupData {
                    MainSelectedData = App.LoginResponse.basicInfo.Name, InputType = "Entry", PlaceholderText = "Enter Name", IsAdditionAvailable = false
                });

                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Label", PlaceholderText = "Gender", IsAdditionAvailable = false
                });
                // Index Number 3 (Gender)
                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Picker", PlaceholderText = "Select Gender", IsAdditionAvailable = false, SelectionData = GenderList, SelectedIndex = GenderList.IndexOf(App.LoginResponse.basicInfo.Gender)
                });

                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Label", PlaceholderText = "Date of Birth", IsAdditionAvailable = false
                });
                // Index Number 5 (DOB)
                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Picker", PlaceholderText = "Date of Birth", SelectedDate = DateTime.Parse(App.LoginResponse.basicInfo.DateOfBirth), IsAdditionAvailable = true
                });

                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Label", PlaceholderText = "Phone Number", IsAdditionAvailable = false
                });
                // Index Number 7 (Phone)
                basicSignUpModel.Add(new Models.SignupData {
                    MainSelectedData = App.LoginResponse.basicInfo.PhoneNumber, InputType = "Entry", IsAdditionAvailable = true, PlaceholderText = "Enter Phone Number"
                });

                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Label", PlaceholderText = "Height (in cm)", IsAdditionAvailable = false
                });
                // Index Number 9 (Height)
                basicSignUpModel.Add(new Models.SignupData {
                    MainSelectedData = App.LoginResponse.basicInfo.Height, InputType = "Entry", IsAdditionAvailable = true, PlaceholderText = "Enter Height"
                });

                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Label", PlaceholderText = "Weight (in kg)", IsAdditionAvailable = false
                });
                // Index Number 11 (Weight)
                basicSignUpModel.Add(new Models.SignupData {
                    MainSelectedData = App.LoginResponse.basicInfo.Weight, InputType = "Entry", IsAdditionAvailable = true, PlaceholderText = "Enter Weight"
                });

                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Label", PlaceholderText = "Sports Interest", IsAdditionAvailable = false
                });
                // Index Number 13 (Sports Interest)
                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Picker", PlaceholderText = "Select Sport", IsAdditionAvailable = false, SelectionData = SportsList, SelectedIndex = SportsList.IndexOf(App.LoginResponse.basicInfo.SportsInterest)
                });

                basicSignUpModel.Add(new Models.SignupData {
                    InputType = "Label", PlaceholderText = "Medical Information", IsAdditionAvailable = false
                });
                // Index Number 15 (Medical Info)
                basicSignUpModel.Add(new Models.SignupData {
                    MainSelectedData = App.LoginResponse.basicInfo.AnyMedicalCondition, InputType = "Editor", PlaceholderText = "Enter Medical Information"
                });


                StaticListData.Add(basicSignUpModel);

                if (App.SelectedView == "Trainer")
                {
                    Models.CustomSignupModel serviceSignUpModel = new Models.CustomSignupModel {
                        HeaderName = "Services"
                    };

                    serviceSignUpModel.Add(new Models.SignupData {
                        InputType = "Label", PlaceholderText = "Specialty", IsAdditionAvailable = false
                    });
                    // Index Number 1 (Specialty)
                    serviceSignUpModel.Add(new Models.SignupData {
                        InputType = "Picker", PlaceholderText = "Select Specialty", IsAdditionAvailable = false, SelectionData = SpecialityList, SelectedIndex = SpecialityList.IndexOf(App.LoginResponse.professionalInfo.Speciality)
                    });

                    serviceSignUpModel.Add(new Models.SignupData {
                        InputType = "Label", PlaceholderText = "Experience", IsAdditionAvailable = false
                    });
                    // Index Number 1 (Experiance)
                    serviceSignUpModel.Add(new Models.SignupData {
                        MainSelectedData = App.LoginResponse.professionalInfo.Experience, InputType = "Entry", PlaceholderText = "Enter Experience", IsAdditionAvailable = true
                    });

                    serviceSignUpModel.Add(new Models.SignupData {
                        InputType = "Label", PlaceholderText = "Awards", IsAdditionAvailable = true
                    });
                    // Index Number 1 (Awards)
                    serviceSignUpModel.Add(new Models.SignupData {
                        MainSelectedData = App.LoginResponse.professionalInfo.Accolades, InputType = "Entry", PlaceholderText = "Enter Awards", IsAdditionAvailable = false
                    });

                    serviceSignUpModel.Add(new Models.SignupData {
                        InputType = "Label", PlaceholderText = "Certification", IsAdditionAvailable = true
                    });
                    // Index Number 1 (Certification)

                    foreach (var certItem in App.LoginResponse.professionalInfo.certifications)
                    {
                        serviceSignUpModel.Add(new Models.SignupData {
                            MainSelectedData = certItem.Certification, InputType = "Entry", PlaceholderText = "Enter Certification", IsAdditionAvailable = false
                        });
                    }



                    serviceSignUpModel.Add(new Models.SignupData {
                        InputType = "Label", PlaceholderText = "Service", IsAdditionAvailable = true
                    });
                    // Index Number 1 (Service)
                    foreach (var serviceItem in App.LoginResponse.professionalInfo.services)
                    {
                        ObservableCollection <Models.SelectedTime> selectedTimes = new ObservableCollection <Models.SelectedTime>();
                        foreach (var scheduleItem in serviceItem.schedules)
                        {
                            Models.SelectedTime selectedTime = new Models.SelectedTime();

                            selectedTime.Day          = scheduleItem.Day;
                            selectedTime.Month        = scheduleItem.Month;
                            selectedTime.Year         = scheduleItem.Year;
                            selectedTime.EndTime      = scheduleItem.EndTime;
                            selectedTime.ScheduleType = scheduleItem.ScheduleType;
                            selectedTime.StartTime    = scheduleItem.StartTime;
                            selectedTime.WeekDay      = scheduleItem.WeekDay;
                            //selectedTime.SelectedIndex = ;
                            selectedTimes.Add(selectedTime);
                        }

                        serviceSignUpModel.Add(new Models.SignupData {
                            SessionLocation = serviceItem.WorkLocaton, SessionTeam = serviceItem.TeamSize, selectedTime = selectedTimes, MainSelectedData = serviceItem.ServiceName, SessionDesc = serviceItem.ChargingPeriod, SessionAmount = serviceItem.Charges, InputType = "Service"
                        });
                    }

                    serviceSignUpModel.Add(new Models.SignupData {
                        InputType = "Label", PlaceholderText = "PayPal ID", IsAdditionAvailable = false
                    });
                    // Index Number 1 (PayPal ID)
                    serviceSignUpModel.Add(new Models.SignupData {
                        InputType = "Entry", PlaceholderText = "Enter PayPal ID", IsAdditionAvailable = false, MainSelectedData = App.LoginResponse.PaypalId
                    });


                    StaticListData.Add(serviceSignUpModel);
                }



                EmailAddress = App.LoginResponse.Email;
                Password     = App.LoginResponse.Password;
                User64String = App.LoginResponse.ImagePayload;
                SelectedView = App.SelectedView;
                UserIcon     = App.LoginResponse.basicInfo.ImageUrl;
                InstaImages  = App.LoginResponse.basicInfo.InstaGramImages;
            }
        }