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; _objDriver_DailyCheckLestPostRequest = new Driver_DailyCheckLestPostRequest { VechicleId = Settings.VehicleID.ToString(), WorksheetId = WorkSheetId.ToString(), EmployeeId = Settings.UserId.ToString(), CreatedBy = Settings.UserId.ToString(), Comments = Comments, QuestionChecelist = SelectedRadioIds, EngineHrs = txtEnginehours.Text, Odometer = txtOdometer.Text, SelectChecklist = SelecetedCheckIds }; if (string.IsNullOrEmpty(SelecetedCheckIds) || string.IsNullOrEmpty(SelectedRadioIds)) { DependencyService.Get <IToast>().Show("Please select the right Answers first and the checkbox!"); } else { await Navigation.PushPopupAsync(new LoadingPopPage()); _objDriver_DailyCheckListPostResponse = await _apiServices.DriverDailyCheckListPostAsync(new Get_API_Url().DriverDailyCheckListAddDataApi(_baseUrlPostdata), true, _objHeaderModel, _objDriver_DailyCheckLestPostRequest); if (_objDriver_DailyCheckListPostResponse.Response.statusCode == 200) { DailyCheckListID = _objDriver_DailyCheckListPostResponse.Response.Id; await App.NavigationPage.Navigation.PushAsync(new Driver_SignatureScreenPage(DailyCheckListID)); DependencyService.Get <IToast>().Show(_objDriver_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; } }
private async void btnSubmitdailyList_Clicked(object sender, EventArgs e) { try { string SelecetedCheckIds = string.Empty; string Comments = txtComments.Text; foreach (var Checkbx in CheckBoxObj) { SelecetedCheckIds += Checkbx.ToString() + ","; } _objHeaderModel.TokenCode = Settings.TokenCode; // //{ _objM_RequestDoneRequest.MaintenenceRequestId = _maintananceId; _objM_RequestDoneRequest.EmployeeId = Settings.UserId; _objM_RequestDoneRequest.Comments = Comments; _objM_RequestDoneRequest.Checklist = SelecetedCheckIds; // }; if (_objM_RequestDoneRequest.Comments != null || _objM_RequestDoneRequest.Checklist != null) { await Navigation.PushPopupAsync(new LoadingPopPage()); _objM_RequestDoneResponse = await _apiServices.M_SendRequestDoneDataAsync(new Get_API_Url().CommonBaseApi(_baseUrlPostdata), true, _objHeaderModel, _objM_RequestDoneRequest); if (_objM_RequestDoneResponse.Response.StatusCode == 200) { await App.NavigationPage.Navigation.PushAsync(new Mechanic_SignaturePage(_maintananceId)); DependencyService.Get <IToast>().Show(_objM_RequestDoneResponse.Response.Message); await Navigation.PopAllPopupAsync(); } else { // await App.NavigationPage.Navigation.PushAsync(new Mechanic_SignaturePage(_maintananceId)); DependencyService.Get <IToast>().Show("Something Bad Happend please Try again Later!"); await Navigation.PopAllPopupAsync(); } } else { DependencyService.Get <IToast>().Show("please enter the text field and checkbox !"); } } catch (Exception ex) { var msg = ex.Message; await Navigation.PopAllPopupAsync(); } }
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; } }