public static ShippingRate RatePackage(FedExGlobalServiceSettings globals, MerchantTribe.Web.Logging.ILogger logger, FedExServiceSettings settings, IShipment package) { ShippingRate result = new ShippingRate(); // Get ServiceType ServiceType currentServiceType = ServiceType.FEDEXGROUND; currentServiceType = (ServiceType)settings.ServiceCode; // Get PackageType PackageType currentPackagingType = PackageType.YOURPACKAGING; currentPackagingType = (PackageType)settings.Packaging; // Set max weight by service CarrierCode carCode = GetCarrierCode(currentServiceType); result.EstimatedCost = RateSinglePackage(globals, logger, package, currentServiceType, currentPackagingType, carCode); return(result); }
public async Task <IActionResult> Edit(int id, [Bind("IdcarrierCode,Priority,Status,FkCarrier,FkCode,FkLcr")] CarrierCode carrierCode) { if (id != carrierCode.IdcarrierCode) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(carrierCode); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarrierCodeExists(carrierCode.IdcarrierCode)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(carrierCode)); }
public async Task <IActionResult> Create([Bind("IdcarrierCode,Priority,Status,FkCarrier,FkCode,FkLcr")] CarrierCode carrierCode) { if (ModelState.IsValid) { _context.Add(carrierCode); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(carrierCode)); }
public void ParseNode(XmlNode n) { _CustomerTransactionIdentifier = XmlHelper.ParseInnerText(n, "CustomerTransactionIdentifier"); _AccountNumber = XmlHelper.ParseInnerText(n, "AccountNumber"); _MeterNumber = XmlHelper.ParseInnerText(n, "MeterNumber"); try { string tempCode = XmlHelper.ParseInnerText(n, "CarrierCode"); int tempCode2 = 0; int.TryParse(tempCode, out tempCode2); _CarrierCode = (CarrierCode)tempCode2; } catch { } }
public override int GetHashCode() { int hashcode = 157; unchecked { if (__isset.deviceName) { hashcode = (hashcode * 397) + DeviceName.GetHashCode(); } if (__isset.systemName) { hashcode = (hashcode * 397) + SystemName.GetHashCode(); } if (__isset.systemVersion) { hashcode = (hashcode * 397) + SystemVersion.GetHashCode(); } if (__isset.model) { hashcode = (hashcode * 397) + Model.GetHashCode(); } if (__isset.carrierCode) { hashcode = (hashcode * 397) + CarrierCode.GetHashCode(); } if (__isset.carrierName) { hashcode = (hashcode * 397) + CarrierName.GetHashCode(); } if (__isset.applicationType) { hashcode = (hashcode * 397) + ApplicationType.GetHashCode(); } } return(hashcode); }
public IAsyncResult Begin_getNotificationPolicy(AsyncCallback callback, object state, CarrierCode carrier) { return send_getNotificationPolicy(callback, state, carrier); }
public void Read (TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 2: if (field.Type == TType.I32) { Carrier = (CarrierCode)iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }
public void send_startVerification(string region, CarrierCode carrier, string phone, string udidHash, DeviceInfo deviceInfo, string networkCode, string mid, string locale) #endif { oprot_.WriteMessageBegin(new TMessage("startVerification", TMessageType.Call, seqid_)); startVerification_args args = new startVerification_args(); args.Region = region; args.Carrier = carrier; args.Phone = phone; args.UdidHash = udidHash; args.DeviceInfo = deviceInfo; args.NetworkCode = networkCode; args.Mid = mid; args.Locale = locale; args.Write(oprot_); oprot_.WriteMessageEnd(); #if SILVERLIGHT return oprot_.Transport.BeginFlush(callback, state); #else oprot_.Transport.Flush(); #endif }
public IAsyncResult send_startVerification(AsyncCallback callback, object state, string region, CarrierCode carrier, string phone, string udidHash, DeviceInfo deviceInfo, string networkCode, string mid, string locale)
public void send_getNotificationPolicy(CarrierCode carrier) #endif { oprot_.WriteMessageBegin(new TMessage("getNotificationPolicy", TMessageType.Call, seqid_)); getNotificationPolicy_args args = new getNotificationPolicy_args(); args.Carrier = carrier; args.Write(oprot_); oprot_.WriteMessageEnd(); #if SILVERLIGHT return oprot_.Transport.BeginFlush(callback, state); #else oprot_.Transport.Flush(); #endif }
public override VufindDoc CreateVufindDocument(object Record)//здесь принимаем int { int ID_BJ = (int)Record; BJBookLoader loader = new Books.BJBooks.Loaders.BJBookLoader(this.Fund); DataTable record = loader.GetBJRecord(ID_BJ); if (record.Rows.Count == 0) { return(null); } int currentIDMAIN = (int)record.Rows[0]["IDMAIN"]; if (!SpecialFilter(currentIDMAIN, record)) { return(null); } string level = record.Rows[0]["Level"].ToString(); string level_id = record.Rows[0]["level_id"].ToString(); int lev_id = int.Parse(level_id); if (lev_id < 0) { return(null); } StringBuilder allFields = new StringBuilder(); AuthoritativeFile AF_all = new AuthoritativeFile(); bool wasTitle = false; //встречается ошибка: два заглавия в одном пине bool wasAuthor = false; //был ли автор. если был, то сортировочное поле уже заполнено string description = ""; //все 3хх поля string Annotation = ""; int CarrierCode; VufindDoc result = new VufindDoc(); string add = string.Empty; #region field analyse //BJBookInfo book = new BJBookInfo(); foreach (DataRow r in record.Rows) { allFields.AppendFormat(" {0}", r["PLAIN"].ToString()); switch (r["code"].ToString()) { //=======================================================================Родные поля вуфайнд======================= case "200$a": if (wasTitle) { break; } result.title.Add(r["PLAIN"].ToString()); result.title_short.Add(r["PLAIN"].ToString()); result.title_sort.Add(r["SORT"].ToString()); wasTitle = true; break; case "700$a": result.author.Add(r["PLAIN"].ToString()); if (!wasAuthor) { //AddField("author_sort", r["SORT"].ToString()); result.author_sort.Add(r["SORT"].ToString()); } wasAuthor = true; //забрать все варианты написания автора из авторитетного файла и вставить в скрытое, но поисковое поле break; case "701$a": result.author2.Add(r["PLAIN"].ToString()); break; case "710$a": result.author_corporate.Add(r["PLAIN"].ToString()); break; case "710$4": result.author_corporate_role.Add(r["PLAIN"].ToString()); break; case "700$4": result.author_role.Add(r["PLAIN"].ToString()); break; case "701$4": result.author2_role.Add(r["PLAIN"].ToString()); break; case "921$a": CarrierCode = KeyValueMapping.CarrierNameToCode.GetValueOrDefault(r["PLAIN"].ToString(), 3001); result.format.Add(CarrierCode.ToString()); break; case "922$e": result.genre.Add(r["PLAIN"].ToString()); result.genre_facet.Add(r["PLAIN"].ToString()); break; case "10$a": add = BJLoader.Clarify_10a((int)r["IDDATA"], r["PLAIN"].ToString()); result.isbn.Add(add); break; case "11$a": result.issn.Add(r["PLAIN"].ToString()); break; case "101$a": add = BJLoader.Clarify_101a((int)r["IDINLIST"], r["PLAIN"].ToString()); result.language.Add(add); break; case "2100$d": result.publishDate.Add(r["PLAIN"].ToString()); break; case "210$c": result.publisher.Add(r["PLAIN"].ToString()); break; case "517$a": add = BJLoader.Clarify_517a((int)r["IDDATA"], r["PLAIN"].ToString()); result.title_alt.Add(add); break; //=======================================================================добавленные поля в Вуфайнд======================= case "210$a": result.PlaceOfPublication.Add(r["PLAIN"].ToString()); break; case "200$6": result.Title_another_chart.Add(r["PLAIN"].ToString()); break; case "200$b": result.Title_same_author.Add(r["PLAIN"].ToString()); break; case "200$d": result.Parallel_title.Add(r["PLAIN"].ToString()); break; case "200$e": result.Info_pertaining_title.Add(r["PLAIN"].ToString()); break; case "200$f": result.Responsibility_statement.Add(r["PLAIN"].ToString()); break; case "200$h": result.Part_number.Add(r["PLAIN"].ToString()); break; case "200$i": result.Part_title.Add(r["PLAIN"].ToString()); break; case "200$z": result.Language_title_alt.Add(r["PLAIN"].ToString()); break; case "500$a": result.Title_unified.Add(r["PLAIN"].ToString()); break; case "500$3": //$3 is deprecated!!! AF_all = BJLoader.GetAFAll((int)r["AFLINKID"], "AFHEADERVAR"); result.Title_unified.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "517$e": result.Info_title_alt.Add(r["PLAIN"].ToString()); break; case "517$z": result.Language_title_alt.Add(r["PLAIN"].ToString()); break; case "700$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFNAMESVAR"); foreach (string av in AF_all.AFValues) { result.author_variant.Add(av); } allFields.AppendFormat(" {0}", AF_all); break; case "701$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFNAMESVAR"); result.Another_author_AF_all.Add(AF_all.ToString()); //хранить но не отображать allFields.AppendFormat(" {0}", AF_all); break; case "501$a": result.Another_title.Add(r["PLAIN"].ToString()); break; case "501$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFHEADERVAR"); result.Another_title_AF_All.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "503$a": result.Unified_Caption.Add(r["PLAIN"].ToString()); break; case "503$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFHEADERVAR"); result.Unified_Caption_AF_All.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "700$6": result.Author_another_chart.Add(r["PLAIN"].ToString()); break; case "702$a": result.Editor.Add(r["PLAIN"].ToString()); break; case "702$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFNAMESVAR"); result.Editor_AF_all.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "702$4": result.Editor_role.Add(r["PLAIN"].ToString()); break; case "710$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFORGSVAR"); result.Collective_author_all.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "710$9": result.Organization_nature.Add(r["PLAIN"].ToString()); break; case "11$9": result.Printing.Add(r["PLAIN"].ToString()); break; case "205$a": string PublicationInfo = BJLoader.Clarify_205a((int)r["IDDATA"], r["PLAIN"].ToString()); result.Publication_info.Add(PublicationInfo); break; case "921$b": result.EditionType.Add(r["PLAIN"].ToString()); break; case "102$a": result.Country.Add(r["PLAIN"].ToString()); break; case "210$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFORGSVAR"); result.PlaceOfPublication_AF_All.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "2110$g": result.PrintingHouse.Add(r["PLAIN"].ToString()); break; case "2110$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFORGSVAR"); result.PrintingHouse_AF_All.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "2111$e": result.GeoNamePlaceOfPublication.Add(r["PLAIN"].ToString()); break; case "2111$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFGEOVAR"); result.GeoNamePlaceOfPublication_AF_All.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "10$z": result.IncorrectISBN.Add(r["PLAIN"].ToString()); break; case "11$z": result.IncorrectISSN.Add(r["PLAIN"].ToString()); break; case "11$y": result.CanceledISSN.Add(r["PLAIN"].ToString()); break; case "101$b": result.IntermediateTranslateLanguage.Add(r["PLAIN"].ToString()); break; case "101$d": result.SummaryLanguage.Add(r["PLAIN"].ToString()); break; case "101$e": result.TableOfContentsLanguage.Add(r["PLAIN"].ToString()); break; case "101$f": result.TitlePageLanguage.Add(r["PLAIN"].ToString()); break; case "101$g": result.BasicTitleLanguage.Add(r["PLAIN"].ToString()); break; case "101$i": result.AccompayingMaterialLanguage.Add(r["PLAIN"].ToString()); break; case "215$a": result.Volume.Add(r["PLAIN"].ToString()); break; case "215$b": result.Illustrations.Add(r["PLAIN"].ToString()); break; case "215$c": result.Dimensions.Add(r["PLAIN"].ToString()); break; case "215$d": result.AccompayingMaterial.Add(r["PLAIN"].ToString()); break; case "225$a": if (r["PLAIN"].ToString() == "") { break; } if (r["PLAIN"].ToString() == "-1") { break; } //AddHierarchyFields(Convert.ToInt32(r["PLAIN"]), Convert.ToInt32(r["IDMAIN"]), result); break; case "225$h": result.NumberInSeries.Add(r["PLAIN"].ToString()); break; case "225$v": result.NumberInSubseries.Add(r["PLAIN"].ToString()); break; case "300$a": case "301$a": case "316$a": case "320$a": case "326$a": case "336$a": case "337$a": description += r["PLAIN"].ToString() + " ; "; break; case "327$a": case "330$a": Annotation += r["PLAIN"].ToString() + " ; "; break; case "830$a": result.CatalogerNote.Add(r["PLAIN"].ToString()); break; case "831$a": result.DirectoryNote.Add(r["PLAIN"].ToString()); break; case "924$a": result.AdditionalBibRecord.Add(r["PLAIN"].ToString()); break; case "940$a": result.HyperLink.Add(r["PLAIN"].ToString()); break; case "606$a": //"""""" • """""" add = Clarify606a(r["SORT"].ToString()); result.topic.Add(add); result.topic_facet.Add(add); break; case "3000$a": result.OwnerPerson.Add(r["PLAIN"].ToString()); break; case "3000$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFNAMESVAR"); result.OwnerPerson_AF_All.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "3001$a": result.OwnerOrganization.Add(r["PLAIN"].ToString()); break; case "3001$3": AF_all = GetAFAll((int)r["AFLINKID"], "AFORGSVAR"); result.OwnerOrganization_AF_All.Add(AF_all.ToString()); allFields.AppendFormat(" {0}", AF_all); break; case "3002$a": result.Ownership.Add(r["PLAIN"].ToString()); break; case "3003$a": result.OwnerExemplar.Add(r["PLAIN"].ToString()); break; case "3200$a": result.IllustrationMaterial.Add(r["PLAIN"].ToString()); break; } } #endregion result.id = this.Fund + "_" + currentIDMAIN; string rusFund = GetFundId(this.Fund); result.fund = rusFund; result.allfields = allFields.ToString(); result.Level = level; result.Level_id = level_id; result.Annotation.Add(Annotation); if (description != "") { result.description.Add(description); } if (int.Parse(result.Level_id) < 0) { return(result); } AddExemplarFields(currentIDMAIN, result, this.Fund); if ((result.Exemplars.Count == 0))//все экземпляры отсеялись сами собой. { return(null); } return(result); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (AirlineClass != null) { hashCode = hashCode * 59 + AirlineClass.GetHashCode(); } if (ArrivalAirport != null) { hashCode = hashCode * 59 + ArrivalAirport.GetHashCode(); } if (ArrivalTime != null) { hashCode = hashCode * 59 + ArrivalTime.GetHashCode(); } if (CarrierCode != null) { hashCode = hashCode * 59 + CarrierCode.GetHashCode(); } if (ConjunctionTicket != null) { hashCode = hashCode * 59 + ConjunctionTicket.GetHashCode(); } if (CouponNumber != null) { hashCode = hashCode * 59 + CouponNumber.GetHashCode(); } if (Date != null) { hashCode = hashCode * 59 + Date.GetHashCode(); } if (DepartureTime != null) { hashCode = hashCode * 59 + DepartureTime.GetHashCode(); } if (EndorsementOrRestriction != null) { hashCode = hashCode * 59 + EndorsementOrRestriction.GetHashCode(); } if (ExchangeTicket != null) { hashCode = hashCode * 59 + ExchangeTicket.GetHashCode(); } if (Fare != null) { hashCode = hashCode * 59 + Fare.GetHashCode(); } if (FareBasis != null) { hashCode = hashCode * 59 + FareBasis.GetHashCode(); } if (Fee != null) { hashCode = hashCode * 59 + Fee.GetHashCode(); } if (FlightNumber != null) { hashCode = hashCode * 59 + FlightNumber.GetHashCode(); } if (Number != null) { hashCode = hashCode * 59 + Number.GetHashCode(); } if (OriginAirport != null) { hashCode = hashCode * 59 + OriginAirport.GetHashCode(); } if (PassengerClass != null) { hashCode = hashCode * 59 + PassengerClass.GetHashCode(); } if (ServiceClass != null) { hashCode = hashCode * 59 + ServiceClass.GetHashCode(); } if (StopoverCode != null) { hashCode = hashCode * 59 + StopoverCode.GetHashCode(); } if (Taxes != null) { hashCode = hashCode * 59 + Taxes.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if AirlineFlightLeg instances are equal /// </summary> /// <param name="other">Instance of AirlineFlightLeg to be compared</param> /// <returns>Boolean</returns> public bool Equals(AirlineFlightLeg other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( AirlineClass == other.AirlineClass || AirlineClass != null && AirlineClass.Equals(other.AirlineClass) ) && ( ArrivalAirport == other.ArrivalAirport || ArrivalAirport != null && ArrivalAirport.Equals(other.ArrivalAirport) ) && ( ArrivalTime == other.ArrivalTime || ArrivalTime != null && ArrivalTime.Equals(other.ArrivalTime) ) && ( CarrierCode == other.CarrierCode || CarrierCode != null && CarrierCode.Equals(other.CarrierCode) ) && ( ConjunctionTicket == other.ConjunctionTicket || ConjunctionTicket != null && ConjunctionTicket.Equals(other.ConjunctionTicket) ) && ( CouponNumber == other.CouponNumber || CouponNumber != null && CouponNumber.Equals(other.CouponNumber) ) && ( Date == other.Date || Date != null && Date.Equals(other.Date) ) && ( DepartureTime == other.DepartureTime || DepartureTime != null && DepartureTime.Equals(other.DepartureTime) ) && ( EndorsementOrRestriction == other.EndorsementOrRestriction || EndorsementOrRestriction != null && EndorsementOrRestriction.Equals(other.EndorsementOrRestriction) ) && ( ExchangeTicket == other.ExchangeTicket || ExchangeTicket != null && ExchangeTicket.Equals(other.ExchangeTicket) ) && ( Fare == other.Fare || Fare != null && Fare.Equals(other.Fare) ) && ( FareBasis == other.FareBasis || FareBasis != null && FareBasis.Equals(other.FareBasis) ) && ( Fee == other.Fee || Fee != null && Fee.Equals(other.Fee) ) && ( FlightNumber == other.FlightNumber || FlightNumber != null && FlightNumber.Equals(other.FlightNumber) ) && ( Number == other.Number || Number != null && Number.Equals(other.Number) ) && ( OriginAirport == other.OriginAirport || OriginAirport != null && OriginAirport.Equals(other.OriginAirport) ) && ( PassengerClass == other.PassengerClass || PassengerClass != null && PassengerClass.Equals(other.PassengerClass) ) && ( ServiceClass == other.ServiceClass || ServiceClass != null && ServiceClass.Equals(other.ServiceClass) ) && ( StopoverCode == other.StopoverCode || StopoverCode != null && StopoverCode.Equals(other.StopoverCode) ) && ( Taxes == other.Taxes || Taxes != null && Taxes.Equals(other.Taxes) )); }
private static CarrierCode GetCarrierCode(ServiceType service) { CarrierCode result = CarrierCode.FDXG; switch (service) { case ServiceType.EUROPEFIRSTINTERNATIONALPRIORITY: result = CarrierCode.FDXE; break; case ServiceType.FEDEX1DAYFREIGHT: result = CarrierCode.FDXE; break; case ServiceType.FEDEX2DAY: result = CarrierCode.FDXE; break; case ServiceType.FEDEX2DAYFREIGHT: result = CarrierCode.FDXE; break; case ServiceType.FEDEX3DAYFREIGHT: result = CarrierCode.FDXE; break; case ServiceType.FEDEXEXPRESSSAVER: result = CarrierCode.FDXE; break; case ServiceType.FEDEXGROUND: result = CarrierCode.FDXG; break; case ServiceType.FIRSTOVERNIGHT: result = CarrierCode.FDXE; break; case ServiceType.GROUNDHOMEDELIVERY: result = CarrierCode.FDXG; break; case ServiceType.INTERNATIONALECONOMY: result = CarrierCode.FDXE; break; case ServiceType.INTERNATIONALECONOMYFREIGHT: result = CarrierCode.FDXE; break; case ServiceType.INTERNATIONALFIRST: result = CarrierCode.FDXE; break; case ServiceType.INTERNATIONALPRIORITY: result = CarrierCode.FDXE; break; case ServiceType.INTERNATIONALPRIORITYFREIGHT: result = CarrierCode.FDXE; break; case ServiceType.PRIORITYOVERNIGHT: result = CarrierCode.FDXE; break; case ServiceType.STANDARDOVERNIGHT: result = CarrierCode.FDXE; break; default: result = CarrierCode.FDXE; break; } return(result); }
public List<NotificationType> getNotificationPolicy(CarrierCode carrier) { #if !SILVERLIGHT send_getNotificationPolicy(carrier); return recv_getNotificationPolicy(); #else var asyncResult = Begin_getNotificationPolicy(null, null, carrier); return End_getNotificationPolicy(asyncResult); #endif }
public IAsyncResult send_getNotificationPolicy(AsyncCallback callback, object state, CarrierCode carrier)
public IAsyncResult Begin_startVerification(AsyncCallback callback, object state, string region, CarrierCode carrier, string phone, string udidHash, DeviceInfo deviceInfo, string networkCode, string mid, string locale) { return send_startVerification(callback, state, region, carrier, phone, udidHash, deviceInfo, networkCode, mid, locale); }
private static decimal RateSinglePackage(FedExGlobalServiceSettings globalSettings, MerchantTribe.Web.Logging.ILogger logger, IShipment pak, ServiceType service, PackageType packaging, CarrierCode carCode) { decimal result = 0m; //Try RateRequest req = new RateRequest(globalSettings, logger); req.RequestHeader.AccountNumber = globalSettings.AccountNumber; req.RequestHeader.MeterNumber = globalSettings.MeterNumber; req.RequestHeader.CarrierCode = carCode; req.DeclaredValue = 0.1m; // Destination Address Country destinationCountry = Country.FindByBvin(pak.DestinationAddress.CountryData.Bvin); if (destinationCountry != null) { req.DestinationAddress.CountryCode = destinationCountry.IsoCode; if (destinationCountry.IsoCode == "US" | destinationCountry.IsoCode == "CA") { Region destinationRegion = destinationCountry .Regions .Where(y => y.Abbreviation == pak.DestinationAddress.RegionData.Abbreviation) .SingleOrDefault(); req.DestinationAddress.StateOrProvinceCode = destinationRegion.Abbreviation; } } req.DestinationAddress.PostalCode = pak.DestinationAddress.PostalCode; // Origin Address Country originCountry = Country.FindByBvin(pak.SourceAddress.CountryData.Bvin); if (originCountry != null) { req.OriginAddress.CountryCode = originCountry.IsoCode; if (originCountry.IsoCode == "US" | originCountry.IsoCode == "CA") { Region originRegion = originCountry.Regions.Where(y => y.Abbreviation == pak.SourceAddress.RegionData.Abbreviation) .SingleOrDefault(); req.OriginAddress.StateOrProvinceCode = originRegion.Abbreviation; } } req.OriginAddress.PostalCode = pak.SourceAddress.PostalCode; // Dimensions req.Dimensions.Length = pak.Items[0].BoxLength; req.Dimensions.Width = pak.Items[0].BoxWidth; req.Dimensions.Height = pak.Items[0].BoxHeight; //switch () //{ // case MerchantTribe.Commerce.Shipping.LengthType.Centimeters: // req.Dimensions.Units = DimensionType.CM; // break; //case MerchantTribe.Commerce.Shipping.LengthType.Inches: req.Dimensions.Units = DimensionType.IN; // break; //} req.PackageCount = 1; req.Packaging = packaging; req.ReturnType = ReturnShipmentIndicatorType.NONRETURN; req.Service = service; req.SpecialServices.ResidentialDelivery = globalSettings.ForceResidentialRates; req.Weight = pak.Items[0].BoxWeight; //switch (WebAppSettings.ApplicationWeightUnits) //{ // case MerchantTribe.Commerce.Shipping.WeightType.Kilograms: // req.WeightUnits = WeightType.KGS; // break; // case MerchantTribe.Commerce.Shipping.WeightType.Pounds: req.WeightUnits = WeightType.LBS; // break; //} RateResponse res = req.Send(); if (res.Errors.Count > 0) { result = 0m; } else { if (globalSettings.UseListRates) { if (res.EstimatedCharges.ListCharges.NetCharge > 0) { result = res.EstimatedCharges.ListCharges.NetCharge; } else { result = res.EstimatedCharges.DiscountedCharges.NetCharge; } } else { result = res.EstimatedCharges.DiscountedCharges.NetCharge; } } return result; }
public VerificationSessionData startVerification(string region, CarrierCode carrier, string phone, string udidHash, DeviceInfo deviceInfo, string networkCode, string mid, string locale) { #if !SILVERLIGHT send_startVerification(region, carrier, phone, udidHash, deviceInfo, networkCode, mid, locale); return recv_startVerification(); #else var asyncResult = Begin_startVerification(null, null, region, carrier, phone, udidHash, deviceInfo, networkCode, mid, locale); return End_startVerification(asyncResult); #endif }
public override string ToString() { var sb = new StringBuilder("DeviceInfo("); bool __first = true; if (DeviceName != null && __isset.deviceName) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("DeviceName: "); DeviceName.ToString(sb); } if (SystemName != null && __isset.systemName) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("SystemName: "); SystemName.ToString(sb); } if (SystemVersion != null && __isset.systemVersion) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("SystemVersion: "); SystemVersion.ToString(sb); } if (Model != null && __isset.model) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Model: "); Model.ToString(sb); } if (__isset.carrierCode) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("CarrierCode: "); CarrierCode.ToString(sb); } if (CarrierName != null && __isset.carrierName) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("CarrierName: "); CarrierName.ToString(sb); } if (__isset.applicationType) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("ApplicationType: "); ApplicationType.ToString(sb); } sb.Append(")"); return(sb.ToString()); }
private static decimal RateSinglePackage(FedExGlobalServiceSettings globalSettings, MerchantTribe.Web.Logging.ILogger logger, IShipment pak, ServiceType service, PackageType packaging, CarrierCode carCode) { decimal result = 0m; //Try RateRequest req = new RateRequest(globalSettings, logger); req.RequestHeader.AccountNumber = globalSettings.AccountNumber; req.RequestHeader.MeterNumber = globalSettings.MeterNumber; req.RequestHeader.CarrierCode = carCode; req.DeclaredValue = 0.1m; // Destination Address Country destinationCountry = Country.FindByBvin(pak.DestinationAddress.CountryData.Bvin); if (destinationCountry != null) { req.DestinationAddress.CountryCode = destinationCountry.IsoCode; if (destinationCountry.IsoCode == "US" | destinationCountry.IsoCode == "CA") { Region destinationRegion = destinationCountry .Regions .Where(y => y.Abbreviation == pak.DestinationAddress.RegionData.Abbreviation) .SingleOrDefault(); req.DestinationAddress.StateOrProvinceCode = destinationRegion.Abbreviation; } } req.DestinationAddress.PostalCode = pak.DestinationAddress.PostalCode; // Origin Address Country originCountry = Country.FindByBvin(pak.SourceAddress.CountryData.Bvin); if (originCountry != null) { req.OriginAddress.CountryCode = originCountry.IsoCode; if (originCountry.IsoCode == "US" | originCountry.IsoCode == "CA") { Region originRegion = originCountry.Regions.Where(y => y.Abbreviation == pak.SourceAddress.RegionData.Abbreviation) .SingleOrDefault(); req.OriginAddress.StateOrProvinceCode = originRegion.Abbreviation; } } req.OriginAddress.PostalCode = pak.SourceAddress.PostalCode; // Dimensions req.Dimensions.Length = pak.Items[0].BoxLength; req.Dimensions.Width = pak.Items[0].BoxWidth; req.Dimensions.Height = pak.Items[0].BoxHeight; //switch () //{ // case MerchantTribe.Commerce.Shipping.LengthType.Centimeters: // req.Dimensions.Units = DimensionType.CM; // break; //case MerchantTribe.Commerce.Shipping.LengthType.Inches: req.Dimensions.Units = DimensionType.IN; // break; //} req.PackageCount = 1; req.Packaging = packaging; req.ReturnType = ReturnShipmentIndicatorType.NONRETURN; req.Service = service; req.SpecialServices.ResidentialDelivery = globalSettings.ForceResidentialRates; req.Weight = pak.Items[0].BoxWeight; //switch (WebAppSettings.ApplicationWeightUnits) //{ // case MerchantTribe.Commerce.Shipping.WeightType.Kilograms: // req.WeightUnits = WeightType.KGS; // break; // case MerchantTribe.Commerce.Shipping.WeightType.Pounds: req.WeightUnits = WeightType.LBS; // break; //} RateResponse res = req.Send(); if (res.Errors.Count > 0) { result = 0m; } else { if (globalSettings.UseListRates) { if (res.EstimatedCharges.ListCharges.NetCharge > 0) { result = res.EstimatedCharges.ListCharges.NetCharge; } else { result = res.EstimatedCharges.DiscountedCharges.NetCharge; } } else { result = res.EstimatedCharges.DiscountedCharges.NetCharge; } } return(result); }