예제 #1
0
        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();
            }
        }
예제 #2
0
 public Mechanic_RequestDonePage(Int32 MaintananceID)
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     _objM_CheckListResponse   = new M_CheckListResponse();
     _objM_CheckListRequest    = new M_CheckListRequest();
     _objM_RequestDoneResponse = new M_RequestDoneResponse();
     _objM_RequestDoneRequest  = new M_RequestDoneRequest();
     _objHeaderModel           = new HeaderModel();
     _baseUrl         = Settings.Url + Domain.M_CheckboxListApiConstant;
     _baseUrlPostdata = Settings.Url + Domain.M_SendRequestDoneApiConstant;
     _apiServices     = new RestApi();
     CheckBoxObj      = new List <int>();
     _maintananceId   = MaintananceID;
     LoadPageData();
 }