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); _entryBoxSelectArticleCode.Entry.Text = article.Code; _entryBoxSelectArticle.Entry.Text = article.Designation; //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(); }
//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 = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), MinWidth = 100 }); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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 ); }