示例#1
0
        void buttonPrintInvoiceExchangeRate_Clicked(object sender, EventArgs e)
        {
            Guid documentTypeGuid = SettingsApp.XpoOidDocumentFinanceTypeInvoice;
            Guid customerGuid     = new Guid("6223881a-4d2d-4de4-b254-f8529193da33");
            Guid currencyGuid     = new Guid("28d692ad-0083-11e4-96ce-00ff2353398c");
            CFG_ConfigurationCurrency currency = (CFG_ConfigurationCurrency)GlobalFramework.SessionXpo.GetObjectByKey(typeof(CFG_ConfigurationCurrency), currencyGuid);

            //Article:Line1
            Guid        article1Guid = new Guid("72e8bde8-d03b-4637-90f1-fcb265658af0");
            FIN_Article article1     = (FIN_Article)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_Article), article1Guid);
            //Article:Line2
            Guid        article2Guid = new Guid("78638720-e728-4e96-8643-6d6267ff817b");
            FIN_Article article2     = (FIN_Article)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_Article), article2Guid);
            //Place
            Guid placeGuid = new Guid("dd5a3869-db52-42d4-bbed-dec4adfaf62b");
            //Table
            Guid tableGuid = new Guid("64d417f6-ff97-4f4b-bded-4bc9bf9f18d9");

            //Get ArticleBag
            ArticleBag articleBag = new ArticleBag();

            articleBag.Add(article1, placeGuid, tableGuid, PriceType.Price1, 100.0m);
            articleBag.Add(article2, placeGuid, tableGuid, PriceType.Price1, 1.0m);

            //Prepare ProcessFinanceDocumentParameter
            ProcessFinanceDocumentParameter processFinanceDocumentParameter = new ProcessFinanceDocumentParameter(
                documentTypeGuid, articleBag)
            {
                Customer     = customerGuid,
                SourceMode   = PersistFinanceDocumentSourceMode.CustomArticleBag,
                Currency     = currencyGuid,
                ExchangeRate = currency.ExchangeRate
            };
            FIN_DocumentFinanceMaster resultDocument = FrameworkCalls.PersistFinanceDocument(SourceWindow, processFinanceDocumentParameter);
        }
