private async void SubmitCommandRecieverAsync() { NewPartnerRequestModel newPartnerRequestModel = new NewPartnerRequestModel { AccountNumber = AccountNumber, BillAddress = BillAddress, ContactEmail = ContactEmail, ContactName = ContactName, Fax = Fax, IsInternal = IsInternalOn, IsNotify = IsNotify, IsShared = IsSharedOn, LocationCode = LocationCode, LocationStatus = LocationStatus, Notes = Notes, FirstName = PartnerName, LastName = PartnerName, ParentPartnerId = IsInternalOn ? AppSettings.CompanyId : _uuidManager.GetUuId(), PartnerId = _uuidManager.GetUuId(), PartnerName = PartnerName, PartnerTypeCode = SelectedPartnerType.Code, Phone = Phone, PrivateKey = PrivateKey, ReferenceKey = ReferenceKey, RouteName = RouteName, ShipAddress = ShipAddress, SmsAddress = SmsAddress, TimeZone = "+05:30", //PTTimeZone; Website = "" //Website; }; try { Loader.StartLoading(); var result = await _moveService.PostNewPartnerAsync(newPartnerRequestModel, AppSettings.SessionId, RequestType : Configuration.NewPartner); if (result != null) { try { PartnerModel partnerModel = new PartnerModel { Address = BillingAddress, Address1 = ShippingAddress, City = newPartnerRequestModel.BillAddress != null ? newPartnerRequestModel.BillAddress.City : string.Empty, ParentPartnerId = newPartnerRequestModel.ParentPartnerId, ParentPartnerName = newPartnerRequestModel.PartnerName, PartnerId = newPartnerRequestModel.PartnerId, PartnershipIsActive = newPartnerRequestModel.IsInternal, IsInternal = newPartnerRequestModel.IsInternal, IsShared = newPartnerRequestModel.IsShared, Lat = newPartnerRequestModel.BillAddress != null ? newPartnerRequestModel.BillAddress.Latitude : default(double), LocationCode = newPartnerRequestModel.LocationCode, LocationStatus = newPartnerRequestModel.LocationStatus, Lon = newPartnerRequestModel.BillAddress != null ? newPartnerRequestModel.BillAddress.Longitude : default(double), MasterCompanyId = newPartnerRequestModel.ParentPartnerId, PartnerTypeCode = newPartnerRequestModel.PartnerTypeCode, PartnerTypeName = newPartnerRequestModel.PartnerName, PhoneNumber = newPartnerRequestModel.PartnerName, PostalCode = newPartnerRequestModel.BillAddress != null ? newPartnerRequestModel.BillAddress.PostalCode : string.Empty, SourceKey = newPartnerRequestModel.RouteName, State = newPartnerRequestModel.BillAddress != null ? newPartnerRequestModel.BillAddress.State : string.Empty, FullName = newPartnerRequestModel.PartnerName, }; var RealmDb = Realm.GetInstance(RealmDbManager.GetRealmDbConfig()); await RealmDb.WriteAsync((realmDb) => { realmDb.Add(partnerModel); }); await _navigationService.GoBackAsync(new NavigationParameters { { "partnerModel", partnerModel } }, animated : false); } catch (Exception ex) { Crashes.TrackError(ex); } } } catch (Exception ex) { Crashes.TrackError(ex); } finally { Loader.StopLoading(); } }