예제 #1
0
        async Task SearchAsync()
        {
            //if (! await SPC.Services.UI.ConfirmService.ConfirmAsync("Search for company?"))
            //{
            //    SPC.Services.UI.AlertService.Alert("Search cancelled");
            //    return;
            //}

            if (!string.IsNullOrWhiteSpace(TaxId))
            {
                IsSearching = true;

                // StateHasChanged();

                var _regCompanies = new SPC.Cloud.Members.RegCompanies();

                _regCompanies.SetParameters(new Dictionary <string, string>()
                {
                    { "RowKey", TaxId.Trim() }
                });

                var ret = await _regCompanies.GetBOListAsync();


                if (ret != null && ret.Count > 0)
                {
                    IsSearching = false;
                    //found company. it is registered with SPC
                    SPCRegCompany = ret[0] as RegCompanies.RegCompany;
                }
                else
                {
                    //unregistered companies


                    var _companies = new SPC.eInvoice.Companies();

                    _companies.SetParameters(new Dictionary <string, string>()
                    {
                        { "PartitionKey", "TTCT" }, { "RowKey", TaxId.Trim() }
                    });

                    ret = await _companies.GetBOListAsync();

                    if (ret != null && ret.Count > 0)
                    {
                        IsSearching = false;
                        //found company. it is registered with SPC
                        SPCRegCompany = ret[0] as RegCompanies.RegCompany;
                    }
                    else
                    {
                        SPCRegCompany = null;
                    }
                }

                IsSearching = false;
            }
        }
        private async Task SearchCompanyInfoAsync()
        {
            // StateHasChanged();

            var _regCompanies = new SPC.Cloud.Members.RegCompanies();

            _regCompanies.SetParameters(new Dictionary <string, string>()
            {
                { "RowKey", TaxId.Trim() }
            });

            var ret = await _regCompanies.GetBOListAsync();

            if (ret != null && ret.Count > 0)
            {
                //found company. it is registered with SPC
                SPCRegCompany = ret[0] as RegCompanies.RegCompany;
            }
            else
            {
                //unregistered companies
                var _companies = new SPC.eInvoice.Companies();

                _companies.SetParameters(new Dictionary <string, string>()
                {
                    { "PartitionKey", "TTCT" }, { "RowKey", TaxId.Trim() }
                });

                ret = await _companies.GetBOListAsync();

                if (ret != null && ret.Count > 0)
                {
                    //found company. it is registered with SPC
                    SPCRegCompany = ret[0] as RegCompanies.RegCompany;
                }
                else
                {
                    SPCRegCompany = null;
                }
            }
        }
예제 #3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (entityId_ != null)
            {
                hash ^= EntityId.GetHashCode();
            }
            if (Status != 0)
            {
                hash ^= Status.GetHashCode();
            }
            if (TaxExempt != false)
            {
                hash ^= TaxExempt.GetHashCode();
            }
            if (TaxId.Length != 0)
            {
                hash ^= TaxId.GetHashCode();
            }
            if (GroupPaysLodging != false)
            {
                hash ^= GroupPaysLodging.GetHashCode();
            }
            if (GroupPaysIncidentals != false)
            {
                hash ^= GroupPaysIncidentals.GetHashCode();
            }
            if (AdditionalNotes.Length != 0)
            {
                hash ^= AdditionalNotes.GetHashCode();
            }
            if (CustomerBookingId.Length != 0)
            {
                hash ^= CustomerBookingId.GetHashCode();
            }
            if (dateRange_ != null)
            {
                hash ^= DateRange.GetHashCode();
            }
            if (rateSchedule_ != null)
            {
                hash ^= RateSchedule.GetHashCode();
            }
            if (group_ != null)
            {
                hash ^= Group.GetHashCode();
            }
            if (confirmationTemplateId_ != null)
            {
                hash ^= ConfirmationTemplateId.GetHashCode();
            }
            if (bookingMethod_ != null)
            {
                hash ^= BookingMethod.GetHashCode();
            }
            if (arrivalTemplateId_ != null)
            {
                hash ^= ArrivalTemplateId.GetHashCode();
            }
            if (reservationSourceId_ != null)
            {
                hash ^= ReservationSourceId.GetHashCode();
            }
            if (travelAgent_ != null)
            {
                hash ^= TravelAgent.GetHashCode();
            }
            if (cancellationPolicy_ != null)
            {
                hash ^= CancellationPolicy.GetHashCode();
            }
            if (GroupName.Length != 0)
            {
                hash ^= GroupName.GetHashCode();
            }
            return(hash);
        }