示例#2
0
        private void InitUI()
        {
            //Initial Values
            FIN_ConfigurationPaymentMethod initialValueConfigurationPaymentMethod = (FIN_ConfigurationPaymentMethod)FrameworkUtils.GetXPGuidObject(typeof(FIN_ConfigurationPaymentMethod), SettingsApp.XpoOidConfigurationPaymentMethodDefaultInvoicePaymentMethod);
            CFG_ConfigurationCurrency      intialValueConfigurationCurrency       = SettingsApp.ConfigurationSystemCurrency;
            string initialPaymentDate = FrameworkUtils.CurrentDateTimeAtomic().ToString(SettingsApp.DateTimeFormat);

            //ConfigurationPaymentMethod
            string           filterValidPaymentMethod = "(Token = 'CREDIT_CARD' OR Token = 'BANK_CHECK' OR Token = 'MONEY' OR Token = 'BANK_TRANSFER' OR Token = 'CASH_MACHINE' OR Token = 'VISA' OR Token = 'OTHER')";
            CriteriaOperator criteriaOperatorConfigurationPaymentMethod = CriteriaOperator.Parse(string.Format("(Disabled IS NULL OR Disabled  <> 1)  AND Oid <> '{0}' AND {1}", SettingsApp.XpoOidConfigurationPaymentMethodCurrentAccount.ToString(), filterValidPaymentMethod));

            _entryBoxSelectConfigurationPaymentMethod = new XPOEntryBoxSelectRecordValidation <FIN_ConfigurationPaymentMethod, TreeViewConfigurationPaymentMethod>(_sourceWindow, Resx.global_payment_method, "Designation", "Oid", initialValueConfigurationPaymentMethod, criteriaOperatorConfigurationPaymentMethod, SettingsApp.RegexGuid, true);
            _entryBoxSelectConfigurationPaymentMethod.EntryValidation.Changed   += delegate { Validate(); };
            _entryBoxSelectConfigurationPaymentMethod.EntryValidation.IsEditable = false;

            //ConfigurationCurrency
            CriteriaOperator criteriaOperatorConfigurationCurrency = CriteriaOperator.Parse(string.Format("(Disabled IS NULL OR Disabled  <> 1) AND (ExchangeRate IS NOT NULL OR Oid = '{0}')", SettingsApp.ConfigurationSystemCurrency.Oid.ToString()));

            _entryBoxSelectConfigurationCurrency = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCurrency, TreeViewConfigurationCurrency>(_sourceWindow, Resx.global_currency, "Designation", "Oid", intialValueConfigurationCurrency, criteriaOperatorConfigurationCurrency, SettingsApp.RegexGuid, false);
            _entryBoxSelectConfigurationCurrency.EntryValidation.Changed   += _entryBoxSelectConfigurationCurrency_Changed;
            _entryBoxSelectConfigurationCurrency.EntryValidation.IsEditable = false;

            //PaymentAmount
            _entryPaymentAmount = new EntryBoxValidation(_sourceWindow, Resx.global_total_deliver, KeyboardMode.Numeric, SettingsApp.RegexDecimalGreaterEqualThanZero, true);
            _entryPaymentAmount.EntryValidation.Text = FrameworkUtils.DecimalToString(_paymentAmountTotal);
            _entryPaymentAmount.EntryValidation.Validate();
            _entryPaymentAmount.EntryValidation.Changed += delegate {
                Validate();
                UpdateTitleBar();
            };

            //PaymentDate
            _entryBoxPaymentDate = new EntryBoxValidation(_sourceWindow, Resx.global_date, KeyboardMode.Alfa, SettingsApp.RegexDateTime, true);
            _entryBoxPaymentDate.EntryValidation.Text = initialPaymentDate;
            _entryBoxPaymentDate.EntryValidation.Validate();
            _entryBoxPaymentDate.EntryValidation.Changed += delegate { Validate(); };

            //PaymentNotes
            _entryBoxDocumentPaymentNotes = new EntryBoxValidation(_sourceWindow, Resx.global_notes, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            _entryBoxDocumentPaymentNotes.EntryValidation.Changed += delegate { Validate(); };

            //Pack VBOX
            VBox vbox = new VBox(false, 0);

            vbox.PackStart(_entryBoxSelectConfigurationPaymentMethod, true, true, 0);
            vbox.PackStart(_entryBoxSelectConfigurationCurrency, false, false, 0);
            vbox.PackStart(_entryPaymentAmount, false, false, 0);
            vbox.PackStart(_entryBoxPaymentDate, false, false, 0);
            vbox.PackStart(_entryBoxDocumentPaymentNotes, false, false, 0);
            vbox.PackStart(_entryBoxDocumentPaymentNotes, false, false, 0);
            vbox.WidthRequest = _windowSize.Width - 14;

            //Put in FinishContent
            _fixedContent = new Fixed();
            _fixedContent.Put(vbox, 0, 0);
        }
示例#3
0
        //XpoMode
        public TreeViewConfigurationCurrency(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default)
        {
            //Init Vars
            Type xpoGuidObjectType = typeof(CFG_ConfigurationCurrency);
            //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView
            CFG_ConfigurationCurrency defaultValue = (pDefaultValue != null) ? pDefaultValue as CFG_ConfigurationCurrency : null;
            //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView
            Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationCurrency);

            //Config
            int fontGenericTreeViewColumn = Convert.ToInt16(GlobalFramework.Settings["fontGenericTreeViewColumn"]);

            //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("Acronym")
            {
                Title = Resx.global_ConfigurationCurrency_Acronym
            });
            //columnProperties.Add(new GenericTreeViewColumnProperty("ExchangeRate") {
            //    Title = Resx.global_exchangerate,
            //    Type = typeof(Decimal),
            //    Alignment = 1.0F
            //    //WIP
            //    //FontDesc = new Pango.FontDescription() { Size = 11 }, // Removed, this will make Trees that use it has diferent row Sizes
            //    //,CellRenderer = new CellRendererText() { Alignment = Pango.Alignment.Right, Xalign = 1.0F }
            //});
            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
                );
        }
