Пример #1
0
        private async Task OnAdd()
        {
            try
            {
                IsBusy = true;



                var file = _attachedFilesList.FirstOrDefault();

                var context = new NewTruDeskItemQueryContext
                {
                    Branch         = _selectedPlant.BranchId,
                    CustomerInfo   = Api.GetCustomerContext(),
                    EmailAddress   = Settings.Email,
                    Description    = _description,
                    Subject        = _subject,
                    Attachment     = (file == null) ? null : Convert.ToBase64String(file.FileData),
                    AttachmentName = file?.Filename
                };

                var response = await Api.AddBranchTicket(context);

                await Nav.Nav.PopAsync();
            }
            catch (Exception ex)
            {
                await Alert.DisplayError(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }