Esempio n. 1
0
        public static Tuple<decimal, decimal> GetPostagePriceAndTax(tbl_Postage postage, decimal taxValue, int domainID)
        {
            IDomain domainService = (IDomain)DependencyResolver.Current.GetService<IDomain>();

            bool useTax = domainService.GetSettingsValueAsBool(SettingsKey.useTax, domainID);
            bool priceIncludesVat = domainService.GetSettingsValueAsBool(SettingsKey.priceDisplayIncludesVAT, domainID);

            decimal postageAmount = postage.PST_Amount.GetValueOrDefault(0);

            decimal tax = useTax ? postageAmount * (taxValue / 100) : 0;
            decimal price = useTax && priceIncludesVat ? postageAmount + tax : postageAmount;

            return new Tuple<decimal, decimal>(price, tax);
        }
Esempio n. 2
0
 /// <summary>
 /// Create a new tbl_Postage object.
 /// </summary>
 /// <param name="postageID">Initial value of the PostageID property.</param>
 /// <param name="pST_DomainID">Initial value of the PST_DomainID property.</param>
 /// <param name="pST_PostageZoneID">Initial value of the PST_PostageZoneID property.</param>
 public static tbl_Postage Createtbl_Postage(global::System.Int32 postageID, global::System.Int32 pST_DomainID, global::System.Int32 pST_PostageZoneID)
 {
     tbl_Postage tbl_Postage = new tbl_Postage();
     tbl_Postage.PostageID = postageID;
     tbl_Postage.PST_DomainID = pST_DomainID;
     tbl_Postage.PST_PostageZoneID = pST_PostageZoneID;
     return tbl_Postage;
 }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tbl_Postage EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotbl_Postage(tbl_Postage tbl_Postage)
 {
     base.AddObject("tbl_Postage", tbl_Postage);
 }