示例#4
0
        private void UpdateTouchButtonSplitPaymentLabels(TouchButtonSplitPayment touchButtonSplitPayment)
        {
            bool debug = false;

            try
            {
                string labelPaymentDetails = string.Empty;
                ProcessFinanceDocumentParameter processFinanceDocumentParameter = touchButtonSplitPayment.ProcessFinanceDocumentParameter;

                if (processFinanceDocumentParameter != null)
                {
                    if (debug)
                    {
                        _log.Debug(Environment.NewLine);
                    }
                    foreach (var item in touchButtonSplitPayment.ArticleBag)
                    {
                        if (debug)
                        {
                            _log.Debug(string.Format("\t[{0}],[{1}],[{2}]", item.Key.Designation, item.Value.Quantity, item.Value.TotalFinal));
                        }
                    }

                    ERP_Customer customer = (ERP_Customer)FrameworkUtils.GetXPGuidObject(typeof(ERP_Customer), processFinanceDocumentParameter.Customer);
                    FIN_ConfigurationPaymentMethod paymentMethod = (FIN_ConfigurationPaymentMethod)FrameworkUtils.GetXPGuidObject(typeof(FIN_ConfigurationPaymentMethod), processFinanceDocumentParameter.PaymentMethod);
                    CFG_ConfigurationCurrency      currency      = (CFG_ConfigurationCurrency)FrameworkUtils.GetXPGuidObject(typeof(CFG_ConfigurationCurrency), processFinanceDocumentParameter.Currency);
                    // Compose labelPaymentDetails
                    string totalFinal    = FrameworkUtils.DecimalToStringCurrency(processFinanceDocumentParameter.ArticleBag.TotalFinal, currency.Acronym);
                    string totalDelivery = FrameworkUtils.DecimalToStringCurrency(processFinanceDocumentParameter.TotalDelivery, currency.Acronym);
                    string totalChange   = FrameworkUtils.DecimalToStringCurrency(processFinanceDocumentParameter.TotalChange, currency.Acronym);
                    string moneyExtra    = (paymentMethod.Token.Equals("MONEY")) ? $" : ({totalDelivery}/{totalChange})" : string.Empty;
                    // Override default labelPaymentDetails
                    labelPaymentDetails = $"{customer.Name} : {paymentMethod.Designation} : {totalFinal}{moneyExtra}";
                }
                // Assign to button Reference
                touchButtonSplitPayment.LabelPaymentDetails.Text = labelPaymentDetails;
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
示例#5
0
        public DocumentFinanceDialogPreview(Window pSourceWindow, DialogFlags pDialogFlags, DocumentFinanceDialogPreviewMode pMode, ArticleBag pArticleBag, CFG_ConfigurationCurrency pConfigurationCurrency)
            : base(pSourceWindow, pDialogFlags)
        {
            //Init Local Vars
            String windowTitle           = string.Empty;
            Size   windowSize            = new Size(700, 360);
            String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_preview.png");

            //Parameters
            _articleBag            = pArticleBag;
            _configurationCurrency = pConfigurationCurrency;

            //ActionArea
            ActionAreaButtons actionAreaButtons = new ActionAreaButtons();

            if (pMode == DocumentFinanceDialogPreviewMode.Preview)
            {
                windowTitle = Resx.window_title_dialog_documentfinance_preview_totals_mode_preview;
                //ActionArea Buttons
                TouchButtonIconWithText buttonOk = new TouchButtonIconWithText("touchButtonOk_DialogActionArea", _colorBaseDialogActionAreaButtonBackground, Resx.global_button_label_ok, _fontBaseDialogActionAreaButton, _colorBaseDialogActionAreaButtonFont, _fileActionOK, _sizeBaseDialogActionAreaButtonIcon, _sizeBaseDialogActionAreaButton.Width, _sizeBaseDialogActionAreaButton.Height);
                //ActionArea
                actionAreaButtons.Add(new ActionAreaButton(buttonOk, ResponseType.Ok));
            }
            else
            {
                windowTitle = Resx.window_title_dialog_documentfinance_preview_totals_mode_confirm;
                //ActionArea Buttons
                TouchButtonIconWithText buttonNo  = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.No);
                TouchButtonIconWithText buttonYes = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Yes);
                //ActionArea
                actionAreaButtons.Add(new ActionAreaButton(buttonYes, ResponseType.Yes));
                actionAreaButtons.Add(new ActionAreaButton(buttonNo, ResponseType.No));
            }
            windowTitle = string.Format("{0} [{1}]", windowTitle, _configurationCurrency.Acronym);

            InitUI();

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, windowSize, _alignmentWindow, actionAreaButtons);
        }
