//XpoMode public TreeViewConfigurationVatRate(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(FIN_ConfigurationVatRate); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView FIN_ConfigurationVatRate defaultValue = (pDefaultValue != null) ? pDefaultValue as FIN_ConfigurationVatRate : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationVatRate); //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("Value") { Title = Resx.global_vat_rate }); //columnProperties.Add(new GenericTreeViewColumnProperty("ReasonCode") { Title = Resx.global_vat_rate_reasoncode }); //columnProperties.Add(new GenericTreeViewColumnProperty("Description") { Title = Resx.global_description }); 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 ); //Protected Records ProtectedRecords.Add(SettingsApp.XpoOidConfigurationVatRateDutyFree); }
public PosDocumentFinanceArticleDialog(Window pSourceWindow, GenericTreeViewDataTable pTreeView, DialogFlags pDialogFlags, DialogMode pDialogMode, DataRow pDataSourceRow) : base(pSourceWindow, pDialogFlags, pDialogMode, pDataSourceRow) { //Parameters _sourceWindow = pSourceWindow; _dialogMode = pDialogMode; _dataSourceRow = pDataSourceRow; //References _posDocumentFinanceDialog = (_sourceWindow as PosDocumentFinanceDialog); _currencyDisplay = (_posDocumentFinanceDialog.PagePad.Pages[0] as DocumentFinanceDialogPage1).EntryBoxSelectConfigurationCurrency.Value; //Require to Update ExchangeRate after create Database _currencyDisplay.Reload(); //Get Reference for documentFinanceType _documentFinanceType = ((_sourceWindow as PosDocumentFinanceDialog).PagePad.Pages[0] as DocumentFinanceDialogPage1).EntryBoxSelectDocumentFinanceType.Value; //Init Local Vars String windowTitle = Resx.window_title_edit_article; //Get Default System Currency _currencyDefaultSystem = SettingsApp.ConfigurationSystemCurrency; //Consignation Invoice default values _vatRateConsignationInvoice = (FIN_ConfigurationVatRate)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_ConfigurationVatRate), SettingsApp.XpoOidConfigurationVatRateDutyFree); _vatRateConsignationInvoiceExemptionReason = (FIN_ConfigurationVatExemptionReason)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_ConfigurationVatExemptionReason), SettingsApp.XpoOidConfigurationVatExemptionReasonM99); //TODO:THEME _windowSize = new Size(760, 360); String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_finance_article.png"); //Get Discount from Select Customer _discountGlobal = FrameworkUtils.StringToDecimal(((pSourceWindow as PosDocumentFinanceDialog).PagePad.Pages[1] as DocumentFinanceDialogPage2).EntryBoxCustomerDiscount.EntryValidation.Text); //Get PriceType from Customer var customerObject = ((pSourceWindow as PosDocumentFinanceDialog).PagePad.Pages[1] as DocumentFinanceDialogPage2).EntryBoxSelectCustomerName; if (customerObject.Value != null) { Guid customerOid = customerObject.Value.Oid; _customer = (ERP_Customer)GlobalFramework.SessionXpo.GetObjectByKey(typeof(ERP_Customer), customerOid); } //ActionArea Buttons _buttonOk = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok); _buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel); //ActionArea ActionAreaButtons actionAreaButtons = new ActionAreaButtons(); actionAreaButtons.Add(new ActionAreaButton(_buttonOk, ResponseType.Ok)); actionAreaButtons.Add(new ActionAreaButton(_buttonCancel, ResponseType.Cancel)); //Init Content Fixed fixedContent = new Fixed(); //Init Transport Documents Lists _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeDeliveryNote.ToString()); _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeTransportationGuide.ToString()); _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeOwnAssetsDriveGuide.ToString()); _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeConsignmentGuide.ToString()); _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeReturnGuide.ToString()); //Init Components InitUI(); //Put fixedContent.Put(_vboxEntrys, 0, 0); //Init Object this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, _windowSize, fixedContent, actionAreaButtons); }
private void InitUI() { //Init Local Vars //Default Values (INSERT) FIN_Article initialValueSelectArticle = (_dataSourceRow["Article.Code"] as FIN_Article); string initialValuePrice = FrameworkUtils.DecimalToString(0); string initialValuePriceDisplay = FrameworkUtils.DecimalToString(0); string initialValueQuantity = FrameworkUtils.DecimalToString(0); string initialValueDiscount = FrameworkUtils.DecimalToString(0); string initialValueTotalNet = FrameworkUtils.DecimalToString(0); string initialValueTotalFinal = FrameworkUtils.DecimalToString(0); string initialValueNotes = string.Empty; FIN_ConfigurationVatRate initialValueSelectConfigurationVatRate = (FIN_ConfigurationVatRate)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_ConfigurationVatRate), SettingsApp.XpoOidArticleDefaultVatDirectSelling); FIN_ConfigurationVatExemptionReason initialValueSelectConfigurationVatExemptionReason = null; //Update Record : Override Default Values if (initialValueSelectArticle != null && initialValueSelectArticle.Oid != Guid.Empty) { //Always display Values from DataRow, for Both INSERT and UPDATE Modes, We Have defaults comming from ColumnProperties initialValuePrice = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["Price"].ToString()); initialValuePriceDisplay = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["PriceDisplay"].ToString()); initialValueQuantity = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["Quantity"].ToString()); initialValueDiscount = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["Discount"].ToString()); initialValueTotalNet = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["TotalNet"].ToString()); initialValueTotalFinal = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["TotalFinal"].ToString()); initialValueSelectConfigurationVatRate = (_dataSourceRow["ConfigurationVatRate.Value"] as FIN_ConfigurationVatRate); initialValueSelectConfigurationVatExemptionReason = (_dataSourceRow["VatExemptionReason.Acronym"] as FIN_ConfigurationVatExemptionReason); initialValueNotes = _dataSourceRow["Notes"].ToString(); //Required, Else Wrong Calculation in UPDATES, when Price is not Defined : //Reverse Price if not in default System Currency, else use value from Input _articlePrice = (_currencyDefaultSystem == _currencyDisplay) ? FrameworkUtils.StringToDecimal(initialValuePriceDisplay) : (FrameworkUtils.StringToDecimal(initialValuePriceDisplay) / _currencyDisplay.ExchangeRate) ; } //Initialize crudWidgetsList _crudWidgetList = new GenericCRUDWidgetListDataTable(); //SelectArticle CriteriaOperator criteriaOperatorSelectArticle = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled <> 1)"); _entryBoxSelectArticle = new XPOEntryBoxSelectRecord <FIN_Article, TreeViewArticle>(this, Resx.global_article, "Designation", "Oid", initialValueSelectArticle, criteriaOperatorSelectArticle); _entryBoxSelectArticle.Entry.IsEditable = false; //Add to WidgetList _crudWidgetSelectArticle = new GenericCRUDWidgetDataTable(_entryBoxSelectArticle, _entryBoxSelectArticle.Label, _dataSourceRow, "Oid", _regexGuid, true); _crudWidgetList.Add(_crudWidgetSelectArticle); //Used only to Update DataRow Column from Widget : Used to force Assign XPGuidObject ChildNames to Columns _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxSelectArticle, new Label(), _dataSourceRow, "Article.Code")); _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxSelectArticle, new Label(), _dataSourceRow, "Article.Designation")); //Events _entryBoxSelectArticle.ClosePopup += _entryBoxSelectArticle_ClosePopup; //Price : Used only in Debug Mode, to Inspect SystemCurrency Values : To View add it to hboxPriceQuantityDiscountAndTotals.PackStart //Note #1 //Removed. this will trigger an error when use a zero Price WayBill to issue an Invoice, better use discount 100% //If not Saft Document Type 2, required greater than zero in Price, else we can have zero or greater from Document Type 2 (ex Transportation Guide) //string regExPrice = (!_listSaftDocumentType2.Contains(_documentFinanceType.Oid.ToString())) ? _regexDecimalGreaterThanZero : _regexDecimalGreaterEqualThanZero; // Now all regExPrice must be greater than Zero string regExPrice = _regexDecimalGreaterThanZero; _entryBoxValidationPrice = new EntryBoxValidation(this, "Price EUR(*)", KeyboardMode.Numeric, regExPrice, true); _entryBoxValidationPrice.EntryValidation.Text = initialValuePrice; _entryBoxValidationPrice.EntryValidation.Sensitive = false; //Add to WidgetList _crudWidgetPrice = new GenericCRUDWidgetDataTable(_entryBoxValidationPrice, _entryBoxValidationPrice.Label, _dataSourceRow, "Price", regExPrice, true); _crudWidgetList.Add(_crudWidgetPrice); //PriceDisplay //Note #1 //If not Saft Document Type 2, required greater than zero in Price, else we can have zero or greater from Document Type 2 (ex Transportation Guide) _entryBoxValidationPriceDisplay = new EntryBoxValidation(this, Resx.global_price, KeyboardMode.Numeric, regExPrice, true); _entryBoxValidationPriceDisplay.EntryValidation.Text = initialValuePriceDisplay; //Add to WidgetList _crudWidgetPriceDisplay = new GenericCRUDWidgetDataTable(_entryBoxValidationPriceDisplay, _entryBoxValidationPriceDisplay.Label, _dataSourceRow, "PriceDisplay", regExPrice, true); _crudWidgetList.Add(_crudWidgetPriceDisplay); //Events _entryBoxValidationPriceDisplay.EntryValidation.Changed += delegate { if (_crudWidgetPriceDisplay.Validated) { //Reverse Price if not in default System Currency, else use value from Input _articlePrice = (_currencyDefaultSystem == _currencyDisplay) ? FrameworkUtils.StringToDecimal(_entryBoxValidationPriceDisplay.EntryValidation.Text) : (FrameworkUtils.StringToDecimal(_entryBoxValidationPriceDisplay.EntryValidation.Text) / _currencyDisplay.ExchangeRate); //Assign to System Currency Price _entryBoxValidationPrice.EntryValidation.Text = FrameworkUtils.DecimalToString(_articlePrice); UpdatePriceProperties(); } }; _entryBoxValidationPriceDisplay.EntryValidation.FocusOutEvent += delegate { _entryBoxValidationPriceDisplay.EntryValidation.Text = FrameworkUtils.StringToDecimalAndToStringAgain(_entryBoxValidationPriceDisplay.EntryValidation.Text); }; //Start with _articlePrice Assigned: DISABLED //_articlePrice = (_currencyDefaultSystem == _currencyDisplay) // ? FrameworkUtils.StringToDecimal(_entryBoxValidationPriceDisplay.EntryValidation.Text) // : (FrameworkUtils.StringToDecimal(_entryBoxValidationPriceDisplay.EntryValidation.Text) / _currencyDisplay.ExchangeRate) // ; //Quantity _entryBoxValidationQuantity = new EntryBoxValidation(this, Resx.global_quantity, KeyboardMode.Numeric, _regexDecimalGreaterThanZero, true); _entryBoxValidationQuantity.EntryValidation.Text = initialValueQuantity; //Add to WidgetList _crudWidgetQuantity = new GenericCRUDWidgetDataTable(_entryBoxValidationQuantity, _entryBoxValidationQuantity.Label, _dataSourceRow, "Quantity", _regexDecimalGreaterThanZero, true); _crudWidgetList.Add(_crudWidgetQuantity); //Events _entryBoxValidationQuantity.EntryValidation.Changed += delegate { UpdatePriceProperties(); }; _entryBoxValidationQuantity.EntryValidation.FocusOutEvent += delegate { _entryBoxValidationQuantity.EntryValidation.Text = FrameworkUtils.StringToDecimalAndToStringAgain(_entryBoxValidationQuantity.EntryValidation.Text); }; //Discount _entryBoxValidationDiscount = new EntryBoxValidation(this, Resx.global_discount, KeyboardMode.Numeric, _regexPercentage, true); _entryBoxValidationDiscount.EntryValidation.Text = initialValueDiscount; //Add to WidgetList _crudWidgetDiscount = new GenericCRUDWidgetDataTable(_entryBoxValidationDiscount, _entryBoxValidationDiscount.Label, _dataSourceRow, "Discount", _regexPercentage, true); _crudWidgetList.Add(_crudWidgetDiscount); //Events _entryBoxValidationDiscount.EntryValidation.Changed += delegate { UpdatePriceProperties(); }; _entryBoxValidationDiscount.EntryValidation.FocusOutEvent += delegate { _entryBoxValidationDiscount.EntryValidation.Text = FrameworkUtils.StringToDecimalAndToStringAgain(_entryBoxValidationDiscount.EntryValidation.Text); }; //TotalGross _entryBoxValidationTotalNet = new EntryBoxValidation(this, Resx.global_totalnet, KeyboardMode.None); _entryBoxValidationTotalNet.EntryValidation.Text = initialValueTotalNet; _entryBoxValidationTotalNet.EntryValidation.Sensitive = false; //Used only to Update DataRow Column from Widget _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationTotalNet, new Label(), _dataSourceRow, "TotalNet")); //TotalFinal _entryBoxValidationTotalFinal = new EntryBoxValidation(this, Resx.global_total, KeyboardMode.None); _entryBoxValidationTotalFinal.EntryValidation.Text = initialValueTotalFinal; _entryBoxValidationTotalFinal.EntryValidation.Sensitive = false; //Used only to Update DataRow Column from Widget _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationTotalFinal, new Label(), _dataSourceRow, "TotalFinal")); //HBox PriceQuantityDiscountAndTotals HBox hboxPriceQuantityDiscountAndTotals = new HBox(true, 0); //Invisible, only used to Debug, to View Values in System Currency //hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationPrice, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationPriceDisplay, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationQuantity, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationDiscount, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationTotalNet, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationTotalFinal, true, true, 0); //SelectVatRate CriteriaOperator criteriaOperatorSelectVatRate = CriteriaOperator.Parse("(Disabled = 0 OR Disabled IS NULL)"); _entryBoxSelectVatRate = new XPOEntryBoxSelectRecord <FIN_ConfigurationVatRate, TreeViewConfigurationVatRate>(this, Resx.global_vat_rate, "Designation", "Oid", initialValueSelectConfigurationVatRate, criteriaOperatorSelectVatRate); _entryBoxSelectVatRate.WidthRequest = 149; _entryBoxSelectVatRate.Entry.IsEditable = false; _entryBoxSelectVatRate.Entry.Changed += _entryBoxSelectVatRate_EntryValidation_Changed; //Add to WidgetList _crudWidgetSelectVatRate = new GenericCRUDWidgetDataTable(_entryBoxSelectVatRate, _entryBoxSelectVatRate.Label, _dataSourceRow, "ConfigurationVatRate.Value", _regexGuid, true); _crudWidgetList.Add(_crudWidgetSelectVatRate); //SelectVatExemptionReason CriteriaOperator criteriaOperatorSelectVatExemptionReason = CriteriaOperator.Parse("(Disabled = 0 OR Disabled IS NULL)"); _entryBoxSelectVatExemptionReason = new XPOEntryBoxSelectRecord <FIN_ConfigurationVatExemptionReason, TreeViewConfigurationVatExceptionReason>(this, Resx.global_vat_exemption_reason, "Designation", "Oid", initialValueSelectConfigurationVatExemptionReason, criteriaOperatorSelectVatExemptionReason); _entryBoxSelectVatExemptionReason.Entry.IsEditable = false; //Add to WidgetList _crudWidgetSelectVatExemptionReason = new GenericCRUDWidgetDataTable(_entryBoxSelectVatExemptionReason, _entryBoxSelectVatExemptionReason.Label, _dataSourceRow, "VatExemptionReason.Acronym", _regexGuid, true); _crudWidgetList.Add(_crudWidgetSelectVatExemptionReason); //ToggleMode: Edit Active/Inactive ToggleVatExemptionReasonEditMode(); //HBox VatRateAndVatExemptionReason HBox hboxVatRateAndVatExemptionReason = new HBox(false, 0); hboxVatRateAndVatExemptionReason.PackStart(_entryBoxSelectVatRate, false, false, 0); hboxVatRateAndVatExemptionReason.PackStart(_entryBoxSelectVatExemptionReason, true, true, 0); //Token1 _entryBoxValidationToken1 = new EntryBoxValidation(this, "Token1", KeyboardMode.None); _entryBoxValidationToken1.EntryValidation.Sensitive = false; //Used only to Update DataRow Column from Widget _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationToken1, new Label(), _dataSourceRow, "Token1")); //Token2 _entryBoxValidationToken2 = new EntryBoxValidation(this, "Token2", KeyboardMode.None); _entryBoxValidationToken2.EntryValidation.Sensitive = false; //Used only to Update DataRow Column from Widget _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationToken2, new Label(), _dataSourceRow, "Token2")); //Notes _entryBoxValidationNotes = new EntryBoxValidation(this, "Notes", KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, false); _entryBoxValidationNotes.EntryValidation.Text = initialValueNotes; _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationNotes, new Label(), _dataSourceRow, "Notes")); //Uncomment to Show Invisible Widgets //HBox Token1AndToken2 //HBox hboxToken1AndToken2 = new HBox(false, 0); //hboxToken1AndToken2.PackStart(_entryBoxToken1, false, false, 0); //hboxToken1AndToken2.PackStart(_entryBoxToken2, true, true, 0); //Pack in VBox _vboxEntrys = new VBox(true, 0); _vboxEntrys.PackStart(_entryBoxSelectArticle); _vboxEntrys.PackStart(hboxPriceQuantityDiscountAndTotals); _vboxEntrys.PackStart(hboxVatRateAndVatExemptionReason); //Uncomment to Show Invisible Widgets //_vboxEntrys.PackStart(hboxToken1AndToken2); _vboxEntrys.PackStart(_entryBoxValidationNotes); _vboxEntrys.WidthRequest = _windowSize.Width - 13; // CreditNote : Protect all components, only Quantity is Editable in CreditMode if (_documentFinanceType.Oid == SettingsApp.XpoOidDocumentFinanceTypeCreditNote) { //Article _entryBoxSelectArticle.Entry.Sensitive = false; _entryBoxSelectArticle.ButtonSelectValue.Sensitive = false; //PriceDisplay _entryBoxValidationPriceDisplay.EntryValidation.Sensitive = false; _entryBoxValidationPriceDisplay.ButtonKeyBoard.Sensitive = false; //Discount _entryBoxValidationDiscount.EntryValidation.Sensitive = false; _entryBoxValidationDiscount.ButtonKeyBoard.Sensitive = false; //VatRate _entryBoxSelectVatRate.Entry.Sensitive = false; _entryBoxSelectVatRate.ButtonSelectValue.Sensitive = false; //VatExemptionReason _entryBoxSelectVatExemptionReason.Entry.Sensitive = false; _entryBoxSelectVatExemptionReason.ButtonSelectValue.Sensitive = false; } }
private void InitUI() { try { //Get XpoObject Reference from DataSourceRow FIN_ConfigurationVatRate _configurationVatRate = (DataSourceRow as FIN_ConfigurationVatRate); //Tab1 VBox vboxTab1 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing }; //Ord Entry entryOrd = new Entry(); BOWidgetBox boxLabel = new BOWidgetBox(Resx.global_record_order, entryOrd); vboxTab1.PackStart(boxLabel, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true)); //Code Entry entryCode = new Entry(); BOWidgetBox boxCode = new BOWidgetBox(Resx.global_record_code, entryCode); vboxTab1.PackStart(boxCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true)); //Designation Entry entryDesignation = new Entry(); BOWidgetBox boxDesignation = new BOWidgetBox(Resx.global_designation, entryDesignation); vboxTab1.PackStart(boxDesignation, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true)); //Value Entry entryValue = new Entry(); BOWidgetBox boxValue = new BOWidgetBox(Resx.global_vat_rate_value, entryValue); vboxTab1.PackStart(boxValue, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", SettingsApp.RegexDecimalGreaterThanZero, true)); //TaxType Entry entryTaxType = new Entry(); BOWidgetBox boxTaxType = new BOWidgetBox(Resx.global_vat_rate_tax_type, entryTaxType); vboxTab1.PackStart(boxTaxType, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxType, _dataSourceRow, "TaxType", SettingsApp.RegexAlfa, true)); //TaxCode Entry entryTaxCode = new Entry(); BOWidgetBox boxTaxCode = new BOWidgetBox(Resx.global_vat_rate_tax_code, entryTaxCode); vboxTab1.PackStart(boxTaxCode, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxCode, _dataSourceRow, "TaxCode", SettingsApp.RegexAlfa, true)); //TaxCountryRegion Entry entryTaxCountryRegion = new Entry(); BOWidgetBox boxTaxCountryRegion = new BOWidgetBox(Resx.global_vat_rate_tax_country_region, entryTaxCountryRegion); vboxTab1.PackStart(boxTaxCountryRegion, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxCountryRegion, _dataSourceRow, "TaxCountryRegion", SettingsApp.RegexAlfaNumericExtended, true)); //TaxDescription Entry entryTaxDescription = new Entry(); BOWidgetBox boxTaxDescription = new BOWidgetBox(Resx.global_description, entryTaxDescription); vboxTab1.PackStart(boxTaxDescription, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxDescription, _dataSourceRow, "TaxDescription", SettingsApp.RegexAlfaNumericExtended, true)); //Disabled CheckButton checkButtonDisabled = new CheckButton(Resx.global_record_disabled); if (_dialogMode == DialogMode.Insert) { checkButtonDisabled.Active = SettingsApp.BOXPOObjectsStartDisabled; } vboxTab1.PackStart(checkButtonDisabled, false, false, 0); _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonDisabled, _dataSourceRow, "Disabled")); //Append Tab _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail)); //Disable Components bool enableComponents = !( _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateNormalPT || _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateIntermediatePT || _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateReducedPT || _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateNormalPTMA || _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateIntermediatePTMA || _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateReducedPTMA || _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateNormalPTAC || _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateIntermediatePTAC || _configurationVatRate.Oid == SettingsApp.XpoOidConfigurationVatRateReducedPTAC ); entryDesignation.Sensitive = enableComponents; entryTaxType.Sensitive = enableComponents; entryTaxCode.Sensitive = enableComponents; entryTaxCountryRegion.Sensitive = enableComponents; checkButtonDisabled.Sensitive = enableComponents; } catch (System.Exception ex) { _log.Error(ex.Message, ex); } }