Example #1
0
        //XpoMode
        public TreeViewConfigurationPriceType(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default)
        {
            //Init Vars
            Type xpoGuidObjectType = typeof(FIN_ConfigurationPriceType);
            //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView
            FIN_ConfigurationPriceType defaultValue = (pDefaultValue != null) ? pDefaultValue as FIN_ConfigurationPriceType : null;
            //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView
            Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationPriceType);

            //Configure columnProperties
            List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>();

            columnProperties.Add(new GenericTreeViewColumnProperty("Code")
            {
                Title = Resx.global_record_code, MinWidth = 100
            });
            columnProperties.Add(new GenericTreeViewColumnProperty("Designation")
            {
                Title = Resx.global_designation, Expand = true
            });
            columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt")
            {
                Title = Resx.global_record_date_updated, MinWidth = 150, MaxWidth = 150
            });

            //Configure Criteria/XPCollection/Model
            //CriteriaOperator.Parse("Code >= 100 and Code <= 9999");
            CriteriaOperator criteria      = pXpoCriteria;
            XPCollection     xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria);

            //Call Base Initializer
            base.InitObject(
                pSourceWindow,                 //Pass parameter
                defaultValue,                  //Pass parameter
                pGenericTreeViewMode,          //Pass parameter
                pGenericTreeViewNavigatorMode, //Pass parameter
                columnProperties,              //Created Here
                xpoCollection,                 //Created Here
                typeDialogClass                //Created Here
                );
        }
Example #2
0
        void _entryBoxSelectArticle_ClosePopup(object sender, EventArgs e)
        {
            //Prepare Objects
            FIN_Article article = _entryBoxSelectArticle.Value;
            FIN_ConfigurationPriceType configurationPriceTypeDefault = (FIN_ConfigurationPriceType)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_ConfigurationPriceType), SettingsApp.XpoOidConfigurationPriceTypeDefault);

            //Get PriceType from Customer.PriceType or from default if a New Customer or a Customer without PriceType Defined in BackOffice, always revert to Price1
            PriceType priceType = (_customer != null)
                ? (PriceType)_customer.PriceType.EnumValue
                : (PriceType)configurationPriceTypeDefault.EnumValue
            ;

            //Common changes for MediaNova | Non-MediaNova Articles | Here Prices are always in Retail Mode
            PriceProperties priceProperties = FrameworkUtils.GetArticlePrice(article, priceType, TaxSellType.Normal);

            //Price
            _articlePrice = priceProperties.PriceNet;
            //Display Price
            _entryBoxValidationPrice.EntryValidation.Text        = FrameworkUtils.DecimalToString(_articlePrice);
            _entryBoxValidationPriceDisplay.EntryValidation.Text = FrameworkUtils.DecimalToString(_articlePrice * _currencyDisplay.ExchangeRate);
            _entryBoxValidationQuantity.EntryValidation.Text     = (article.DefaultQuantity > 0) ? FrameworkUtils.DecimalToString(article.DefaultQuantity) : FrameworkUtils.DecimalToString(1.0m);
            _entryBoxValidationDiscount.EntryValidation.Text     = FrameworkUtils.DecimalToString(article.Discount);

            //VatRate
            _entryBoxSelectVatRate.Value      = article.VatDirectSelling;
            _entryBoxSelectVatRate.Entry.Text = article.VatDirectSelling.Designation;

            //Default Vat Exception Reason
            if (article.VatExemptionReason != null)
            {
                _entryBoxSelectVatExemptionReason.Value      = article.VatExemptionReason;
                _entryBoxSelectVatExemptionReason.Entry.Text = article.VatExemptionReason.Designation;
            }

            //Toggle ToggleVatExemptionReasonEditMode Validation
            ToggleVatExemptionReasonEditMode();
            //Update Price Properties
            UpdatePriceProperties();
        }