示例#6
0
        //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        //Methods

        public string GetPageTitle(int pPageIndex)
        {
            string result = string.Empty;

            result = string.Format("{0} : {1}",
                                   Resx.window_title_dialog_new_finance_document,
                                   Resx.ResourceManager.GetString(string.Format("window_title_dialog_document_finance_page{0}", pPageIndex + 1))
                                   );

            //Enable/Disable ClearCustomer
            if (_buttonClearCustomer != null)
            {
                _buttonClearCustomer.Visible = (_pagePad2 != null && pPageIndex == 1);
            }

            //Enable/Disable Preview
            if (_pagePad3 != null && _pagePad3.ArticleBag != null)
            {
                //Reference
                CFG_ConfigurationCurrency configurationCurrency = _pagePad1.EntryBoxSelectConfigurationCurrency.Value;

                //Always Update Totals before Show Title
                _pagePad3.ArticleBag.DiscountGlobal = FrameworkUtils.StringToDecimal(_pagePad2.EntryBoxCustomerDiscount.EntryValidation.Text);
                _pagePad3.ArticleBag.UpdateTotals();

                if (_pagePad3.ArticleBag.TotalFinal > 0)
                {
                    result += string.Format(" : {0}", FrameworkUtils.DecimalToStringCurrency(_pagePad3.ArticleBag.TotalFinal * configurationCurrency.ExchangeRate, configurationCurrency.Acronym));
                    //Enable or Disabled Preview Button
                    _buttonPreview.Visible = true;
                }
                else
                {
                    //Enable or Disabled Preview Button
                    _buttonPreview.Visible = false;
                }
            }

            return(result);
        }
示例#7
0
        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);
        }
