private static object GetCustomProperty(CustomPropertyCollection properties, string propertyName, object defaultValue) { object result = defaultValue; if (properties != null && properties.Count > 0) { CustomProperty prop = properties[propertyName]; if (prop != null) { if (prop.Value.IsExpression) { result = prop.Instance.Value; } else { result = prop.Value.Value; } } } return result; }
public LineItem() { Id = 0; StoreId = 0; LastUpdatedUtc = DateTime.UtcNow; BasePricePerItem = 0m; DiscountDetails = new List <DiscountDetail>(); OrderBvin = string.Empty; ProductId = string.Empty; VariantId = string.Empty; ProductName = string.Empty; ProductSku = string.Empty; ProductShortDescription = string.Empty; Quantity = 1; QuantityReserved = 0; QuantityReturned = 0; QuantityShipped = 0; ShippingPortion = 0m; StatusCode = string.Empty; StatusName = string.Empty; TaxRate = 0; TaxPortion = 0m; SelectionData = new OptionSelections(); IsNonShipping = false; TaxSchedule = 0; ProductShippingHeight = 0m; ProductShippingLength = 0m; ProductShippingWeight = 0m; ProductShippingWidth = 0m; CustomProperties = new CustomPropertyCollection(); ShipFromAddress = new Address(); ShipFromMode = ShippingMode.ShipFromSite; ShippingCharge = ShippingChargeType.ChargeShippingAndHandling; ShipFromNotificationId = string.Empty; ShipSeparately = false; ExtraShipCharge = 0; IsTaxExempt = false; FreeShippingMethodIds = new List <string>(); RecurringBilling = new RecurringBilling(this); }
protected override void CopyDataToModel(Data.EF.bvc_OrderPackage data, OrderPackage model) { model.CustomProperties = CustomPropertyCollection.FromXml(data.CustomProperties); model.Description = data.Description; model.EstimatedShippingCost = data.EstimatedShippingCost; model.HasShipped = data.HasShipped == 1; model.Height = data.Height; model.Id = data.Id; model.ItemsFromXml(data.Items); model.LastUpdatedUtc = data.LastUpdatedUtc; model.Length = data.Length; model.OrderId = data.OrderId; model.ShipDateUtc = data.ShipDateUtc; model.ShippingProviderId = data.ShippingProviderId; model.ShippingProviderServiceCode = data.ShippingProviderServiceCode; model.SizeUnits = (LengthType)data.SizeUnits; model.StoreId = data.StoreId; model.TrackingNumber = data.TrackingNumber; model.Weight = data.Weight; model.WeightUnits = (WeightType)data.WeightUnits; model.Width = data.Width; }
protected override void CopyDataToModel(hcc_Order data, Order model) { model.AffiliateID = data.AffiliateId; model.BillingAddress.FromXmlString(data.BillingAddress); model.bvin = DataTypeHelper.GuidToBvin(data.bvin); model.CustomProperties = CustomPropertyCollection.FromXml(data.CustomProperties); model.FraudScore = data.FraudScore; model.TotalHandling = data.HandlingTotal; model.Id = data.Id; model.Instructions = data.Instructions; model.IsPlaced = data.IsPlaced == 1; model.LastUpdatedUtc = data.LastUpdated; model.OrderDiscountDetails = DiscountDetail.ListFromXml(data.OrderDiscountDetails); model.OrderNumber = data.OrderNumber; model.PaymentStatus = (OrderPaymentStatus)data.PaymentStatus; model.ShippingDiscountDetails = DiscountDetail.ListFromXml(data.ShippingDiscountDetails); model.ShippingAddress.FromXmlString(data.ShippingAddress); model.ShippingMethodDisplayName = data.ShippingMethodDisplayName; model.ShippingMethodId = data.ShippingMethodId; model.ShippingProviderId = data.ShippingProviderId; model.ShippingProviderServiceCode = data.ShippingProviderServiceCode; model.ShippingStatus = (OrderShippingStatus)data.ShippingStatus; model.TotalShippingBeforeDiscounts = data.ShippingTotal; model.TotalShippingAfterDiscounts = data.AdjustedShippingTotal; model.StatusCode = data.StatusCode; model.StatusName = data.StatusName; model.StoreId = data.StoreId; model.ItemsTax = data.ItemsTax; model.ShippingTax = data.ShippingTax; model.ShippingTaxRate = data.ShippingTaxRate; model.TotalTax = data.TaxTotal; model.ThirdPartyOrderId = data.ThirdPartyOrderId; model.TimeOfOrderUtc = data.TimeOfOrder; model.UserEmail = data.UserEmail; model.UserID = data.UserId; model.UserDeviceType = (DeviceType)data.UserDeviceType; model.IsAbandonedEmailSent = data.IsAbandonedEmailSent; model.UsedCulture = data.UsedCulture; }
public bool CustomPropertiesFromXml(string data) { bool result = false; try { StringReader tr = new StringReader(data); XmlSerializer xs = new XmlSerializer(CustomProperties.GetType()); CustomProperties = (CustomPropertyCollection)xs.Deserialize(tr); if (CustomProperties != null) { result = true; } } catch (Exception ex) { EventLog.LogEvent(ex); CustomProperties = new CustomPropertyCollection(); result = false; } return(result); }
/// <summary> /// The method can be called to clear all current property values from the vCard. The version is left /// unchanged. /// </summary> public void ClearProperties() { groupName = null; fn = null; name = null; title = null; role = null; mailer = null; url = null; org = null; uid = null; bday = null; rev = null; tz = null; geo = null; key = null; photo = null; logo = null; sound = null; notes = null; addrs = null; labels = null; phones = null; email = null; agents = null; customProps = null; addProfile = false; mimeName = null; mimeSource = null; prodId = null; nickname = null; sortString = null; classification = null; categories = null; }
public OrderPackage() { Id = 0; StoreId = 0; LastUpdatedUtc = DateTime.UtcNow; Items = new List <OrderPackageItem>(); Description = string.Empty; OrderId = string.Empty; Width = 0m; Height = 0m; Length = 0m; SizeUnits = LengthType.Inches; Weight = 0m; WeightUnits = WeightType.Pounds; ShippingProviderId = string.Empty; ShippingProviderServiceCode = string.Empty; ShippingMethodId = string.Empty; TrackingNumber = string.Empty; HasShipped = false; ShipDateUtc = DateTime.MinValue; EstimatedShippingCost = 0m; CustomProperties = new CustomPropertyCollection(); }
public OrderPackage() { this.Id = 0; this.StoreId = 0; this.LastUpdatedUtc = DateTime.UtcNow; this.Items = new List <OrderPackageItem>(); this.Description = string.Empty; this.OrderId = string.Empty; this.Width = 0m; this.Height = 0m; this.Length = 0m; this.SizeUnits = MerchantTribe.Shipping.LengthType.Inches; this.Weight = 0m; this.WeightUnits = MerchantTribe.Shipping.WeightType.Pounds; this.ShippingProviderId = string.Empty; this.ShippingProviderServiceCode = string.Empty; this.ShippingMethodId = string.Empty; this.TrackingNumber = string.Empty; this.HasShipped = false; this.ShipDateUtc = DateTime.MinValue; this.EstimatedShippingCost = 0m; this.CustomProperties = new CustomPropertyCollection(); }
/// <summary> /// The method can be called to clear all current property values from the event. The version is left /// unchanged. /// </summary> public override void ClearProperties() { classification = null; categories = null; resources = null; url = null; uid = null; geo = null; lastMod = null; dateCreated = null; startDate = null; endDate = null; dateStamp = null; summary = null; desc = null; location = null; priority = null; sequence = null; transp = null; rNum = null; comment = null; organizer = null; recurId = null; status = null; duration = null; contacts = null; attendees = null; relatedTo = null; attachments = null; reqStats = null; alarms = null; customProps = null; base.ClearProperties(); }
/// <summary> /// The method can be called to clear all current property values from the event. The version is left /// unchanged. /// </summary> public override void ClearProperties() { classification = null; categories = null; resources = null; url = null; uid = null; geo = null; lastMod = null; dateCreated = null; startDate = null; endDate = null; dateStamp = null; summary = null; desc = null; location = null; priority = null; sequence = null; transp = null; rNum = null; comment = null; organizer = null; recurId = null; status = null; duration = null; contacts = null; attendees = null; relatedTo = null; attachments = null; reqStats = null; alarms = null; customProps = null; base.ClearProperties(); }
/// <summary> /// The method can be called to clear all current property values from the vCard. The version is left /// unchanged. /// </summary> public void ClearProperties() { groupName = null; fn = null; name = null; title = null; role = null; mailer = null; url = null; org = null; uid = null; bday = null; rev = null; tz = null; geo = null; key = null; photo = null; logo = null; sound = null; notes = null; addrs = null; labels = null; phones = null; email = null; agents = null; customProps = null; addProfile = false; mimeName = null; mimeSource = null; prodId = null; nickname = null; sortString = null; classification = null; categories = null; }
/// <summary> /// Initializes a new instance of the CustomProperties class. /// </summary> public CustomProperties() { defaultProperty = null; properties = new CustomPropertyCollection(); }
/// <summary> /// The method can be called to clear all current property values from the alarm. The version is left /// unchanged. /// </summary> public override void ClearProperties() { action = null; trigger = null; repeat = null; duration = null; summary = null; desc = null; attendees = null; attachments = null; customProps = null; }
/// <summary> /// The method can be called to clear all current property values from the time zone. The version is /// left unchanged. /// </summary> public override void ClearProperties() { if(timeZoneId != null) { timeZoneId.TimeZoneIdChanged -= tzid_TimeZoneIdChanged; timeZoneId = null; } timeZoneUrl = null; lastMod = null; rules = null; customProps = null; }
/// <summary> /// The method can be called to clear all current property values from the observance. The version and /// rule type are left unchanged. /// </summary> public override void ClearProperties() { startDate = null; offsetFrom = null; offsetTo = null; comment = null; rRules = null; rDates = null; tzNames = null; customProps = null; }
/// <summary> /// The method can be called to clear all current property values from the vNote. The version is left /// unchanged. /// </summary> public void ClearProperties() { uid = null; summary = null; body = null; classification = null; categories = null; dateCreated = null; lastModified = null; customProps = null; }
/// <summary> /// The method can be called to clear all current property values in the calendar. The version is left /// unchanged. /// </summary> /// <remarks>Because time zone information is shared amongst all calendars, the <see cref="TimeZones"/> /// collection will not be cleared. If you want it cleared, you must do it manually.</remarks> public override void ClearProperties() { prodId = null; calScale = null; method = null; geo = null; tz = null; daylight = null; events = null; todos = null; journals = null; freebusy = null; customProps = null; }
public virtual CustomPropertyCollection GetProperties( XPathNavigator model, bool useCachedInformation = true ) { CustomPropertyCollection properties = new CustomPropertyCollection(); foreach ( string productPropertyAlias in StoreService.Get( GetStoreId( model, useCachedInformation ) ).ProductSettings.ProductPropertyAliases ) { properties.Add( new CustomProperty( productPropertyAlias, GetPropertyValue( model, productPropertyAlias, useCachedInformation: useCachedInformation ) ) { IsReadOnly = true } ); } return properties; }
/// <summary> /// The method can be called to clear all current property values from the free/busy object. The version /// is left unchanged. /// </summary> public override void ClearProperties() { url = null; uid = null; startDate = null; endDate = null; timeStamp = null; comment = null; organizer = null; duration = null; contact = null; attendees = null; reqstats = null; freebusy = null; customProps = null; }
// Utility method to return custom report item properties from the collection private object LookupCustomProperty(CustomPropertyCollection customProperties, string name, object defaultValue) { object customPropertyValue = defaultValue; if (customProperties == null || customProperties.Count == 0) return defaultValue; CustomProperty customProperty = customProperties[name]; if (customProperty != null) { // If the property exists check to see if it is an expression // if it is an expression return the evaluated instance // otherwise the definition value can be returned if (customProperty.Value.IsExpression) customPropertyValue = customProperty.Instance.Value; else customPropertyValue = customProperty.Value.Value; } return customPropertyValue; }