private void Discard_Changes(object sender, EventArgs e)
 {
     _objAddWorkoutScheduleRequest  = new AddWorkoutScheduleRequest();
     _objAddWorkoutScheduleResponse = new AddWorkoutScheduleResponse();
     _apiService        = new RestApi();
     _objHeaderModel    = new HeaderModel();
     _baseUrl           = Settings.Url + Domain.AddWorkoutScheduleApiConstant;
     _objRecereenceList = new RecereenceList();
     dropdownReccerenceType.ItemsSource = _objRecereenceList.RecerrenceSource;
     BindingContext                          = _objAddWorkoutScheduleRequest;
     XFEntryTxtFriend.Text                   = "";
     XFEntryTxtMe.Text                       = "";
     XfTPStartTime.Time                      = TimeSpan.Parse("00:00");
     XFBtnMonday.BackgroundColor             = Color.FromHex("#64BAEB");
     IsMondaySelected                        = false;
     _objAddWorkoutScheduleRequest.Monday    = false;
     XFBtnTuesday.BackgroundColor            = Color.FromHex("#64BAEB");
     IsTuesdaySelected                       = false;
     _objAddWorkoutScheduleRequest.Tuesday   = false;
     XFBtnWednesday.BackgroundColor          = Color.FromHex("#64BAEB");
     IsWednesdaySelected                     = false;
     _objAddWorkoutScheduleRequest.Wednesday = false;
     XFBtnThursaday.BackgroundColor          = Color.FromHex("#64BAEB");
     IsThursdaySelected                      = false;
     _objAddWorkoutScheduleRequest.Thursday  = false;
     XFBtnFriday.BackgroundColor             = Color.FromHex("#64BAEB");
     IsFridaySelected                        = false;
     _objAddWorkoutScheduleRequest.Friday    = false;
     XFBtnSaturday.BackgroundColor           = Color.FromHex("#64BAEB");
     IsSaturdaySelected                      = false;
     _objAddWorkoutScheduleRequest.Saturday  = false;
     XFBtnSunday.BackgroundColor             = Color.FromHex("#64BAEB");
     IsSundaySelected                        = false;
     _objAddWorkoutScheduleRequest.Sunday    = false;
 }
 public AddNewSchedulePage()
 {
     InitializeComponent();
     _objAddWorkoutScheduleRequest  = new AddWorkoutScheduleRequest();
     _objAddWorkoutScheduleResponse = new AddWorkoutScheduleResponse();
     _apiService        = new RestApi();
     _objHeaderModel    = new HeaderModel();
     _baseUrl           = Settings.Url + Domain.AddWorkoutScheduleApiConstant;
     _objRecereenceList = new RecereenceList();
     dropdownReccerenceType.ItemsSource = _objRecereenceList.RecerrenceSource;
     BindingContext = _objAddWorkoutScheduleRequest;
 }
        private async void XFSubmitButton_Clicked(object sender, EventArgs e)
        {
            try
            {
                var TextMe = "";
                if (string.IsNullOrEmpty(XFEntryTxtMe.Text))
                {
                    TextMe = "00:00:00";
                }
                else
                {
                    TextMe = "00:" + XFEntryTxtMe.Text;
                }
                var TextFrind = "";
                if (string.IsNullOrEmpty(XFEntryTxtFriend.Text))
                {
                    TextFrind = "00:00:00";
                }
                else
                {
                    TextFrind = "00:" + XFEntryTxtFriend.Text;
                }


                _objHeaderModel           = new HeaderModel();
                _objHeaderModel.TokenCode = Settings.TokenCode;
                _objAddWorkoutScheduleRequest.ScheduleTime = XfTPStartTime.Time;
                _objAddWorkoutScheduleRequest.StartDate    = XFDPstartDate.Date;
                _objAddWorkoutScheduleRequest.EndDate      = XFDPEndDate.Date;
                _objAddWorkoutScheduleRequest.RecurrenceId = ReccerenceId;
                if (!string.IsNullOrEmpty(TextMe))
                {
                    _objAddWorkoutScheduleRequest.TextMeTime = TimeSpan.Parse(TextMe);
                }
                if (!string.IsNullOrEmpty(TextFrind))
                {
                    _objAddWorkoutScheduleRequest.TextFriendTime = TimeSpan.Parse(TextFrind);
                }


                if (_objAddWorkoutScheduleRequest.StartDate == null || _objAddWorkoutScheduleRequest.RecurrenceId <= 0 ||
                    _objAddWorkoutScheduleRequest.ScheduleTime == null || string.IsNullOrEmpty(_objAddWorkoutScheduleRequest.WorkoutText))
                {
                    DependencyService.Get <IToast>().Show("please fill the form completelty!");
                }
                else
                {
                    _objAddWorkoutScheduleResponse = await _apiService.AddScheduleDetailAsync(new Get_API_Url().CommonBaseApi(_baseUrl), true, _objHeaderModel, _objAddWorkoutScheduleRequest);

                    if (_objAddWorkoutScheduleResponse.StatusCode == 200)
                    {
                        DependencyService.Get <IToast>().Show(_objAddWorkoutScheduleResponse.Message);
                        WorkoutId           = _objAddWorkoutScheduleResponse.WorkoutId;
                        pageId              = 2;
                        XFBtnSave.IsEnabled = false;
                    }
                    else
                    {
                        DependencyService.Get <IToast>().Show(_objAddWorkoutScheduleResponse.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                var msg = ex.Message;
            }
        }