示例#8
0
        private void InitUI()
        {
            //Get Values from Config
            Guid systemCountry;
            Guid systemCurrency;
            bool debug = false;
            bool useDatabaseDataDemo = Convert.ToBoolean(GlobalFramework.Settings["useDatabaseDataDemo"]);

            if (GlobalFramework.Settings["xpoOidConfigurationCountrySystemCountry"] != string.Empty)
            {
                systemCountry = new Guid(GlobalFramework.Settings["xpoOidConfigurationCountrySystemCountry"]);
            }
            else
            {
                systemCountry = SettingsApp.XpoOidConfigurationCountryPortugal;
            }

            if (GlobalFramework.Settings["xpoOidConfigurationCurrencySystemCurrency"] != string.Empty)
            {
                systemCurrency = new Guid(GlobalFramework.Settings["xpoOidConfigurationCurrencySystemCurrency"]);
            }
            else
            {
                systemCurrency = SettingsApp.XpoOidConfigurationCurrencyEuro;
            }

            //Init Inital Values
            CFG_ConfigurationCountry  intialValueConfigurationCountry  = (CFG_ConfigurationCountry)FrameworkUtils.GetXPGuidObject(typeof(CFG_ConfigurationCountry), systemCountry);
            CFG_ConfigurationCurrency intialValueConfigurationCurrency = (CFG_ConfigurationCurrency)FrameworkUtils.GetXPGuidObject(typeof(CFG_ConfigurationCurrency), systemCurrency);

            try
            {
                //Init dictionary for Parameters + Widgets
                _dictionaryObjectBag = new Dictionary <CFG_ConfigurationPreferenceParameter, EntryBoxValidation>();

                //Pack VBOX
                VBox vbox = new VBox(true, 2)
                {
                    WidthRequest = 300
                };

                //Country
                CriteriaOperator criteriaOperatorSystemCountry = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1) AND (RegExFiscalNumber IS NOT NULL)");
                _entryBoxSelectSystemCountry = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCountry, TreeViewConfigurationCountry>(this, Resx.global_country, "Designation", "Oid", intialValueConfigurationCountry, criteriaOperatorSystemCountry, SettingsApp.RegexGuid, true);
                _entryBoxSelectSystemCountry.EntryValidation.IsEditable = false;
                _entryBoxSelectSystemCountry.EntryValidation.Validate(_entryBoxSelectSystemCountry.Value.Oid.ToString());
                //Disabled, Now Country and Currency are disabled
                _entryBoxSelectSystemCountry.ButtonSelectValue.Sensitive = true;
                _entryBoxSelectSystemCountry.EntryValidation.Sensitive   = true;
                _entryBoxSelectSystemCountry.ClosePopup += delegate
                {
                    ////Require to Update RegEx
                    _entryBoxZipCode.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                    _entryBoxZipCode.EntryValidation.Validate();
                    //Require to Update RegEx and Criteria to filter Country Clients Only
                    _entryBoxFiscalNumber.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                    _entryBoxFiscalNumber.EntryValidation.Validate();
                    if (_entryBoxFiscalNumber.EntryValidation.Validated)
                    {
                        bool isValidFiscalNumber = FiscalNumber.IsValidFiscalNumber(_entryBoxFiscalNumber.EntryValidation.Text, _entryBoxSelectSystemCountry.Value.Code2);
                        _entryBoxFiscalNumber.EntryValidation.Validated = isValidFiscalNumber;
                    }
                    //Call Main Validate
                    Validate();
                };

                //Currency
                CriteriaOperator criteriaOperatorSystemCurrency = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");
                _entryBoxSelectSystemCurrency = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCurrency, TreeViewConfigurationCurrency>(this, Resx.global_currency, "Designation", "Oid", intialValueConfigurationCurrency, criteriaOperatorSystemCurrency, SettingsApp.RegexGuid, true);
                _entryBoxSelectSystemCurrency.EntryValidation.IsEditable = false;
                _entryBoxSelectSystemCurrency.EntryValidation.Validate(_entryBoxSelectSystemCurrency.Value.Oid.ToString());

                //Disabled, Now Country and Currency are disabled
                //_entryBoxSelectSystemCurrency.ButtonSelectValue.Sensitive = false;
                //_entryBoxSelectSystemCurrency.EntryValidation.Sensitive = false;
                _entryBoxSelectSystemCurrency.ClosePopup += delegate
                {
                    //Call Main Validate
                    Validate();
                };

                //Add to Vbox
                vbox.PackStart(_entryBoxSelectSystemCountry, true, true, 0);
                vbox.PackStart(_entryBoxSelectSystemCurrency, true, true, 0);

                //Start Render Dynamic Inputs
                CriteriaOperator criteriaOperator = CriteriaOperator.Parse("(Disabled = 0 OR Disabled is NULL) AND (FormType = 1 AND FormPageNo = 1)");
                SortProperty[]   sortProperty     = new SortProperty[2];
                sortProperty[0] = new SortProperty("Ord", SortingDirection.Ascending);
                XPCollection xpCollection = new XPCollection(GlobalFramework.SessionXpo, typeof(CFG_ConfigurationPreferenceParameter), criteriaOperator, sortProperty);
                if (xpCollection.Count > 0)
                {
                    string label    = string.Empty;
                    string regEx    = string.Empty;
                    object regExObj = null;
                    bool   required = false;

                    foreach (CFG_ConfigurationPreferenceParameter item in xpCollection)
                    {
                        label = (item.ResourceString != null && Resx.ResourceManager.GetString(item.ResourceString) != null)
                            ? Resx.ResourceManager.GetString(item.ResourceString)
                            : string.Empty;
                        regExObj = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), item.RegEx);
                        regEx    = (regExObj != null) ? regExObj.ToString() : string.Empty;
                        required = Convert.ToBoolean(item.Required);

                        //Override Db Regex
                        if (item.Token == "COMPANY_POSTALCODE")
                        {
                            regEx = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                        }
                        if (item.Token == "COMPANY_FISCALNUMBER")
                        {
                            regEx = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                        }

                        //Debug
                        //_log.Debug(string.Format("Label: [{0}], RegEx: [{1}], Required: [{2}]", label, regEx, required));

                        EntryBoxValidation entryBoxValidation = new EntryBoxValidation(
                            this,
                            label,
                            KeyboardMode.AlfaNumeric,
                            regEx,
                            required
                            )
                        {
                            Name = item.Token
                        };

                        //Only Assign Value if Debugger Attached : Now the value for normal user is cleaned in Init Database, we keep this code here, may be usefull
                        if (Debugger.IsAttached == true || useDatabaseDataDemo)
                        {
                            entryBoxValidation.EntryValidation.Text = item.Value;
                        }
                        if (Debugger.IsAttached == true)
                        {
                            if (debug)
                            {
                                _log.Debug(String.Format("[{0}:{1}]:item.Value: [{2}], entryBoxValidation.EntryValidation.Text: [{3}]", Debugger.IsAttached == true, useDatabaseDataDemo, item.Value, entryBoxValidation.EntryValidation.Text));
                            }
                        }

                        //Assign shared Event
                        entryBoxValidation.EntryValidation.Changed += EntryValidation_Changed;

                        //If is ZipCode Assign it to _entryBoxZipCode Reference
                        if (item.Token == "COMPANY_POSTALCODE")
                        {
                            _entryBoxZipCode = entryBoxValidation;
                            _entryBoxZipCode.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                        }
                        //If is FiscalNumber Assign it to entryBoxSelectCustomerFiscalNumber Reference
                        else if (item.Token == "COMPANY_FISCALNUMBER")
                        {
                            _entryBoxFiscalNumber = entryBoxValidation;
                            _entryBoxFiscalNumber.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                        }

                        if (item.Token == "COMPANY_TAX_ENTITY")
                        {
                            entryBoxValidation.EntryValidation.Text = "Global";
                        }

                        //Call Validate
                        entryBoxValidation.EntryValidation.Validate();
                        //Pack and Add to ObjectBag
                        vbox.PackStart(entryBoxValidation, true, true, 0);
                        _dictionaryObjectBag.Add(item, entryBoxValidation);
                    }
                }

                Viewport viewport = new Viewport()
                {
                    ShadowType = ShadowType.None
                };
                viewport.Add(vbox);

                _scrolledWindow            = new ScrolledWindow();
                _scrolledWindow.ShadowType = ShadowType.EtchedIn;
                _scrolledWindow.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
                _scrolledWindow.Add(viewport);

                viewport.ResizeMode        = ResizeMode.Parent;
                _scrolledWindow.ResizeMode = ResizeMode.Parent;
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }