public NDriverDailyCheckListPage() { InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); _objNonDriver_DailyCheckListResponse = new NonDriver_DailyCheckListResponse(); _objND_DailyCheckLIstPostResponse = new ND_DailyCheckLIstPostResponse(); _baseUrl = Settings.Url + Domain.NDDailyCheckListGet_ApiConstant; _baseUrlPostdata = Settings.Url + Domain.NDDailyCheckListPost_ApiConstant; _apiServices = new RestApi(); _objHeaderModel = new HeaderModel(); RbtnList = new List <string>(); CheckBoxObj = new List <int>(); RadiobBtnObj = new List <int>(); LoadPageData(); }
private async void btnSubmitdailyList_Clicked(object sender, EventArgs e) { try { string SelecetedCheckIds = string.Empty; string SelectedRadioIds = string.Empty; string Comments = txtComments.Text; foreach (var Checkbx in CheckBoxObj) { SelecetedCheckIds += Checkbx.ToString() + ","; } foreach (var radiobx in RadiobBtnObj) { SelectedRadioIds += radiobx.ToString() + ","; } _objHeaderModel.TokenCode = Settings.TokenCode; _objND_DailyCheckLIstPostRequest = new ND_DailyCheckLIstPostRequest { VechicleId = Settings.VehicleID.ToString(), EmployeeId = Settings.UserId.ToString(), CreatedBy = Settings.UserId.ToString(), Comments = Comments, QuestionChecelist = SelectedRadioIds, SelectChecklist = SelecetedCheckIds }; await Navigation.PushPopupAsync(new LoadingPopPage()); _objND_DailyCheckLIstPostResponse = await _apiServices.ND_DailyCheckLIstPostDataAsync(new Get_API_Url().CommonBaseApi(_baseUrlPostdata), true, _objHeaderModel, _objND_DailyCheckLIstPostRequest); if (_objND_DailyCheckLIstPostResponse.Response.statusCode == 200) { DailyCheckListID = _objND_DailyCheckLIstPostResponse.Response.Id; await App.NavigationPage.Navigation.PushAsync(new NDriverSignaturePage(DailyCheckListID)); DependencyService.Get <IToast>().Show(_objND_DailyCheckLIstPostResponse.Response.Message); await Navigation.PopAllPopupAsync(); } else { DependencyService.Get <IToast>().Show("Something Bad Happend please Try again Later!"); await Navigation.PopAllPopupAsync(); } } catch (Exception ex) { var msg = ex.Message; } }