Exemplo n.º 1
0
        private void InitUI()
        {
            try
            {
                //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));

                //PriceType
                XPOComboBox xpoComboBoxPriceType = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationPriceType), (DataSourceRow as POS_ConfigurationPlace).PriceType, "Designation");
                BOWidgetBox boxPriceType         = new BOWidgetBox(Resx.global_placetable_PriceType, xpoComboBoxPriceType);
                vboxTab1.PackStart(boxPriceType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPriceType, DataSourceRow, "PriceType", SettingsApp.RegexGuid, true));

                //MovementType
                XPOComboBox xpoComboBoxMovementType = new XPOComboBox(DataSourceRow.Session, typeof(POS_ConfigurationPlaceMovementType), (DataSourceRow as POS_ConfigurationPlace).MovementType, "Designation");
                BOWidgetBox boxMovementType         = new BOWidgetBox(Resx.global_placetable_MovementType, xpoComboBoxMovementType);
                vboxTab1.PackStart(boxMovementType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxMovementType, DataSourceRow, "MovementType", SettingsApp.RegexGuid, false));

                //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));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 2
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));

                //Language
                Entry       entryLanguage = new Entry();
                BOWidgetBox boxLanguage   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationKeyboard_Language"), entryLanguage);
                vboxTab1.PackStart(boxLanguage, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLanguage, _dataSourceRow, "Language", SettingsApp.RegexAlfaNumeric, false));

                //VirtualKeyboard
                Entry       entryVirtualKeyboard = new Entry();
                BOWidgetBox boxVirtualKeyboard   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationKeyboard_VirtualKeyboard"), entryVirtualKeyboard);
                vboxTab1.PackStart(boxVirtualKeyboard, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVirtualKeyboard, _dataSourceRow, "VirtualKeyboard", SettingsApp.RegexAlfaNumeric, false));

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 3
0
        private void InitUI()
        {
            try
            {
                //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));

                //Acronym
                Entry       entryAcronym = new Entry();
                BOWidgetBox boxAcronym   = new BOWidgetBox(Resx.global_acronym, entryAcronym);
                vboxTab1.PackStart(boxAcronym, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAcronym, _dataSourceRow, "Acronym", SettingsApp.RegexAlfaAcronym1Char, true));

                //WorkInStock
                CheckButton checkButtonWorkInStock = new CheckButton(Resx.global_work_in_stock);
                vboxTab1.PackStart(checkButtonWorkInStock, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonWorkInStock, _dataSourceRow, "WorkInStock"));

                //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));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 4
0
        private void InitUI()
        {
            try
            {
                //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));

                //VatDirectSelling
                //In POS Mode add VatDirectSelling
                if (SettingsApp.AppMode == AppOperationMode.Default)
                {
                    CheckButton checkButtonVatDirectSelling = new CheckButton(Resx.global_vat_direct_selling);
                    vboxTab1.PackStart(checkButtonVatDirectSelling, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonVatDirectSelling, _dataSourceRow, "VatDirectSelling"));
                }

                //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));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 5
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Acronym
                Entry       entryAcronym = new Entry();
                BOWidgetBox boxAcronym   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_acronym"), entryAcronym);
                vboxTab1.PackStart(boxAcronym, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAcronym, _dataSourceRow, "Acronym", SettingsApp.RegexDocumentSeriesYearAcronym, true));

                //Designation
                Entry       entryDesignation = new Entry();
                BOWidgetBox boxDesignation   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));

                //FiscalYear
                Entry       entryFiscalYear = new Entry();
                BOWidgetBox boxFiscalYear   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_year"), entryFiscalYear);
                vboxTab1.PackStart(boxFiscalYear, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFiscalYear, _dataSourceRow, "FiscalYear", SettingsApp.RegexDecimalGreaterThanZero, true));

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryFiscalYear.Sensitive = false;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 6
0
        private void InitUI()
        {
            try
            {
                //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));

                //Token
                Entry       entryToken = new Entry();
                BOWidgetBox boxToken   = new BOWidgetBox(Resx.global_ConfigurationPaymentMethod_Token, entryToken);
                vboxTab1.PackStart(boxToken, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxToken, _dataSourceRow, "Token", SettingsApp.RegexAlfaNumeric, true));

                //Acronym
                Entry       entryAcronym = new Entry();
                BOWidgetBox boxAcronym   = new BOWidgetBox(Resx.global_ConfigurationPaymentMethod_Acronym, entryAcronym);
                vboxTab1.PackStart(boxAcronym, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAcronym, _dataSourceRow, "Acronym", SettingsApp.RegexAcronym2Chars, true));

                //Symbol
                //Entry entrySymbol = new Entry();
                //BOWidgetBox boxSymbol = new BOWidgetBox(Resx.global_ConfigurationPaymentMethod_Symbol, entrySymbol);
                //vboxTab1.PackStart(boxSymbol, false, false, 0);
                //_crudWidgetList.Add(new GenericCRUDWidgetXPO(boxSymbol, _dataSourceRow, "Symbol", SettingsApp.RegexAlfaNumeric, 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
                entryOrd.Sensitive     = false;
                entryCode.Sensitive    = false;
                entryToken.Sensitive   = false;
                entryAcronym.Sensitive = false;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 7
0
        private void InitUI()
        {
            try
            {
                //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.RegexAlfaNumeric, true));

                //ButtonLabel
                Entry       entryButtonLabel = new Entry();
                BOWidgetBox boxButtonLabel   = new BOWidgetBox(Resx.global_button_name, entryButtonLabel);
                vboxTab1.PackStart(boxButtonLabel, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxButtonLabel, _dataSourceRow, "ButtonLabel", SettingsApp.RegexAlfaNumericExtended, false));

                //Family
                XPOComboBox xpoComboBoxFamily = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleFamily), (DataSourceRow as FIN_ArticleSubFamily).Family, "Designation");
                BOWidgetBox boxFamily         = new BOWidgetBox(Resx.global_families, xpoComboBoxFamily);
                vboxTab1.PackStart(boxFamily, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFamily, DataSourceRow, "Family", SettingsApp.RegexGuid, true));

                //ButtonImage
                FileChooserButton fileChooserButtonImage = new FileChooserButton(string.Empty, FileChooserAction.Open)
                {
                    HeightRequest = 23
                };
                Image fileChooserImagePreviewButtonImage = new Image()
                {
                    WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height
                };
                Frame fileChooserFrameImagePreviewButtonImage = new Frame();
                fileChooserFrameImagePreviewButtonImage.ShadowType = ShadowType.None;
                fileChooserFrameImagePreviewButtonImage.Add(fileChooserImagePreviewButtonImage);
                fileChooserButtonImage.SetFilename(((FIN_ArticleSubFamily)DataSourceRow).ButtonImage);
                fileChooserButtonImage.Filter            = Utils.GetFileFilterImages();
                fileChooserButtonImage.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewButtonImage.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewButtonImage.WidthRequest, fileChooserImagePreviewButtonImage.HeightRequest));
                BOWidgetBox boxfileChooserButtonImage = new BOWidgetBox(Resx.global_button_image, fileChooserButtonImage);
                HBox        hboxfileChooserAndimagePreviewButtonImage = new HBox(false, _boxSpacing);
                hboxfileChooserAndimagePreviewButtonImage.PackStart(boxfileChooserButtonImage, true, true, 0);
                hboxfileChooserAndimagePreviewButtonImage.PackStart(fileChooserFrameImagePreviewButtonImage, false, false, 0);
                vboxTab1.PackStart(hboxfileChooserAndimagePreviewButtonImage, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserButtonImage, _dataSourceRow, "ButtonImage", string.Empty, false));

                //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));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Tab2
                VBox vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //CommissionGroup
                XPOComboBox xpoComboBoxCommissionGroup = new XPOComboBox(DataSourceRow.Session, typeof(POS_UserCommissionGroup), (DataSourceRow as FIN_ArticleSubFamily).CommissionGroup, "Designation");
                BOWidgetBox boxCommissionGroup         = new BOWidgetBox(Resx.global_commission_group, xpoComboBoxCommissionGroup);
                vboxTab2.PackStart(boxCommissionGroup, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCommissionGroup, DataSourceRow, "CommissionGroup", SettingsApp.RegexGuid, false));

                //Printer
                XPOComboBox xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrinters), (DataSourceRow as FIN_ArticleSubFamily).Printer, "Designation");
                BOWidgetBox boxPrinter         = new BOWidgetBox(Resx.global_device_printer, xpoComboBoxPrinter);
                vboxTab2.PackStart(boxPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, false));

                //Template
                XPOComboBox xpoComboBoxTemplate = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrintersTemplates), (DataSourceRow as FIN_ArticleSubFamily).Template, "Designation");
                BOWidgetBox boxTemplate         = new BOWidgetBox(Resx.global_ConfigurationPrintersTemplates, xpoComboBoxTemplate);
                vboxTab2.PackStart(boxTemplate, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplate, DataSourceRow, "Template", SettingsApp.RegexGuid, false));

                //DiscountGroup
                XPOComboBox xpoComboBoxDiscountGroup = new XPOComboBox(DataSourceRow.Session, typeof(ERP_CustomerDiscountGroup), (DataSourceRow as FIN_ArticleSubFamily).DiscountGroup, "Designation");
                BOWidgetBox boxDiscountGroup         = new BOWidgetBox(Resx.global_discount_group, xpoComboBoxDiscountGroup);
                vboxTab2.PackStart(boxDiscountGroup, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscountGroup, DataSourceRow, "DiscountGroup", SettingsApp.RegexGuid, false));

                //VatOnTable
                XPOComboBox xpoComboBoxVatOnTable = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatRate), (DataSourceRow as FIN_ArticleSubFamily).VatOnTable, "Designation");
                BOWidgetBox boxVatOnTable         = new BOWidgetBox(Resx.global_vat_on_table, xpoComboBoxVatOnTable);
                vboxTab2.PackStart(boxVatOnTable, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatOnTable, DataSourceRow, "VatOnTable", SettingsApp.RegexGuid, false));

                //VatDirectSelling
                XPOComboBox xpoComboBoxVatDirectSelling = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatRate), (DataSourceRow as FIN_ArticleSubFamily).VatDirectSelling, "Designation");
                BOWidgetBox boxVatDirectSelling         = new BOWidgetBox(Resx.global_vat_direct_selling, xpoComboBoxVatDirectSelling);
                vboxTab2.PackStart(boxVatDirectSelling, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatDirectSelling, DataSourceRow, "VatDirectSelling", SettingsApp.RegexGuid, false));

                //Append Tab
                _notebook.AppendPage(vboxTab2, new Label(Resx.dialog_edit_articlesubfamily_tab2_label));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 8
0
 public GenericCRUDWidgetXPO(BOWidgetBox pBOWidgetBox, XPGuidObject pDataSourceRow, String pFieldName, String pValidationRule = "", bool pRequired = false)
     : base(pBOWidgetBox.WidgetComponent, pBOWidgetBox.LabelComponent, pDataSourceRow, pFieldName, pValidationRule, pRequired)
 {
     InitObject(pBOWidgetBox.WidgetComponent, pBOWidgetBox.LabelComponent, pDataSourceRow, pFieldName, pValidationRule, pRequired);
 }
Exemplo n.º 9
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumeric, true));

                //ButtonLabel
                Entry       entryButtonLabel = new Entry();
                BOWidgetBox boxButtonLabel   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_button_name"), entryButtonLabel);
                vboxTab1.PackStart(boxButtonLabel, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxButtonLabel, _dataSourceRow, "ButtonLabel", SettingsApp.RegexAlfaNumericExtended, false));

                //ButtonImage
                FileChooserButton fileChooserButtonImage = new FileChooserButton(string.Empty, FileChooserAction.Open)
                {
                    HeightRequest = 23
                };
                Image fileChooserImagePreviewButtonImage = new Image()
                {
                    WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height
                };
                Frame fileChooserFrameImagePreviewButtonImage = new Frame();
                fileChooserFrameImagePreviewButtonImage.ShadowType = ShadowType.None;
                fileChooserFrameImagePreviewButtonImage.Add(fileChooserImagePreviewButtonImage);
                fileChooserButtonImage.SetFilename(((fin_articlefamily)DataSourceRow).ButtonImage);
                fileChooserButtonImage.Filter            = Utils.GetFileFilterImages();
                fileChooserButtonImage.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewButtonImage.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewButtonImage.WidthRequest, fileChooserImagePreviewButtonImage.HeightRequest));
                BOWidgetBox boxfileChooserButtonImage = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_button_image"), fileChooserButtonImage);
                HBox        hboxfileChooserAndimagePreviewButtonImage = new HBox(false, _boxSpacing);
                hboxfileChooserAndimagePreviewButtonImage.PackStart(boxfileChooserButtonImage, true, true, 0);
                hboxfileChooserAndimagePreviewButtonImage.PackStart(fileChooserFrameImagePreviewButtonImage, false, false, 0);
                vboxTab1.PackStart(hboxfileChooserAndimagePreviewButtonImage, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserButtonImage, _dataSourceRow, "ButtonImage", string.Empty, false));

                //CommissionGroup
                XPOComboBox xpoComboBoxCommissionGroup = new XPOComboBox(DataSourceRow.Session, typeof(pos_usercommissiongroup), (DataSourceRow as fin_articlefamily).CommissionGroup, "Designation", null);
                BOWidgetBox boxCommissionGroup         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_commission_group"), xpoComboBoxCommissionGroup);
                vboxTab1.PackStart(boxCommissionGroup, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCommissionGroup, DataSourceRow, "CommissionGroup", SettingsApp.RegexGuid, false));

                //Printer
                XPOComboBox xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinters), (DataSourceRow as fin_articlefamily).Printer, "Designation", null);
                BOWidgetBox boxPrinter         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_device_printer"), xpoComboBoxPrinter);
                vboxTab1.PackStart(boxPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, false));

                //Template
                XPOComboBox xpoComboBoxTemplate = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinterstemplates), (DataSourceRow as fin_articlefamily).Template, "Designation", null);
                BOWidgetBox boxTemplate         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationPrintersTemplates"), xpoComboBoxTemplate);
                vboxTab1.PackStart(boxTemplate, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplate, DataSourceRow, "Template", SettingsApp.RegexGuid, false));

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 10
0
        private void InitUI()
        {
            try
            {
                //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));

                //Acronym
                Entry       entryAcronym = new Entry();
                BOWidgetBox boxAcronym   = new BOWidgetBox(Resx.global_acronym, entryAcronym);
                vboxTab1.PackStart(boxAcronym, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAcronym, _dataSourceRow, "Acronym", SettingsApp.RegexAcronym3Chars, true));

                //StandardApplicable
                Entry       entryStandardApplicable = new Entry();
                BOWidgetBox boxStandardApplicable   = new BOWidgetBox(Resx.global_description, entryStandardApplicable);
                vboxTab1.PackStart(boxStandardApplicable, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxStandardApplicable, _dataSourceRow, "StandardApplicable", 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/Enable Components
                bool enableEdit = (_dataSourceRow.Oid != SettingsApp.XpoOidConfigurationVatExemptionReasonM99);
                entryOrd.Sensitive                = enableEdit;
                entryCode.Sensitive               = enableEdit;
                entryDesignation.Sensitive        = enableEdit;
                entryAcronym.Sensitive            = enableEdit;
                entryStandardApplicable.Sensitive = enableEdit;
                checkButtonDisabled.Sensitive     = enableEdit;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                // HBox For Vid and Pid
                HBox hbox1 = new HBox(true, _boxSpacing);
                // HBox For Vid and Pid
                HBox hbox2 = new HBox(true, _boxSpacing);

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));

                //VID
                Entry       entryVID = new Entry();
                BOWidgetBox boxVID   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_vid"), entryVID);
                hbox1.PackStart(boxVID, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVID, _dataSourceRow, "VID", SettingsApp.RegexHardwareVidAndPid, true));

                //PID
                Entry       entryPID = new Entry();
                BOWidgetBox boxPID   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_pid"), entryPID);
                hbox1.PackStart(boxPID, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPID, _dataSourceRow, "PID", SettingsApp.RegexHardwareVidAndPid, true));

                //EndPoint
                Entry       entryEndPoint = new Entry();
                BOWidgetBox boxEndPoint   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_endpoint"), entryEndPoint);
                hbox1.PackStart(boxEndPoint, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxEndPoint, _dataSourceRow, "EndPoint", SettingsApp.RegexHardwareEndpoint, true));

                //COM
                Entry       entryCOM = new Entry();
                BOWidgetBox boxCOM   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_com_port"), entryCOM);
                hbox1.PackStart(boxCOM, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCOM, _dataSourceRow, "COM", SettingsApp.RegexHardwarePortName, true));

                // Pack hboxVIDAndPid
                vboxTab1.PackStart(hbox1, false, false, 0);

                //CodeTable
                Entry       entryCodeTable = new Entry();
                BOWidgetBox boxCodeTable   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_codetable"), entryCodeTable);
                hbox2.PackStart(boxCodeTable, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCodeTable, _dataSourceRow, "CodeTable", SettingsApp.RegexHardwareCodeTable, true));

                //DisplayCharactersPerLine
                Entry       entryDisplayCharactersPerLine = new Entry();
                BOWidgetBox boxDisplayCharactersPerLine   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_number_of_characters_per_line"), entryDisplayCharactersPerLine);
                hbox2.PackStart(boxDisplayCharactersPerLine, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDisplayCharactersPerLine, _dataSourceRow, "DisplayCharactersPerLine", SettingsApp.RegexInteger, true));


                //GoToStandByInSeconds
                Entry       entryGoToStandByInSeconds = new Entry();
                BOWidgetBox boxGoToStandByInSeconds   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_goto_stand_by_in_seconds"), entryGoToStandByInSeconds);
                hbox2.PackStart(boxGoToStandByInSeconds, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxGoToStandByInSeconds, _dataSourceRow, "GoToStandByInSeconds", SettingsApp.RegexInteger, true));

                // Pack hboxEndpointAndCodeTableAndGoToStandByInSeconds
                vboxTab1.PackStart(hbox2, false, false, 0);

                //StandByLine1
                Entry       entryStandByLine1 = new Entry();
                BOWidgetBox boxStandByLine1   = new BOWidgetBox(string.Format(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_stand_by_line_no"), 1), entryStandByLine1);
                vboxTab1.PackStart(boxStandByLine1, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxStandByLine1, _dataSourceRow, "StandByLine1", SettingsApp.RegexAlfaNumericExtended, false));

                //StandByLine2
                Entry       entryStandByLine2 = new Entry();
                BOWidgetBox boxStandByLine2   = new BOWidgetBox(string.Format(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_pole_display_stand_by_line_no"), 2), entryStandByLine2);
                vboxTab1.PackStart(boxStandByLine2, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxStandByLine2, _dataSourceRow, "StandByLine2", SettingsApp.RegexAlfaNumericExtended, false));

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
        private void InitUI()
        {
            try
            {
                //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));

                //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"));

                //Printer
                Entry       entryPrinter = new Entry();
                BOWidgetBox boxPrinter   = new BOWidgetBox(Resx.global_ConfigurationCashRegister_Printer, entryPrinter);
                vboxTab1.PackStart(boxPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, _dataSourceRow, "Printer", SettingsApp.RegexAlfaNumeric, false));

                //Drawer
                Entry       entryDrawer = new Entry();
                BOWidgetBox boxDrawer   = new BOWidgetBox(Resx.global_ConfigurationCashRegister_Drawer, entryDrawer);
                vboxTab1.PackStart(boxDrawer, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDrawer, _dataSourceRow, "Drawer", SettingsApp.RegexAlfaNumeric, false));

                //AutomaticDrawer
                Entry       entryAutomaticDrawer = new Entry();
                BOWidgetBox boxAutomaticDrawer   = new BOWidgetBox(Resx.global_ConfigurationCashRegister_AutomaticDrawer, entryAutomaticDrawer);
                vboxTab1.PackStart(boxAutomaticDrawer, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAutomaticDrawer, _dataSourceRow, "AutomaticDrawer", SettingsApp.RegexAlfaNumeric, false));

                //ActiveSales
                Entry       entryActiveSales = new Entry();
                BOWidgetBox boxActiveSales   = new BOWidgetBox(Resx.global_ConfigurationCashRegister_ActiveSales, entryActiveSales);
                vboxTab1.PackStart(boxActiveSales, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxActiveSales, _dataSourceRow, "ActiveSales", SettingsApp.RegexAlfaNumeric, false));

                //AllowChargeBacks
                Entry       entryAllowChargeBacks = new Entry();
                BOWidgetBox boxAllowChargeBacks   = new BOWidgetBox(Resx.global_ConfigurationCashRegister_AllowChargeBacks, entryAllowChargeBacks);
                vboxTab1.PackStart(boxAllowChargeBacks, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAllowChargeBacks, _dataSourceRow, "AllowChargeBacks", SettingsApp.RegexAlfaNumeric, false));

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
        private void InitUI()
        {
            try
            {
                //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));

                //Description
                Entry       entryDescription = new Entry();
                BOWidgetBox boxDescription   = new BOWidgetBox(Resx.global_description, entryDescription);
                vboxTab1.PackStart(boxDescription, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDescription, _dataSourceRow, "Description", SettingsApp.RegexAlfaNumericExtended, false));

                //Year
                Entry       entryYear = new Entry();
                BOWidgetBox boxYear   = new BOWidgetBox(Resx.global_year, entryYear);
                vboxTab1.PackStart(boxYear, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxYear, _dataSourceRow, "Year", SettingsApp.RegexDateYearHolidays, true));

                //Month
                Entry       entryMonth = new Entry();
                BOWidgetBox boxMonth   = new BOWidgetBox(Resx.global_month, entryMonth);
                vboxTab1.PackStart(boxMonth, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxMonth, _dataSourceRow, "Month", SettingsApp.RegexDateMonth, true));

                //Day
                Entry       entryDay = new Entry();
                BOWidgetBox boxDay   = new BOWidgetBox(Resx.global_day, entryDay);
                vboxTab1.PackStart(boxDay, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDay, _dataSourceRow, "Day", SettingsApp.RegexDateDay, 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));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 14
0
        private void InitUI()
        {
            try
            {
                //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));

                //Acronym
                Entry       entryAcronym = new Entry();
                BOWidgetBox boxAcronym   = new BOWidgetBox(Resx.global_acronym, entryAcronym);
                vboxTab1.PackStart(boxAcronym, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAcronym, _dataSourceRow, "Acronym", SettingsApp.RegexAlfa, true));

                //PrintCopies
                Entry       entryPrintCopies = new Entry();
                BOWidgetBox boxPrintCopies   = new BOWidgetBox(Resx.global_print_copies, entryPrintCopies);
                vboxTab1.PackStart(boxPrintCopies, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrintCopies, _dataSourceRow, "PrintCopies", SettingsApp.RegexPrintCopies, true));

                //Printer
                XPOComboBox xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrinters), (DataSourceRow as FIN_DocumentFinanceType).Printer, "Designation");
                BOWidgetBox boxPrinter         = new BOWidgetBox(Resx.global_device_printer, xpoComboBoxPrinter);
                vboxTab1.PackStart(boxPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, false));

                //Template
                XPOComboBox xpoComboBoxTemplate = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrintersTemplates), (DataSourceRow as FIN_DocumentFinanceType).Template, "Designation");
                BOWidgetBox boxTemplate         = new BOWidgetBox(Resx.global_configurationprintersTemplate, xpoComboBoxTemplate);
                vboxTab1.PackStart(boxTemplate, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplate, DataSourceRow, "Template", SettingsApp.RegexGuid, false));

                //PrintRequestConfirmation
                CheckButton checkButtonPrintRequestConfirmation = new CheckButton(Resx.global_print_request_confirmation);
                vboxTab1.PackStart(checkButtonPrintRequestConfirmation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonPrintRequestConfirmation, _dataSourceRow, "PrintRequestConfirmation"));

                //PrintOpenDrawer
                CheckButton checkButtonPrintOpenDrawer = new CheckButton(Resx.global_open_drawer);
                vboxTab1.PackStart(checkButtonPrintOpenDrawer, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonPrintOpenDrawer, _dataSourceRow, "PrintOpenDrawer"));

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryDesignation.Sensitive    = (_dialogMode == DialogMode.Insert);
                entryAcronym.Sensitive        = (_dialogMode == DialogMode.Insert);
                xpoComboBoxTemplate.Sensitive = (_dialogMode == DialogMode.Insert);
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
        private void InitUI()
        {
            try
            {
                //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));

                //Capital
                Entry       entryCapital = new Entry();
                BOWidgetBox boxCapital   = new BOWidgetBox(Resx.global_country_capital, entryCapital);
                vboxTab1.PackStart(boxCapital, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCapital, _dataSourceRow, "Capital", SettingsApp.RegexAlfaNumericExtended, false));

                //Currency
                Entry       entryCurrency = new Entry();
                BOWidgetBox boxCurrency   = new BOWidgetBox(Resx.global_currency, entryCurrency);
                vboxTab1.PackStart(boxCurrency, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCurrency, _dataSourceRow, "Currency", SettingsApp.RegexAlfa, false));

                //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));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Tab2
                VBox vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Code2
                Entry       entryCode2 = new Entry();
                BOWidgetBox boxCode2   = new BOWidgetBox(Resx.global_country_code2, entryCode2);
                vboxTab2.PackStart(boxCode2, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode2, _dataSourceRow, "Code2", SettingsApp.RegexAlfaCountryCode2, true));

                //Code3
                Entry       entryCode3 = new Entry();
                BOWidgetBox boxCode3   = new BOWidgetBox(Resx.global_country_code3, entryCode3);
                vboxTab2.PackStart(boxCode3, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode3, _dataSourceRow, "Code3", SettingsApp.RegexAlfaCountryCode3, true));

                //CurrencyCode
                Entry       entryCurrencyCode = new Entry();
                BOWidgetBox boxCurrencyCode   = new BOWidgetBox(Resx.global_currency_code, entryCurrencyCode);
                vboxTab2.PackStart(boxCurrencyCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCurrencyCode, _dataSourceRow, "CurrencyCode", SettingsApp.RegexAcronym3Chars, false));

                //RegExFiscalNumber
                Entry entryRegExFiscalNumber = new Entry()
                {
                    Sensitive = false
                };
                BOWidgetBox boxRegExFiscalNumber = new BOWidgetBox(Resx.global_regex_fiscal_number, entryRegExFiscalNumber);
                vboxTab2.PackStart(boxRegExFiscalNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxRegExFiscalNumber, _dataSourceRow, "RegExFiscalNumber"));

                //RegExZipCode
                Entry entryRegExZipCode = new Entry()
                {
                    Sensitive = false
                };
                BOWidgetBox boxRegExZipCode = new BOWidgetBox(Resx.global_regex_postal_code, entryRegExZipCode);
                vboxTab2.PackStart(boxRegExZipCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxRegExZipCode, _dataSourceRow, "RegExZipCode"));

                //Append Tab
                _notebook.AppendPage(vboxTab2, new Label(Resx.global_others));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 16
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //FiscalYear
                XPOComboBox xpoComboBoxFiscalYear = new XPOComboBox(DataSourceRow.Session, typeof(FIN_DocumentFinanceYears), (DataSourceRow as FIN_DocumentFinanceYearSerieTerminal).FiscalYear, "Designation");
                BOWidgetBox boxFiscalYear         = new BOWidgetBox(Resx.global_fiscal_year, xpoComboBoxFiscalYear);
                vboxTab1.PackStart(boxFiscalYear, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFiscalYear, DataSourceRow, "FiscalYear", SettingsApp.RegexGuid, true));

                //DocumentType
                XPOComboBox xpoComboBoxDocumentType = new XPOComboBox(DataSourceRow.Session, typeof(FIN_DocumentFinanceType), (DataSourceRow as FIN_DocumentFinanceYearSerieTerminal).DocumentType, "Designation");
                BOWidgetBox boxDocumentType         = new BOWidgetBox(Resx.global_documentfinance_type, xpoComboBoxDocumentType);
                vboxTab1.PackStart(boxDocumentType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDocumentType, DataSourceRow, "DocumentType", SettingsApp.RegexGuid, true));

                //Serie
                XPOComboBox xpoComboBoxSerie = new XPOComboBox(DataSourceRow.Session, typeof(FIN_DocumentFinanceSeries), (DataSourceRow as FIN_DocumentFinanceYearSerieTerminal).Serie, "Designation");
                BOWidgetBox boxSerie         = new BOWidgetBox(Resx.global_documentfinance_series, xpoComboBoxSerie);
                vboxTab1.PackStart(boxSerie, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxSerie, DataSourceRow, "Serie", SettingsApp.RegexGuid, true));

                //Terminal
                XPOComboBox xpoComboBoxTerminal = new XPOComboBox(DataSourceRow.Session, typeof(POS_ConfigurationPlaceTerminal), (DataSourceRow as FIN_DocumentFinanceYearSerieTerminal).Terminal, "Designation");
                BOWidgetBox boxTerminal         = new BOWidgetBox(Resx.global_configurationplaceterminal, xpoComboBoxTerminal);
                vboxTab1.PackStart(boxTerminal, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTerminal, DataSourceRow, "Terminal", SettingsApp.RegexGuid, 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));

                //Printer
                XPOComboBox xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrinters), (DataSourceRow as FIN_DocumentFinanceYearSerieTerminal).Printer, "Designation");
                BOWidgetBox boxPrinter         = new BOWidgetBox(Resx.global_configurationprinter, xpoComboBoxPrinter);
                vboxTab1.PackStart(boxPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, true));

                //Template
                XPOComboBox xpoComboBoxTemplate = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrintersTemplates), (DataSourceRow as FIN_DocumentFinanceYearSerieTerminal).Template, "Designation", "FinancialTemplate = 1");
                BOWidgetBox boxTemplate         = new BOWidgetBox(Resx.global_configurationprintersTemplate, xpoComboBoxTemplate);
                vboxTab1.PackStart(boxTemplate, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplate, DataSourceRow, "Template", SettingsApp.RegexGuid, true));

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                xpoComboBoxFiscalYear.Sensitive   = false;
                xpoComboBoxDocumentType.Sensitive = false;
                xpoComboBoxSerie.Sensitive        = false;
                xpoComboBoxTerminal.Sensitive     = false;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 17
0
        private void InitUI()
        {
            try
            {
                //Init Local Vars
                _configurationCountry = (_dataSourceRow as ERP_Customer).Country;

                if (_dialogMode != DialogMode.Insert)
                {
                    _customer = (_dataSourceRow as ERP_Customer);
                    string sql       = string.Format("SELECT COUNT(*) as Count FROM fin_documentfinancemaster WHERE EntityFiscalNumber = '{0}';", _customer.FiscalNumber);
                    var    sqlResult = GlobalFramework.SessionXpo.ExecuteScalar(sql);
                    _totalNumberOfFinanceDocuments = Convert.ToUInt16(sqlResult);
                    if (_customer.Oid == SettingsApp.XpoOidDocumentFinanceMasterFinalConsumerEntity)
                    {
                        _isFinalConsumerEntity = true;
                    }
                }

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                //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));

                //Name
                Entry       entryName = new Entry();
                BOWidgetBox boxName   = new BOWidgetBox(Resx.global_name, entryName);
                vboxTab1.PackStart(boxName, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxName, _dataSourceRow, "Name", SettingsApp.RegexAlfaNumericExtended, true));

                //FiscalNumber
                _entryFiscalNumber = new Entry();
                BOWidgetBox boxFiscalNumber = new BOWidgetBox(Resx.global_fiscal_number, _entryFiscalNumber);
                vboxTab1.PackStart(boxFiscalNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFiscalNumber, _dataSourceRow, "FiscalNumber", _configurationCountry.RegExFiscalNumber, false));

                //Discount
                Entry       entryDiscount = new Entry();
                BOWidgetBox boxDiscount   = new BOWidgetBox(Resx.global_discount, entryDiscount);
                vboxTab1.PackStart(boxDiscount, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscount, _dataSourceRow, "Discount", SettingsApp.RegexPercentage, true));

                //PriceType
                XPOComboBox xpoComboBoxPriceType = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationPriceType), (DataSourceRow as ERP_Customer).PriceType, "Designation");
                BOWidgetBox boxPriceType         = new BOWidgetBox(Resx.global_price_type, xpoComboBoxPriceType);
                vboxTab1.PackStart(boxPriceType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPriceType, DataSourceRow, "PriceType", SettingsApp.RegexGuid, true));

                //CustomerType
                XPOComboBox xpoComboBoxCustomerType = new XPOComboBox(DataSourceRow.Session, typeof(ERP_CustomerType), (DataSourceRow as ERP_Customer).CustomerType, "Designation");
                BOWidgetBox boxCustomerType         = new BOWidgetBox(Resx.global_customer_types, xpoComboBoxCustomerType);
                vboxTab1.PackStart(boxCustomerType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCustomerType, DataSourceRow, "CustomerType", SettingsApp.RegexGuid, true));

                ////DISABLED : DiscountGroup
                //XPOComboBox xpoComboBoxDiscountGroup = new XPOComboBox(DataSourceRow.Session, typeof(ERP_CustomerDiscountGroup), (DataSourceRow as ERP_Customer).DiscountGroup, "Designation");
                //BOWidgetBox boxDiscountGroup = new BOWidgetBox(Resx.global_discount_group, xpoComboBoxDiscountGroup);
                //vboxTab1.PackStart(boxDiscountGroup, false, false, 0);
                //_crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscountGroup, DataSourceRow, "DiscountGroup", SettingsApp.RegexGuid, true));

                //Supplier
                CheckButton checkButtonSupplier = new CheckButton(Resx.global_supplier);
                vboxTab1.PackStart(checkButtonSupplier, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonSupplier, _dataSourceRow, "Supplier"));

                //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));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                //Tab2

                VBox vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Address
                Entry       entryAddress = new Entry();
                BOWidgetBox boxAddress   = new BOWidgetBox(Resx.global_address, entryAddress);
                vboxTab2.PackStart(boxAddress, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAddress, _dataSourceRow, "Address", SettingsApp.RegexAlfaNumericExtended, false));

                //Locality
                Entry       entryLocality = new Entry();
                BOWidgetBox boxLocality   = new BOWidgetBox(Resx.global_locality, entryLocality);
                vboxTab2.PackStart(boxLocality, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLocality, _dataSourceRow, "Locality", SettingsApp.RegexAlfaNumericExtended, false));

                //ZipCode
                _entryZipCode = new Entry()
                {
                    WidthRequest = 100
                };;
                BOWidgetBox boxZipCode = new BOWidgetBox(Resx.global_zipcode, _entryZipCode);
                vboxTab2.PackStart(boxZipCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxZipCode, _dataSourceRow, "ZipCode", _configurationCountry.RegExZipCode, false));

                //City
                Entry       entryCity = new Entry();
                BOWidgetBox boxCity   = new BOWidgetBox(Resx.global_city, entryCity);
                vboxTab2.PackStart(boxCity, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCity, _dataSourceRow, "City", SettingsApp.RegexAlfaNumericExtended, false));

                //Hbox ZipCode and City
                HBox hboxZipCodeAndCity = new HBox(false, _boxSpacing);
                hboxZipCodeAndCity.PackStart(boxZipCode, true, true, 0);
                hboxZipCodeAndCity.PackStart(boxCity, true, true, 0);
                vboxTab2.PackStart(hboxZipCodeAndCity, false, false, 0);

                //CountrySortProperty
                SortProperty[] sortPropertyCountry = new SortProperty[1];
                sortPropertyCountry[0] = new SortProperty("Designation", SortingDirection.Ascending);
                //Country
                _xpoComboBoxCountry = new XPOComboBox(DataSourceRow.Session, typeof(CFG_ConfigurationCountry), (DataSourceRow as ERP_Customer).Country, "Designation", null, sortPropertyCountry);
                BOWidgetBox boxCountry = new BOWidgetBox(Resx.global_country, _xpoComboBoxCountry);
                vboxTab2.PackStart(boxCountry, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCountry, DataSourceRow, "Country", SettingsApp.RegexGuid, true));

                //Phone
                Entry       entryPhone = new Entry();
                BOWidgetBox boxPhone   = new BOWidgetBox(Resx.global_phone, entryPhone);
                vboxTab2.PackStart(boxPhone, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPhone, _dataSourceRow, "Phone", SettingsApp.RegexAlfaNumericExtended, false));

                //MobilePhone
                Entry       entryMobilePhone = new Entry();
                BOWidgetBox boxMobilePhone   = new BOWidgetBox(Resx.global_mobile_phone, entryMobilePhone);
                vboxTab2.PackStart(boxMobilePhone, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxMobilePhone, _dataSourceRow, "MobilePhone", SettingsApp.RegexAlfaNumericExtended, false));

                //Hbox Phone and MobilePhone
                HBox hboxPhoneAndMobilePhone = new HBox(false, _boxSpacing);
                hboxPhoneAndMobilePhone.PackStart(boxPhone, true, true, 0);
                hboxPhoneAndMobilePhone.PackStart(boxMobilePhone, true, true, 0);
                vboxTab2.PackStart(hboxPhoneAndMobilePhone, false, false, 0);

                //Fax
                Entry       entryFax = new Entry();
                BOWidgetBox boxFax   = new BOWidgetBox(Resx.global_fax, entryFax);
                vboxTab2.PackStart(boxFax, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFax, _dataSourceRow, "Fax", SettingsApp.RegexAlfaNumericExtended, false));

                //Email
                Entry       entryEmail = new Entry();
                BOWidgetBox boxEmail   = new BOWidgetBox(Resx.global_email, entryEmail);
                vboxTab2.PackStart(boxEmail, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxEmail, _dataSourceRow, "Email", SettingsApp.RegexEmail, false));

                //Hbox Fax and Email
                HBox hboxFaxAndEmail = new HBox(false, _boxSpacing);
                hboxFaxAndEmail.PackStart(boxFax, true, true, 0);
                hboxFaxAndEmail.PackStart(boxEmail, true, true, 0);
                vboxTab2.PackStart(hboxFaxAndEmail, false, false, 0);

                //Append Tab
                _notebook.AppendPage(vboxTab2, new Label(Resx.global_contacts));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                //Tab3

                VBox vboxTab3 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //CardNumber
                Entry       entryCardNumber = new Entry();
                BOWidgetBox boxCardNumber   = new BOWidgetBox(Resx.global_card_number, entryCardNumber);
                vboxTab3.PackStart(boxCardNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCardNumber, _dataSourceRow, "CardNumber", SettingsApp.RegexAlfaNumericExtended, false));

                //CardCredit
                Entry       entryCardCredit = new Entry();
                BOWidgetBox boxCardCredit   = new BOWidgetBox(Resx.global_card_credit_amount, entryCardCredit);
                vboxTab3.PackStart(boxCardCredit, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCardCredit, _dataSourceRow, "CardCredit", SettingsApp.RegexDecimalGreaterEqualThanZero, false));

                //DateOfBirth
                Entry       entryDateOfBirth = new Entry();
                BOWidgetBox boxDateOfBirth   = new BOWidgetBox(Resx.global_dob, entryDateOfBirth);
                vboxTab3.PackStart(boxDateOfBirth, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDateOfBirth, _dataSourceRow, "DateOfBirth", SettingsApp.RegexDate, false));

                //Append Tab
                _notebook.AppendPage(vboxTab3, new Label(Resx.global_others));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryName.Sensitive           = GetEntryNameSensitiveValue();
                entryCardCredit.Sensitive     = false;
                _entryFiscalNumber.Sensitive  = GetEntryFiscalNumberSensitiveValue();
                _xpoComboBoxCountry.Sensitive = GetEntryFiscalNumberSensitiveValue();

                //Get References to GenericCRUDWidgetXPO
                _genericCRUDWidgetXPOFiscalNumber = (_crudWidgetList.GetFieldWidget("FiscalNumber") as GenericCRUDWidgetXPO);
                _genericCRUDWidgetXPOZipCode      = (_crudWidgetList.GetFieldWidget("ZipCode") as GenericCRUDWidgetXPO);
                //Call Validation
                _genericCRUDWidgetXPOFiscalNumber.ValidateField(ValidateFiscalNumberFunc);

                //Update Components
                UpdateCountryRegExComponents();

                //Events
                _entryFiscalNumber.Changed  += delegate { ValidateFiscalNumber(); };
                _xpoComboBoxCountry.Changed += delegate { UpdateCountryRegExComponents(); };
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 18
0
        private void InitUI()
        {
            BOWidgetBox boxValue      = null;
            BOWidgetBox ComboboxValue = null;

            try
            {
                cfg_configurationpreferenceparameter dataSourceRow = (cfg_configurationpreferenceparameter)_dataSourceRow;

                //Define Label for Value
                string valueLabel = (resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], dataSourceRow.ResourceString) != null)
                    ? resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], dataSourceRow.ResourceString)
                    : "LABEL NOT DEFINED IN Field  [ResourceString]";

                //Define RegEx for Value
                string valueRegEx = "REGULAR EXPRESSION NOT DEFINED IN Field [RegEx]";
                if (dataSourceRow.RegEx != null)
                {
                    //Try to get Value
                    object objectValueRegEx = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), dataSourceRow.RegEx);
                    if (objectValueRegEx != null)
                    {
                        valueRegEx = objectValueRegEx.ToString();
                    }
                }

                //Define Label for Value
                bool valueRequired = (dataSourceRow.Required)
                    ? dataSourceRow.Required
                    : false;

                //Override Db Regex with ConfigurationSystemCountry RegExZipCode and RegExFiscalNumber
                if (dataSourceRow.Token == "COMPANY_POSTALCODE")
                {
                    valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExZipCode;
                }
                if (dataSourceRow.Token == "COMPANY_FISCALNUMBER")
                {
                    valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExFiscalNumber;
                }

                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), entryCode);
                vboxTab1.PackStart(boxCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true));

                //Token
                Entry       entryToken = new Entry();
                BOWidgetBox boxToken   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_token"), entryToken);
                vboxTab1.PackStart(boxToken, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxToken, _dataSourceRow, "Token", SettingsApp.RegexAlfaNumericExtended, true));

                //Get InputType
                PreferenceParameterInputType inputType = (PreferenceParameterInputType)Enum.Parse(typeof(PreferenceParameterInputType), dataSourceRow.InputType.ToString(), true);

                Entry entryValue = new Entry();

                switch (inputType)
                {
                case PreferenceParameterInputType.Text:
                case PreferenceParameterInputType.TextPassword:
                    boxValue = new BOWidgetBox(valueLabel, entryValue);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    // Turn entry into a TextPassword, curently we not use it, until we can turn Visibility = false into TreeView Cell
                    if (inputType.Equals(PreferenceParameterInputType.TextPassword))
                    {
                        entryValue.Visibility = false;
                    }

                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired));
                    // ValueTip
                    if (!string.IsNullOrEmpty(dataSourceRow.ValueTip))
                    {
                        entryValue.TooltipText = string.Format(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_prefparam_value_tip_format"), dataSourceRow.ValueTip);
                    }
                    break;

                case PreferenceParameterInputType.Multiline:
                    EntryMultiline entryMultiline = new EntryMultiline();
                    entryMultiline.Value.Text = dataSourceRow.Value;
                    entryMultiline.ScrolledWindow.BorderWidth = 1;
                    entryMultiline.HeightRequest = 122;
                    Label labelMultiline = new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes"));
                    boxValue = new BOWidgetBox(valueLabel, entryMultiline);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired));
                    // Override Default Window Height
                    _windowHeight = _windowHeightForTextComponent + 100;
                    break;

                case PreferenceParameterInputType.CheckButton:
                    CheckButton checkButtonValue = new CheckButton(valueLabel);
                    vboxTab1.PackStart(checkButtonValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonValue, _dataSourceRow, "Value"));
                    // Override Default Window Height
                    _windowHeight = _windowHeightForTextComponent - 20;
                    break;

                //Mudar a lingua da Aplicação - Não é genérico
                //IN009296 BackOffice - Mudar a língua da aplicação
                case PreferenceParameterInputType.ComboBox:
                    string getCultureFromDB;
                    try
                    {
                        string sql = "SELECT value FROM cfg_configurationpreferenceparameter where token = 'CULTURE';";
                        getCultureFromDB = GlobalFramework.SessionXpo.ExecuteScalar(sql).ToString();
                    }
                    catch
                    {
                        getCultureFromDB = GlobalFramework.Settings["customCultureResourceDefinition"];
                    }

                    string[] getCulturesValues = new string[8];
                    getCulturesValues[0] = "pt-PT";
                    getCulturesValues[1] = "pt-AO";
                    getCulturesValues[2] = "pt-BR";
                    getCulturesValues[3] = "pt-MZ";
                    getCulturesValues[4] = "en-GB";
                    getCulturesValues[5] = "en-US";
                    getCulturesValues[6] = "fr-FR";
                    getCulturesValues[7] = "es-ES";

                    string[] getCulturesLabels = new string[8];
                    getCulturesLabels[0] = "Português(Portugal)";
                    getCulturesLabels[1] = "Português(Angola)";
                    getCulturesLabels[2] = "Português(Brasil)";
                    getCulturesLabels[3] = "Português(Moçambique)";
                    getCulturesLabels[4] = "English(GB)";
                    getCulturesLabels[5] = "English(USA)";
                    getCulturesLabels[6] = "Françes";
                    getCulturesLabels[7] = "Espanol";

                    TreeIter  iter;
                    TreeStore store = new TreeStore(typeof(string), typeof(string));
                    for (int i = 0; i < getCulturesLabels.Length; i++)
                    {
                        iter = store.AppendValues(getCulturesValues.GetValue(i), getCulturesLabels.GetValue(i));
                    }

                    ComboBox xpoComboBoxInputType = new ComboBox(getCulturesLabels);

                    xpoComboBoxInputType.Model.GetIterFirst(out iter);
                    int cbox = 0;
                    do
                    {
                        GLib.Value thisRow = new GLib.Value();
                        xpoComboBoxInputType.Model.GetValue(iter, 0, ref thisRow);
                        //if ((thisRow.Val as string).Equals(getCultureFromDB))
                        if (getCulturesValues[cbox] == getCultureFromDB)
                        {
                            xpoComboBoxInputType.SetActiveIter(iter);
                            break;
                        }
                        cbox++;
                    } while (xpoComboBoxInputType.Model.IterNext(ref iter));

                    ComboboxValue = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_language"), xpoComboBoxInputType);
                    vboxTab1.PackStart(ComboboxValue, false, false, 0);

                    entryValue.Text       = getCulturesValues[xpoComboBoxInputType.Active];
                    entryValue.Visibility = false;

                    xpoComboBoxInputType.Changed += delegate
                    {
                        entryValue.Text = getCulturesValues[xpoComboBoxInputType.Active];
                        //GlobalFramework.CurrentCulture = new System.Globalization.CultureInfo(getCulturesValues[xpoComboBoxInputType.Active]);
                        //GlobalFramework.Settings["customCultureResourceDefinition"] = getCulturesValues[xpoComboBoxInputType.Active];
                        //CustomResources.UpdateLanguage(getCulturesValues[xpoComboBoxInputType.Active]);
                        //_crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false));
                    };
                    boxValue = new BOWidgetBox(valueLabel, entryValue);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false));
                    break;

                case PreferenceParameterInputType.FilePicker:
                case PreferenceParameterInputType.DirPicker:
                    //FilePicker
                    FileChooserAction fileChooserAction = (inputType.Equals(PreferenceParameterInputType.FilePicker)) ? FileChooserAction.Open : FileChooserAction.SelectFolder;
                    FileChooserButton fileChooser       = new FileChooserButton(string.Empty, fileChooserAction)
                    {
                        HeightRequest = 23
                    };
                    if (inputType.Equals(PreferenceParameterInputType.FilePicker))
                    {
                        fileChooser.SetFilename(dataSourceRow.Value);
                        fileChooser.Filter = Utils.GetFileFilterImages();
                    }
                    else
                    {
                        fileChooser.SetCurrentFolder(dataSourceRow.Value);
                    }
                    boxValue = new BOWidgetBox(valueLabel, fileChooser);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false));
                    break;

                default:
                    break;
                }

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryToken.Sensitive = false;

                //Protect PreferenceParameterInputType : Disable if is COMPANY_FISCALNUMBER or Other Sensitive Data
                cfg_configurationpreferenceparameter parameter = (_dataSourceRow as cfg_configurationpreferenceparameter);
                if (entryValue != null)
                {
                    entryValue.Sensitive = (
                        parameter.Token != "COMPANY_NAME" &&
                        parameter.Token != "COMPANY_BUSINESS_NAME" &&
                        parameter.Token != "COMPANY_COUNTRY" &&
                        parameter.Token != "COMPANY_COUNTRY" &&
                        parameter.Token != "COMPANY_COUNTRY_CODE2" &&
                        parameter.Token != "COMPANY_FISCALNUMBER" &&
                        parameter.Token != "SYSTEM_CURRENCY"
                        //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION"
                        //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION_ID"
                        );
                }
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 19
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                // HBoxs
                HBox hbox1 = new HBox(true, _boxSpacing);
                HBox hbox2 = new HBox(true, _boxSpacing);

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), entryCode);
                vboxTab1.PackStart(boxCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true));

                //PrinterType
                _xpoComboBoxPrinterType = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinterstype), (DataSourceRow as sys_configurationprinters).PrinterType, "Designation", null);
                BOWidgetBox boxPrinterType = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_type"), _xpoComboBoxPrinterType);
                vboxTab1.PackStart(boxPrinterType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinterType, DataSourceRow, "PrinterType", SettingsApp.RegexGuid, true));


                //Configurar impressora windows com ESC-POS - LINDOTE
                //Configuração Impressoras Windows TK016310
                //verifica tipo de dialog conforme o tipo de impressora
                _configurationPrinter = (_dataSourceRow as sys_configurationprinters);

                //Verifica tipo de impressora ativo na drop
                string getSelectedType = _xpoComboBoxPrinterType.ActiveText.Substring(0, 1);
                //Preenche o conjunto de strings associado ás diferentes impressoras instaladas no sistema
                var _printersOnSystem = ComboBoxPrinterSelect();
                if (!Utils.IsLinux && _printersOnSystem.Length != 0 /*&& getSelectedType != "-"*/)
                {
                    //Designação para Windows será a escolha da impressora instalada no sistema
                    entryDesignation = new Entry();

                    //Configuração da selectbox
                    TreeIter  iter;
                    TreeStore store = new TreeStore(typeof(string), typeof(string));
                    for (int i = 0; i < System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count; i++)
                    {
                        iter = store.AppendValues(System.Drawing.Printing.PrinterSettings.InstalledPrinters[i].ToString(), System.Drawing.Printing.PrinterSettings.InstalledPrinters[i]);
                    }
                    //Iniciação da comboBox
                    xpoComboBoxInputType = new ComboBox(_printersOnSystem);
                    bool flagSelected = false;

                    //Escolha do valor por defeito
                    xpoComboBoxInputType.Model.GetIterFirst(out iter);
                    int cbox = 0;
                    do
                    {
                        GLib.Value thisRow = new GLib.Value();
                        xpoComboBoxInputType.Model.GetValue(iter, 0, ref thisRow);
                        if ((_dataSourceRow as sys_configurationprinters).Designation != null)
                        {
                            if (_printersOnSystem[cbox] == (_dataSourceRow as sys_configurationprinters).Designation)
                            {
                                xpoComboBoxInputType.SetActiveIter(iter);
                                flagSelected = true;
                                break;
                            }
                        }
                        cbox++;
                    } while (xpoComboBoxInputType.Model.IterNext(ref iter));

                    //Se existir impressora selecionada associa á sua designação
                    if (flagSelected)
                    {
                        entryDesignation.Text = _printersOnSystem[xpoComboBoxInputType.Active];
                    }
                    //Label escondida / Já existe a dropdown list que mostra a escolha da seleção
                    entryDesignation.Visibility = false;

                    //Junção da Drop na WidgetBox do POS
                    _xpoComboBoxPrinterSelect = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), xpoComboBoxInputType);

                    //Mostra Drop List
                    vboxTab1.PackStart(_xpoComboBoxPrinterSelect, false, false, 0);

                    //Verifica designação válida
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(entryDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));
                }
                //Se for Linux usa a Designação por defeito, escrita á mão
                else
                {
                    //Designation
                    Entry       entryDesignation = new Entry();
                    BOWidgetBox boxDesignation   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation);
                    vboxTab1.PackStart(boxDesignation, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));
                }

                //NetworkName
                Entry       entryNetworkName = new Entry();
                BOWidgetBox boxNetworkName   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_networkname"), entryNetworkName);
                vboxTab1.PackStart(boxNetworkName, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxNetworkName, _dataSourceRow, "NetworkName", SettingsApp.RegexHardwarePrinterNetworkNameAndUsbEndpoint, false));

                //Quando a combobox da drop altera
                if (xpoComboBoxInputType != null)
                {
                    xpoComboBoxInputType.Changed += delegate
                    {
                        try {
                            //Se a Seleção for válida, associa á designação
                            entryDesignation.Text = _printersOnSystem[xpoComboBoxInputType.Active];
                            //Se for impressora de rede associa logo o caminho da rede á impressora associada
                            if (_xpoComboBoxPrinterType.Active == 3)
                            {
                                entryNetworkName.Text = _printersOnSystem[xpoComboBoxInputType.Active];
                            }
                            else
                            {
                                entryNetworkName.Text = "";
                            }
                        }catch (Exception ex)
                        {
                            _log.Error(ex.Message, ex);
                        }
                    };
                }


                //Tab2
                _vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //ThermalMaxCharsPerLineNormal
                _entryThermalMaxCharsPerLineNormal = new Entry();
                BOWidgetBox boxThermalMaxCharsPerLineNormal = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_max_chars_per_line_normal"), _entryThermalMaxCharsPerLineNormal);
                _vboxTab2.PackStart(boxThermalMaxCharsPerLineNormal, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalMaxCharsPerLineNormal, _dataSourceRow, "ThermalMaxCharsPerLineNormal", SettingsApp.RegexInteger, true));

                //ThermalMaxCharsPerLineNormalBold
                _entryThermalMaxCharsPerLineNormalBold = new Entry();
                BOWidgetBox boxThermalMaxCharsPerLineNormalBold = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_max_chars_per_line_normal_bold"), _entryThermalMaxCharsPerLineNormalBold);
                _vboxTab2.PackStart(boxThermalMaxCharsPerLineNormalBold, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalMaxCharsPerLineNormalBold, _dataSourceRow, "ThermalMaxCharsPerLineNormalBold", SettingsApp.RegexInteger, true));

                //ThermalMaxCharsPerLineSmall
                _entryThermalMaxCharsPerLineSmall = new Entry();
                BOWidgetBox boxThermalMaxCharsPerLineSmall = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_max_chars_per_line_small"), _entryThermalMaxCharsPerLineSmall);
                _vboxTab2.PackStart(boxThermalMaxCharsPerLineSmall, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalMaxCharsPerLineSmall, _dataSourceRow, "ThermalMaxCharsPerLineSmall", SettingsApp.RegexInteger, true));

                //ThermalEncoding
                _entryThermalEncoding = new Entry();
                BOWidgetBox boxThermalEncoding = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_encoding"), _entryThermalEncoding);
                //_vboxTab2.PackStart(boxThermalEncoding, false, false, 0);
                hbox1.PackStart(boxThermalEncoding, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalEncoding, _dataSourceRow, "ThermalEncoding", SettingsApp.RegexAlfaNumeric, false));

                //ThermalCutCommand
                _entryThermalCutCommand = new Entry();
                BOWidgetBox boxThermalCutCommand = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_cut_command"), _entryThermalCutCommand);
                //_vboxTab2.PackStart(boxThermalCutCommand, false, false, 0);
                hbox1.PackStart(boxThermalCutCommand, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalCutCommand, _dataSourceRow, "ThermalCutCommand", SettingsApp.RegexAlfaNumericExtended, false));

                // Pack hbox
                _vboxTab2.PackStart(hbox1, false, false, 0);

                //ThermalOpenDrawerValueM
                _entryThermalOpenDrawerValueM = new Entry();
                BOWidgetBox boxThermalOpenDrawerValueM = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_open_drawer_value_m"), _entryThermalOpenDrawerValueM);
                //_vboxTab2.PackStart(boxThermalOpenDrawerValueM, false, false, 0);
                hbox2.PackStart(boxThermalOpenDrawerValueM, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalOpenDrawerValueM, _dataSourceRow, "ThermalOpenDrawerValueM", SettingsApp.RegexAlfaNumericExtended, false));

                //ThermalOpenDrawerValueT1
                _entryThermalOpenDrawerValueT1 = new Entry();
                BOWidgetBox boxThermalOpenDrawerValueT1 = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_open_drawer_value_t1"), _entryThermalOpenDrawerValueT1);
                //_vboxTab2.PackStart(boxThermalOpenDrawerValueT1, false, false, 0);
                hbox2.PackStart(boxThermalOpenDrawerValueT1, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalOpenDrawerValueT1, _dataSourceRow, "ThermalOpenDrawerValueT1", SettingsApp.RegexAlfaNumericExtended, false));

                //ThermalOpenDrawerValueT2
                _entryThermalOpenDrawerValueT2 = new Entry();
                BOWidgetBox boxThermalOpenDrawerValueT2 = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_open_drawer_value_t2"), _entryThermalOpenDrawerValueT2);
                //_vboxTab2.PackStart(boxThermalOpenDrawerValueT2, false, false, 0);
                hbox2.PackStart(boxThermalOpenDrawerValueT2, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalOpenDrawerValueT2, _dataSourceRow, "ThermalOpenDrawerValueT2", SettingsApp.RegexAlfaNumericExtended, false));

                // Pack hbox
                _vboxTab2.PackStart(hbox2, false, false, 0);

                //ThermalPrintLogo
                _entryThermalImageCompanyLogo = new Entry();
                BOWidgetBox boxThermalImageCompanyLogo = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_image_company_logo"), _entryThermalImageCompanyLogo);
                _vboxTab2.PackStart(boxThermalImageCompanyLogo, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalImageCompanyLogo, _dataSourceRow, "ThermalImageCompanyLogo", SettingsApp.RegexAlfaNumericFilePath, false));

                //ThermalPrintLogo
                CheckButton checkButtonThermalPrintLogo = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_print_logo"));
                _vboxTab2.PackStart(checkButtonThermalPrintLogo, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonThermalPrintLogo, _dataSourceRow, "ThermalPrintLogo"));

                // Events
                _xpoComboBoxPrinterType.Changed += XpoComboBoxPrinterType_Changed;

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));
                _notebook.AppendPage(_vboxTab2, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_properties")));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 20
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), entryCode);
                vboxTab1.PackStart(boxCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true));

                //Name
                Entry       entryName = new Entry();
                BOWidgetBox boxName   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_name"), entryName);
                vboxTab1.PackStart(boxName, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxName, _dataSourceRow, "Name", SettingsApp.RegexAlfaNumericExtended, true));

                //Profile
                XPOComboBox xpoComboBoxProfile = new XPOComboBox(DataSourceRow.Session, typeof(sys_userprofile), (DataSourceRow as sys_userdetail).Profile, "Designation", null);
                BOWidgetBox boxProfile         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_user_profiles"), xpoComboBoxProfile);
                vboxTab1.PackStart(boxProfile, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxProfile, DataSourceRow, "Profile", SettingsApp.RegexGuid, true));

                //CommissionGroup
                XPOComboBox xpoComboBoxCommissionGroup = new XPOComboBox(DataSourceRow.Session, typeof(pos_usercommissiongroup), (DataSourceRow as sys_userdetail).CommissionGroup, "Designation", null);
                BOWidgetBox boxCommissionGroup         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_commission_group"), xpoComboBoxCommissionGroup);
                vboxTab1.PackStart(boxCommissionGroup, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCommissionGroup, DataSourceRow, "CommissionGroup", SettingsApp.RegexGuid, false));

                //DateOfContract
                Entry       entryDateOfContract = new Entry();
                BOWidgetBox boxDateOfContract   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_contract_date"), entryDateOfContract);
                vboxTab1.PackStart(boxDateOfContract, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDateOfContract, _dataSourceRow, "DateOfContract", SettingsApp.RegexDate, false));

                //PasswordReset: Force Reset Password on Next Login
                _checkButtonPasswordReset = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_reset_password"));
                vboxTab1.PackStart(_checkButtonPasswordReset, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(_checkButtonPasswordReset, _dataSourceRow, "PasswordReset"));
                if (_dialogMode == DialogMode.Insert || _userDetail.PasswordReset || _isLoggedUser)
                {
                    _checkButtonPasswordReset.Sensitive = false;
                }

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Tab2
                VBox vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Residence
                Entry       entryResidence = new Entry();
                BOWidgetBox boxResidence   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_address"), entryResidence);
                vboxTab2.PackStart(boxResidence, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxResidence, _dataSourceRow, "Residence", SettingsApp.RegexAlfaNumericExtended, false));

                //Locality
                Entry       entryLocality = new Entry();
                BOWidgetBox boxLocality   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_locality"), entryLocality);
                vboxTab2.PackStart(boxLocality, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLocality, _dataSourceRow, "Locality", SettingsApp.RegexAlfa, false));

                //City
                Entry       entryCity = new Entry();
                BOWidgetBox boxCity   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_city"), entryCity);
                vboxTab2.PackStart(boxCity, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCity, _dataSourceRow, "City", SettingsApp.RegexAlfa, false));

                //ZipCode
                Entry       entryZipCode = new Entry();
                BOWidgetBox boxZipCode   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_postal_code"), entryZipCode);
                vboxTab2.PackStart(boxZipCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxZipCode, _dataSourceRow, "ZipCode", SettingsApp.ConfigurationSystemCountry.RegExZipCode, false));

                //Phone
                Entry       entryPhone = new Entry();
                BOWidgetBox boxPhone   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_phone"), entryPhone);
                vboxTab2.PackStart(boxPhone, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPhone, _dataSourceRow, "Phone", SettingsApp.RegexIntegerGreaterThanZero, false));

                //MobilePhone
                Entry       entryMobilePhone = new Entry();
                BOWidgetBox boxMobilePhone   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_mobile_phone"), entryMobilePhone);
                vboxTab2.PackStart(boxMobilePhone, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxMobilePhone, _dataSourceRow, "MobilePhone", SettingsApp.RegexIntegerGreaterThanZero, false));

                //Email
                Entry       entryEmail = new Entry();
                BOWidgetBox boxEmail   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_email"), entryEmail);
                vboxTab2.PackStart(boxEmail, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxEmail, _dataSourceRow, "Email", SettingsApp.RegexEmail, false));

                //Append Tab
                _notebook.AppendPage(vboxTab2, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_contacts")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Tab2
                VBox vboxTab3 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //FiscalNumber
                Entry       entryFiscalNumber = new Entry();
                BOWidgetBox boxFiscalNumber   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_number"), entryFiscalNumber);
                vboxTab3.PackStart(boxFiscalNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFiscalNumber, _dataSourceRow, "FiscalNumber", SettingsApp.ConfigurationSystemCountry.RegExFiscalNumber, false));

                //Language
                Entry       entryLanguage = new Entry();
                BOWidgetBox boxLanguage   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_language"), entryLanguage);
                vboxTab3.PackStart(boxLanguage, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLanguage, _dataSourceRow, "Language", SettingsApp.RegexAlfa, false));

                //AssignedSeating
                Entry       entryAssignedSeating = new Entry();
                BOWidgetBox boxAssignedSeating   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_assigned_seating"), entryAssignedSeating);
                vboxTab3.PackStart(boxAssignedSeating, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAssignedSeating, _dataSourceRow, "AssignedSeating", SettingsApp.RegexIntegerColonSeparated, false));

                //AccessCardNumber
                Entry       entryAccessCardNumber = new Entry();
                BOWidgetBox boxAccessCardNumber   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_access_card_number"), entryAccessCardNumber);
                vboxTab3.PackStart(boxAccessCardNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAccessCardNumber, _dataSourceRow, "AccessCardNumber", SettingsApp.RegexIntegerGreaterThanZero, false));

                //BaseConsumption
                Entry       entryBaseConsumption = new Entry();
                BOWidgetBox boxBaseConsumption   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_base_consumption"), entryBaseConsumption);
                vboxTab3.PackStart(boxBaseConsumption, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxBaseConsumption, _dataSourceRow, "BaseConsumption", SettingsApp.RegexIntegerGreaterThanZero, false));

                //BaseOffers
                Entry       entryBaseOffers = new Entry();
                BOWidgetBox boxBaseOffers   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_base_offers"), entryBaseOffers);
                vboxTab3.PackStart(boxBaseOffers, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxBaseOffers, _dataSourceRow, "BaseOffers", SettingsApp.RegexIntegerGreaterThanZero, false));

                //PVPOffers
                Entry       entryPVPOffers = new Entry();
                BOWidgetBox boxPVPOffers   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_price_offers"), entryPVPOffers);
                vboxTab3.PackStart(boxPVPOffers, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPVPOffers, _dataSourceRow, "PVPOffers", SettingsApp.RegexIntegerGreaterThanZero, false));

                //Append Tab
                _notebook.AppendPage(vboxTab3, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_others")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Protect to prevent disabled Current Logged in User
                if (_isLoggedUser)
                {
                    checkButtonDisabled.Sensitive = false;
                }

                //Capture Events
                _crudWidgetList.BeforeUpdate += _crudWidgetList_BeforeUpdate;
                _crudWidgetList.AfterUpdate  += _crudWidgetList_AfterUpdate;
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 21
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));

                //Place
                XPOComboBox xpoComboBoxPlace = new XPOComboBox(DataSourceRow.Session, typeof(pos_configurationplace), (DataSourceRow as pos_configurationplaceterminal).Place, "Designation", null);
                BOWidgetBox boxPlace         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_places"), xpoComboBoxPlace);
                vboxTab1.PackStart(boxPlace, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPlace, DataSourceRow, "Place", SettingsApp.RegexGuid, false));

                //HardwareId
                Entry       entryHardwareId = new Entry();
                BOWidgetBox boxHardwareId   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_hardware_id"), entryHardwareId);
                vboxTab1.PackStart(boxHardwareId, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxHardwareId, _dataSourceRow, "HardwareId", SettingsApp.RegexAlfaNumericExtended, false));

                //Tab2
                VBox vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Printer
                CriteriaOperator pcriteria          = CriteriaOperator.Parse(string.Format("(Oid <> '{0}' AND (PrinterType = '{1}' OR PrinterType = '{2}' OR PrinterType = '{3}'))", SettingsApp.XpoOidUndefinedRecord, SettingsApp.XpoOidConfigurationPrinterTypeGenericWindows, SettingsApp.XpoOidConfigurationPrinterTypeGenericLinux, SettingsApp.XpoOidConfigurationPrinterTypeExportPdf));
                XPOComboBox      xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinters), (DataSourceRow as pos_configurationplaceterminal).Printer, "Designation", pcriteria);
                BOWidgetBox      boxPrinter         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationPrinters"), xpoComboBoxPrinter);
                TreeIter         iter;
                xpoComboBoxPrinter.Model.GetIterFirst(out iter);
                do
                {
                    GLib.Value thisRow = new GLib.Value();
                    xpoComboBoxPrinter.Model.GetValue(iter, 0, ref thisRow);
                    //if ((thisRow.Val as string).Equals("Exportação para PDF"))
                    //{
                    //    xpoComboBoxPrinter.SetActiveIter(iter);
                    //    break;
                    //}
                } while (xpoComboBoxPrinter.Model.IterNext(ref iter));
                vboxTab2.PackStart(boxPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, false));

                //ThermalPrinter
                pcriteria = CriteriaOperator.Parse(string.Format("(Oid <> '{0}' AND (PrinterType = '{1}' OR PrinterType = '{2}' OR PrinterType = '{3}' OR PrinterType = '{4}'))", SettingsApp.XpoOidUndefinedRecord, SettingsApp.XpoOidConfigurationPrinterTypeThermalPrinterWindows, SettingsApp.XpoOidConfigurationPrinterTypeThermalPrinterLinux, SettingsApp.XpoOidConfigurationPrinterTypeThermalPrinterSocket, SettingsApp.XpoOidConfigurationPrinterTypeThermalPrinterUsb));

                XPOComboBox xpoComboBoxThermalPrinter = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinters), (DataSourceRow as pos_configurationplaceterminal).ThermalPrinter, "Designation", pcriteria);
                BOWidgetBox boxThermalPrinter         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printer_thermal_printer"), xpoComboBoxThermalPrinter);
                vboxTab2.PackStart(boxThermalPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalPrinter, DataSourceRow, "ThermalPrinter", SettingsApp.RegexGuid, false));

                //PoleDisplay
                XPOComboBox xpoComboBoxPoleDisplay = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationpoledisplay), (DataSourceRow as pos_configurationplaceterminal).PoleDisplay, "Designation", null);
                BOWidgetBox boxPoleDisplay         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationPoleDisplay"), xpoComboBoxPoleDisplay);
                vboxTab2.PackStart(boxPoleDisplay, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPoleDisplay, DataSourceRow, "PoleDisplay", SettingsApp.RegexGuid, false));

                //WeighingMachine
                XPOComboBox xpoComboBoxWeighingMachine = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationweighingmachine), (DataSourceRow as pos_configurationplaceterminal).WeighingMachine, "Designation", null);
                BOWidgetBox boxWeighingMachine         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationWeighingMachine"), xpoComboBoxWeighingMachine);
                vboxTab2.PackStart(boxWeighingMachine, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxWeighingMachine, DataSourceRow, "WeighingMachine", SettingsApp.RegexGuid, false));

                //BarcodeReader
                XPOComboBox xpoComboBoxBarcodeReader = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationinputreader), (DataSourceRow as pos_configurationplaceterminal).BarcodeReader, "Designation", null);
                BOWidgetBox boxBarcodeReader         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_input_barcode_reader"), xpoComboBoxBarcodeReader);
                vboxTab2.PackStart(boxBarcodeReader, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxBarcodeReader, DataSourceRow, "BarcodeReader", SettingsApp.RegexGuid, false));

                //CardReader
                XPOComboBox xpoComboBoxCardReader = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationinputreader), (DataSourceRow as pos_configurationplaceterminal).CardReader, "Designation", null);
                BOWidgetBox boxCardReader         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_input_reader_card_reader"), xpoComboBoxCardReader);
                vboxTab2.PackStart(boxCardReader, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCardReader, DataSourceRow, "CardReader", SettingsApp.RegexGuid, false));

                //InputReaderTimerInterval
                Entry       entryInputReaderTimerInterval = new Entry();
                BOWidgetBox boxInputReaderTimerInterval   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_input_reader_timer_interval"), entryInputReaderTimerInterval);
                vboxTab2.PackStart(boxInputReaderTimerInterval, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxInputReaderTimerInterval, _dataSourceRow, "InputReaderTimerInterval", SettingsApp.RegexInteger, true));

                ////TemplateTicket : Deprecated
                //XPOComboBox xpoComboBoxTemplateTicket = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinterstemplates), (DataSourceRow as pos_configurationplaceterminal).TemplateTicket, "Designation", "FinancialTemplate = 0");
                //BOWidgetBox boxTemplateTicket = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_configurationprinters_template_ticket, xpoComboBoxTemplateTicket);
                //vboxTab1.PackStart(boxTemplateTicket, false, false, 0);
                //_crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplateTicket, DataSourceRow, "TemplateTicket", SettingsApp.RegexGuid, true));

                ////TemplateTablesConsult : Deprecated
                //XPOComboBox xpoComboBoxTemplateTablesConsult = new XPOComboBox(DataSourceRow.Session, typeof(sys_configurationprinterstemplates), (DataSourceRow as pos_configurationplaceterminal).TemplateTablesConsult, "Designation", "FinancialTemplate = 0");
                //BOWidgetBox boxTemplateTablesConsult = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_configurationprinters_template_table_consult, xpoComboBoxTemplateTablesConsult);
                //vboxTab1.PackStart(boxTemplateTablesConsult, false, false, 0);
                //_crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplateTablesConsult, DataSourceRow, "TemplateTablesConsult", SettingsApp.RegexGuid, true));

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_disabled"));
                vboxTab1.PackStart(checkButtonDisabled, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonDisabled, _dataSourceRow, "Disabled"));

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));
                _notebook.AppendPage(vboxTab2, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_devices")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryHardwareId.Sensitive     = false;
                checkButtonDisabled.Sensitive = false;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 22
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //FiscalYear
                XPOComboBox xpoComboBoxFiscalYear = new XPOComboBox(DataSourceRow.Session, typeof(fin_documentfinanceyears), (DataSourceRow as fin_documentfinanceseries).FiscalYear, "Designation", null);
                BOWidgetBox boxFiscalYear         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinance_series"), xpoComboBoxFiscalYear);
                vboxTab1.PackStart(boxFiscalYear, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFiscalYear, DataSourceRow, "FiscalYear", SettingsApp.RegexGuid, true));

                //DocumentType
                XPOComboBox xpoComboBoxDocumentType = new XPOComboBox(DataSourceRow.Session, typeof(fin_documentfinancetype), (DataSourceRow as fin_documentfinanceseries).DocumentType, "Designation", null);
                BOWidgetBox boxDocumentType         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinance_type"), xpoComboBoxDocumentType);
                vboxTab1.PackStart(boxDocumentType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDocumentType, DataSourceRow, "DocumentType", SettingsApp.RegexGuid, true));

                //Designation
                Entry       entryDesignation = new Entry();
                BOWidgetBox boxDesignation   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));

                //Acronym
                Entry       entryAcronym = new Entry();
                BOWidgetBox boxAcronym   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_acronym"), entryAcronym);
                vboxTab1.PackStart(boxAcronym, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAcronym, _dataSourceRow, "Acronym", SettingsApp.RegexAlfaNumeric, false));

                //NextDocumentNumber
                Entry       entryNextDocumentNumber = new Entry();
                BOWidgetBox boxNextDocumentNumber   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinanceseries_NextDocumentNumber"), entryNextDocumentNumber);
                vboxTab1.PackStart(boxNextDocumentNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxNextDocumentNumber, _dataSourceRow, "NextDocumentNumber", SettingsApp.RegexIntegerGreaterThanZero, false));

                //DocumentNumberRangeBegin
                Entry       entryDocumentNumberRangeBegin = new Entry();
                BOWidgetBox boxDocumentNumberRangeBegin   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinanceseries_DocumentNumberRangeBegin"), entryDocumentNumberRangeBegin);
                vboxTab1.PackStart(boxDocumentNumberRangeBegin, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDocumentNumberRangeBegin, _dataSourceRow, "DocumentNumberRangeBegin", SettingsApp.RegexIntegerGreaterThanZero, false));

                //DocumentNumberRangeEnd
                Entry       entryDocumentNumberRangeEnd = new Entry();
                BOWidgetBox boxDocumentNumberRangeEnd   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinanceseries_DocumentNumberRangeEnd"), entryDocumentNumberRangeEnd);
                vboxTab1.PackStart(boxDocumentNumberRangeEnd, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDocumentNumberRangeEnd, _dataSourceRow, "DocumentNumberRangeEnd", SettingsApp.RegexIntegerGreaterThanZero, false));

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                xpoComboBoxFiscalYear.Sensitive         = false;
                xpoComboBoxDocumentType.Sensitive       = false;
                entryAcronym.Sensitive                  = false;
                entryNextDocumentNumber.Sensitive       = false;
                entryDocumentNumberRangeBegin.Sensitive = false;
                entryDocumentNumberRangeEnd.Sensitive   = false;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 23
0
        private void InitUI()
        {
            BOWidgetBox boxValue = null;

            try
            {
                CFG_ConfigurationPreferenceParameter dataSourceRow = (CFG_ConfigurationPreferenceParameter)_dataSourceRow;

                //Define Label for Value
                string valueLabel = (Resx.ResourceManager.GetString(dataSourceRow.ResourceString) != null)
                    ? Resx.ResourceManager.GetString(dataSourceRow.ResourceString)
                    : "LABEL NOT DEFINED IN Field  [ResourceString]";

                //Define RegEx for Value
                string valueRegEx = "REGULAR EXPRESSION NOT DEFINED IN Field [RegEx]";
                if (dataSourceRow.RegEx != null)
                {
                    //Try to get Value
                    object objectValueRegEx = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), dataSourceRow.RegEx);
                    if (objectValueRegEx != null)
                    {
                        valueRegEx = objectValueRegEx.ToString();
                    }
                }

                //Define Label for Value
                bool valueRequired = (dataSourceRow.Required)
                    ? dataSourceRow.Required
                    : false;

                //Override Db Regex with ConfigurationSystemCountry RegExZipCode and RegExFiscalNumber
                if (dataSourceRow.Token == "COMPANY_POSTALCODE")
                {
                    valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExZipCode;
                }
                if (dataSourceRow.Token == "COMPANY_FISCALNUMBER")
                {
                    valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExFiscalNumber;
                }

                //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));

                //Token
                Entry       entryToken = new Entry();
                BOWidgetBox boxToken   = new BOWidgetBox(Resx.global_token, entryToken);
                vboxTab1.PackStart(boxToken, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxToken, _dataSourceRow, "Token", SettingsApp.RegexAlfaNumericExtended, true));

                //Get InputType
                PreferenceParameterInputType inputType = (PreferenceParameterInputType)Enum.Parse(typeof(PreferenceParameterInputType), dataSourceRow.InputType.ToString(), true);

                Entry entryValue = new Entry();

                switch (inputType)
                {
                case PreferenceParameterInputType.Text:
                case PreferenceParameterInputType.TextPassword:
                    boxValue = new BOWidgetBox(valueLabel, entryValue);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    // Turn entry into a TextPassword, curently we not use it, until we can turn Visibility = false into TreeView Cell
                    if (inputType.Equals(PreferenceParameterInputType.TextPassword))
                    {
                        entryValue.Visibility = false;
                    }

                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired));
                    // ValueTip
                    if (!string.IsNullOrEmpty(dataSourceRow.ValueTip))
                    {
                        entryValue.TooltipText = string.Format(Resx.global_prefparam_value_tip_format, dataSourceRow.ValueTip);
                    }
                    break;

                case PreferenceParameterInputType.Multiline:
                    EntryMultiline entryMultiline = new EntryMultiline();
                    entryMultiline.Value.Text = dataSourceRow.Value;
                    entryMultiline.ScrolledWindow.BorderWidth = 1;
                    entryMultiline.HeightRequest = 122;
                    Label labelMultiline = new Label(Resx.global_notes);
                    boxValue = new BOWidgetBox(valueLabel, entryMultiline);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired));
                    // Override Default Window Height
                    _windowHeight = _windowHeightForTextComponent + 100;
                    break;

                case PreferenceParameterInputType.CheckButton:
                    CheckButton checkButtonValue = new CheckButton(valueLabel);
                    vboxTab1.PackStart(checkButtonValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonValue, _dataSourceRow, "Value"));
                    // Override Default Window Height
                    _windowHeight = _windowHeightForTextComponent - 20;
                    break;

                case PreferenceParameterInputType.ComboBox:
                    break;

                case PreferenceParameterInputType.FilePicker:
                case PreferenceParameterInputType.DirPicker:
                    //FilePicker
                    FileChooserAction fileChooserAction = (inputType.Equals(PreferenceParameterInputType.FilePicker)) ? FileChooserAction.Open : FileChooserAction.SelectFolder;
                    FileChooserButton fileChooser       = new FileChooserButton(string.Empty, fileChooserAction)
                    {
                        HeightRequest = 23
                    };
                    if (inputType.Equals(PreferenceParameterInputType.FilePicker))
                    {
                        fileChooser.SetFilename(dataSourceRow.Value);
                        fileChooser.Filter = Utils.GetFileFilterImages();
                    }
                    else
                    {
                        fileChooser.SetCurrentFolder(dataSourceRow.Value);
                    }
                    boxValue = new BOWidgetBox(valueLabel, fileChooser);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false));
                    break;

                default:
                    break;
                }

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryToken.Sensitive = false;

                //Protect PreferenceParameterInputType : Disable if is COMPANY_FISCALNUMBER or Other Sensitive Data
                CFG_ConfigurationPreferenceParameter parameter = (_dataSourceRow as CFG_ConfigurationPreferenceParameter);
                if (entryValue != null)
                {
                    entryValue.Sensitive = (
                        parameter.Token != "COMPANY_NAME" &&
                        parameter.Token != "COMPANY_BUSINESS_NAME" &&
                        parameter.Token != "COMPANY_COUNTRY" &&
                        parameter.Token != "COMPANY_COUNTRY" &&
                        parameter.Token != "COMPANY_COUNTRY_CODE2" &&
                        parameter.Token != "COMPANY_FISCALNUMBER" &&
                        parameter.Token != "SYSTEM_CURRENCY"
                        //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION"
                        //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION_ID"
                        );
                }
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 24
0
        private void InitUI()
        {
            try
            {
                //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));

                //Date
                Entry       entryDate = new Entry();
                BOWidgetBox boxDate   = new BOWidgetBox(Resx.global_ConfigurationMaintenance_Date, entryDate);
                vboxTab1.PackStart(boxDate, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDate, _dataSourceRow, "Date", SettingsApp.RegexAlfaNumeric, false));

                //Time
                Entry       entryTime = new Entry();
                BOWidgetBox boxTime   = new BOWidgetBox(Resx.global_ConfigurationMaintenance_Time, entryTime);
                vboxTab1.PackStart(boxTime, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTime, _dataSourceRow, "Time", SettingsApp.RegexAlfaNumeric, false));

                //PasswordAccess
                Entry       entryPasswordAccess = new Entry();
                BOWidgetBox boxPasswordAccess   = new BOWidgetBox(Resx.global_ConfigurationMaintenance_PasswordAccess, entryPasswordAccess);
                vboxTab1.PackStart(boxPasswordAccess, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPasswordAccess, _dataSourceRow, "PasswordAccess", SettingsApp.RegexAlfaNumeric, false));

                //Remarks
                Entry       entryRemarks = new Entry();
                BOWidgetBox boxRemarks   = new BOWidgetBox(Resx.global_ConfigurationMaintenance_Remarks, entryRemarks);
                vboxTab1.PackStart(boxRemarks, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxRemarks, _dataSourceRow, "Remarks", SettingsApp.RegexAlfaNumeric, false));

                //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));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 25
0
        private void InitUI()
        {
            try
            {
                //Init Local Vars
                _article = (_dataSourceRow as FIN_Article);

                if (_dialogMode != DialogMode.Insert)
                {
                    //Get totalNumberOfFinanceDocuments to check if article has already used in Finance Documents, to protect name changes etc
                    string sql       = string.Format("SELECT COUNT(*) as Count FROM fin_documentfinancedetail WHERE Article = '{0}';", _article.Oid);
                    var    sqlResult = GlobalFramework.SessionXpo.ExecuteScalar(sql);
                    _totalNumberOfFinanceDocuments = Convert.ToUInt16(sqlResult);
                }

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //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.RegexAlfaNumericArticleCode, true));

                //CodeDealer
                Entry       entryCodeDealer = new Entry();
                BOWidgetBox boxCodeDealer   = new BOWidgetBox(Resx.global_record_code_dealer, entryCodeDealer);
                vboxTab1.PackStart(boxCodeDealer, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCodeDealer, _dataSourceRow, "CodeDealer", SettingsApp.RegexAlfaNumeric, false));

                //Designation
                Entry       entryDesignation = new Entry();
                BOWidgetBox boxDesignation   = new BOWidgetBox(Resx.global_designation, entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                // Changed from RegexAlfaNumeric to  RegexAlfaNumericExtended 2017-1011
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));

                //ButtonLabel
                Entry       entryButtonLabel = new Entry();
                BOWidgetBox boxButtonLabel   = new BOWidgetBox(Resx.global_button_name, entryButtonLabel);
                vboxTab1.PackStart(boxButtonLabel, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxButtonLabel, _dataSourceRow, "ButtonLabel", SettingsApp.RegexAlfaNumericArticleButtonLabel, false));

                //Family
                _xpoComboBoxFamily = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleFamily), (DataSourceRow as FIN_Article).Family, "Designation");
                BOWidgetBox boxFamily = new BOWidgetBox(Resx.global_article_family, _xpoComboBoxFamily);
                vboxTab1.PackStart(boxFamily, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFamily, DataSourceRow, "Family", SettingsApp.RegexGuid, true));

                //SubFamily
                _xpoComboBoxSubFamily = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleSubFamily), (DataSourceRow as FIN_Article).SubFamily, "Designation");
                BOWidgetBox boxSubFamily = new BOWidgetBox(Resx.global_article_subfamily, _xpoComboBoxSubFamily);
                vboxTab1.PackStart(boxSubFamily, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxSubFamily, DataSourceRow, "SubFamily", SettingsApp.RegexGuid, true));

                //Type
                XPOComboBox xpoComboBoxType = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleType), (DataSourceRow as FIN_Article).Type, "Designation");
                BOWidgetBox boxType         = new BOWidgetBox(Resx.global_article_type, xpoComboBoxType);
                vboxTab1.PackStart(boxType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxType, DataSourceRow, "Type", SettingsApp.RegexGuid, true));

                //ButtonImage
                FileChooserButton fileChooserButtonImage = new FileChooserButton(string.Empty, FileChooserAction.Open)
                {
                    HeightRequest = 23
                };
                Image fileChooserImagePreviewButtonImage = new Image()
                {
                    WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height
                };
                Frame fileChooserFrameImagePreviewButtonImage = new Frame();
                fileChooserFrameImagePreviewButtonImage.ShadowType = ShadowType.None;
                fileChooserFrameImagePreviewButtonImage.Add(fileChooserImagePreviewButtonImage);
                fileChooserButtonImage.SetFilename(((FIN_Article)DataSourceRow).ButtonImage);
                fileChooserButtonImage.Filter            = Utils.GetFileFilterImages();
                fileChooserButtonImage.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewButtonImage.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewButtonImage.WidthRequest, fileChooserImagePreviewButtonImage.HeightRequest));
                BOWidgetBox boxfileChooserButtonImage = new BOWidgetBox(Resx.global_button_image, fileChooserButtonImage);
                HBox        hboxfileChooserAndimagePreviewButtonImage = new HBox(false, _boxSpacing);
                hboxfileChooserAndimagePreviewButtonImage.PackStart(boxfileChooserButtonImage, true, true, 0);
                hboxfileChooserAndimagePreviewButtonImage.PackStart(fileChooserFrameImagePreviewButtonImage, false, false, 0);
                vboxTab1.PackStart(hboxfileChooserAndimagePreviewButtonImage, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserButtonImage, _dataSourceRow, "ButtonImage", string.Empty, false));

                //Favorite
                CheckButton checkButtonFavorite = new CheckButton(Resx.global_favorite);
                vboxTab1.PackStart(checkButtonFavorite, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonFavorite, _dataSourceRow, "Favorite"));

                //UseWeighingBalance
                CheckButton checkButtonUseWeighingBalance = new CheckButton(Resx.global_use_weighing_balance);
                vboxTab1.PackStart(checkButtonUseWeighingBalance, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonUseWeighingBalance, _dataSourceRow, "UseWeighingBalance"));

                //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));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Tab2
                _vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                int col1width = 100, col2width = 90, col3width = col2width, col4width = 160;

                //hboxPrices
                Label labelPriceEmpty = new Label(string.Empty)
                {
                    WidthRequest = col1width
                };
                Label labelPriceNormal = new Label(Resx.article_normal_price)
                {
                    WidthRequest = col2width
                };
                Label labelPricePromotion = new Label(Resx.article_promotion_price)
                {
                    WidthRequest = col3width
                };
                Label labelPriceUsePromotionPrice = new Label(Resx.article_use_promotion_price)
                {
                    WidthRequest = col4width
                };
                labelPriceNormal.SetAlignment(0.0F, 0.5F);
                labelPricePromotion.SetAlignment(0.0F, 0.5F);
                labelPriceUsePromotionPrice.SetAlignment(0.0F, 0.5F);

                VBox vboxPrices = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };
                HBox hboxPrices = new HBox(false, _boxSpacing);
                hboxPrices.PackStart(labelPriceEmpty, true, true, 0);
                hboxPrices.PackStart(labelPriceNormal, false, false, 0);
                hboxPrices.PackStart(labelPricePromotion, false, false, 0);
                hboxPrices.PackStart(labelPriceUsePromotionPrice, false, false, 0);
                //PackIt VBox
                vboxPrices.PackStart(hboxPrices, false, false, 0);

                //Get PriceType Collection : Require Criteria to exclude SettingsApp.XpoOidUndefinedRecord, else we get a Price0 here
                CriteriaOperator criteriaOperator          = CriteriaOperator.Parse(string.Format("(Disabled IS NULL OR Disabled  <> 1) OR (Oid <> '{0}')", SettingsApp.XpoOidUndefinedRecord));
                XPCollection     xpcConfigurationPriceType = new XPCollection(DataSourceRow.Session, typeof(FIN_ConfigurationPriceType), criteriaOperator);

                xpcConfigurationPriceType.Sorting = FrameworkUtils.GetXPCollectionDefaultSortingCollection();
                //Define Max 5 Rows : 5 Prices
                int priceTypeCount = (xpcConfigurationPriceType.Count > 5) ? 5 : xpcConfigurationPriceType.Count;

                //Loop and Render Columns
                for (int i = 0; i < priceTypeCount; i++)
                {
                    int priceTypeIndex = ((FIN_ConfigurationPriceType)xpcConfigurationPriceType[i]).EnumValue;

                    //FieldNames
                    string fieldNamePriceNormal            = string.Format("Price{0}", priceTypeIndex);
                    string fieldNamePricePromotion         = string.Format("Price{0}Promotion", priceTypeIndex);
                    string fieldNamePriceUsePromotionPrice = string.Format("Price{0}UsePromotionPrice", priceTypeIndex);
                    //PriceType
                    Label labelPriceType = new Label(((FIN_ConfigurationPriceType)xpcConfigurationPriceType[i]).Designation)
                    {
                        WidthRequest = col1width
                    };
                    labelPriceType.SetAlignment(0.0F, 0.5F);

                    //Entrys
                    Entry entryPriceNormal = new Entry()
                    {
                        WidthRequest = col2width
                    };
                    Entry entryPricePromotion = new Entry()
                    {
                        WidthRequest = col3width
                    };
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(entryPriceNormal, _dataSourceRow, fieldNamePriceNormal, SettingsApp.RegexDecimalGreaterEqualThanZero, true));
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(entryPricePromotion, _dataSourceRow, fieldNamePricePromotion, SettingsApp.RegexDecimalGreaterEqualThanZero, true));
                    //UsePromotion
                    CheckButton checkButtonUsePromotion = new CheckButton(string.Empty)
                    {
                        WidthRequest = col4width
                    };
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonUsePromotion, _dataSourceRow, fieldNamePriceUsePromotionPrice));
                    //PackIt
                    hboxPrices = new HBox(false, _boxSpacing);
                    hboxPrices.PackStart(labelPriceType, true, true, 0);
                    hboxPrices.PackStart(entryPriceNormal, false, false, 0);
                    hboxPrices.PackStart(entryPricePromotion, false, false, 0);
                    hboxPrices.PackStart(checkButtonUsePromotion, false, false, 0);
                    //PackIt VBox
                    vboxPrices.PackStart(hboxPrices, false, false, 0);
                }
                _vboxTab2.PackStart(vboxPrices, false, false, 0);

                //PVPVariable
                CheckButton checkButtonPVPVariable = new CheckButton(Resx.global_variable_price);
                _vboxTab2.PackStart(checkButtonPVPVariable, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonPVPVariable, _dataSourceRow, "PVPVariable"));

                //PriceWithVat
                CheckButton checkButtonPriceWithVat = new CheckButton(Resx.global_price_with_vat);
                _vboxTab2.PackStart(checkButtonPriceWithVat, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonPriceWithVat, _dataSourceRow, "PriceWithVat"));

                //Discount
                Entry       entryDiscount = new Entry();
                BOWidgetBox boxDiscount   = new BOWidgetBox(Resx.global_discount, entryDiscount);
                _vboxTab2.PackStart(boxDiscount, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscount, _dataSourceRow, "Discount", SettingsApp.RegexPercentage, false));

                //Class
                XPOComboBox xpoComboBoxClass = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ArticleClass), (DataSourceRow as FIN_Article).Class, "Designation");
                BOWidgetBox boxClass         = new BOWidgetBox(Resx.global_article_class, xpoComboBoxClass);
                _vboxTab2.PackStart(boxClass, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxClass, DataSourceRow, "Class", SettingsApp.RegexGuid, true));

                //Normal App Mode
                if (SettingsApp.AppMode == AppOperationMode.Default)
                {
                    //VatOnTable
                    _xpoComboBoxVatOnTable = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatRate), (DataSourceRow as FIN_Article).VatOnTable, "Designation");
                    BOWidgetBox boxVatOnTable = new BOWidgetBox(Resx.global_vat_on_table, _xpoComboBoxVatOnTable);
                    _vboxTab2.PackStart(boxVatOnTable, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatOnTable, DataSourceRow, "VatOnTable", SettingsApp.RegexGuid, true));
                }

                //VatDirectSelling
                _xpoComboBoxVatDirectSelling = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatRate), (DataSourceRow as FIN_Article).VatDirectSelling, "Designation");
                BOWidgetBox boxVatDirectSelling = new BOWidgetBox(Resx.global_vat_direct_selling, _xpoComboBoxVatDirectSelling);
                _vboxTab2.PackStart(boxVatDirectSelling, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatDirectSelling, DataSourceRow, "VatDirectSelling", SettingsApp.RegexGuid, true));

                //VatExemptionReason
                _xpoComboBoxVatExemptionReason = new XPOComboBox(DataSourceRow.Session, typeof(FIN_ConfigurationVatExemptionReason), (DataSourceRow as FIN_Article).VatExemptionReason, "Designation");
                BOWidgetBox boxVatExemptionReason = new BOWidgetBox(Resx.global_vat_exemption_reason, _xpoComboBoxVatExemptionReason);
                _vboxTab2.PackStart(boxVatExemptionReason, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVatExemptionReason, DataSourceRow, "VatExemptionReason", SettingsApp.RegexGuid, true));

                //Append Tab
                _notebook.AppendPage(_vboxTab2, new Label(Resx.dialog_edit_article_tab2_label));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Tab3
                VBox vboxTab3 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //BarCode
                Entry       entryBarCode = new Entry();
                BOWidgetBox boxBarCode   = new BOWidgetBox(Resx.global_barcode, entryBarCode);
                vboxTab3.PackStart(boxBarCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxBarCode, _dataSourceRow, "BarCode", SettingsApp.RegexEan12andEan4, false));

                //Accounting
                Entry       entryAccounting = new Entry();
                BOWidgetBox boxAccounting   = new BOWidgetBox(Resx.global_accounting, entryAccounting);
                vboxTab3.PackStart(boxAccounting, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAccounting, _dataSourceRow, "Accounting", SettingsApp.RegexDecimal, false));

                //Tare
                Entry       entryTare = new Entry();
                BOWidgetBox boxTare   = new BOWidgetBox(Resx.global_tare, entryTare);
                vboxTab3.PackStart(boxTare, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTare, _dataSourceRow, "Tare", SettingsApp.RegexDecimal, false));

                //Weight
                Entry       entryWeight = new Entry();
                BOWidgetBox boxWeight   = new BOWidgetBox(Resx.global_weight, entryWeight);
                vboxTab3.PackStart(boxWeight, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxWeight, _dataSourceRow, "Weight", SettingsApp.RegexDecimal, false));

                //DefaultQuantity
                Entry       entryDefaultQuantity = new Entry();
                BOWidgetBox boxDefaultQuantity   = new BOWidgetBox(Resx.global_article_default_quantity, entryDefaultQuantity);
                vboxTab3.PackStart(boxDefaultQuantity, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDefaultQuantity, _dataSourceRow, "DefaultQuantity", SettingsApp.RegexDecimal, false));

                //UnitMeasure
                XPOComboBox xpoComboBoxUnitMeasure = new XPOComboBox(DataSourceRow.Session, typeof(CFG_ConfigurationUnitMeasure), (DataSourceRow as FIN_Article).UnitMeasure, "Designation");
                BOWidgetBox boxUnitMeasure         = new BOWidgetBox(Resx.global_unit_measure, xpoComboBoxUnitMeasure);
                vboxTab3.PackStart(boxUnitMeasure, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxUnitMeasure, DataSourceRow, "UnitMeasure", SettingsApp.RegexGuid, true));

                //UnitSize
                XPOComboBox xpoComboBoxUnitSize = new XPOComboBox(DataSourceRow.Session, typeof(CFG_ConfigurationUnitSize), (DataSourceRow as FIN_Article).UnitSize, "Designation");
                BOWidgetBox boxUnitSize         = new BOWidgetBox(Resx.global_unit_size, xpoComboBoxUnitSize);
                vboxTab3.PackStart(boxUnitSize, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxUnitSize, DataSourceRow, "UnitSize", SettingsApp.RegexGuid, true));

                //Printer
                XPOComboBox xpoComboBoxPrinter = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrinters), (DataSourceRow as FIN_Article).Printer, "Designation");
                BOWidgetBox boxPrinter         = new BOWidgetBox(Resx.global_device_printer, xpoComboBoxPrinter);
                vboxTab3.PackStart(boxPrinter, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinter, DataSourceRow, "Printer", SettingsApp.RegexGuid, false));

                //Template
                XPOComboBox xpoComboBoxTemplate = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrintersTemplates), (DataSourceRow as FIN_Article).Template, "Designation");
                BOWidgetBox boxTemplate         = new BOWidgetBox(Resx.global_ConfigurationPrintersTemplates, xpoComboBoxTemplate);
                vboxTab3.PackStart(boxTemplate, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTemplate, DataSourceRow, "Template", SettingsApp.RegexGuid, false));

                if (GlobalApp.ScreenSize.Width > 800 && GlobalApp.ScreenSize.Height > 600)
                {
                    //CommissionGroup
                    XPOComboBox xpoComboBoxCommissionGroup = new XPOComboBox(DataSourceRow.Session, typeof(POS_UserCommissionGroup), (DataSourceRow as FIN_Article).CommissionGroup, "Designation");
                    BOWidgetBox boxCommissionGroup         = new BOWidgetBox(Resx.global_commission_group, xpoComboBoxCommissionGroup);
                    vboxTab3.PackStart(boxCommissionGroup, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCommissionGroup, DataSourceRow, "CommissionGroup", SettingsApp.RegexGuid, false));

                    //DiscountGroup
                    XPOComboBox xpoComboBoxDiscountGroup = new XPOComboBox(DataSourceRow.Session, typeof(ERP_CustomerDiscountGroup), (DataSourceRow as FIN_Article).DiscountGroup, "Designation");
                    BOWidgetBox boxDiscountGroup         = new BOWidgetBox(Resx.global_discount_group, xpoComboBoxDiscountGroup);
                    vboxTab3.PackStart(boxDiscountGroup, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscountGroup, DataSourceRow, "DiscountGroup", SettingsApp.RegexGuid, false));
                }

                //Append Tab
                _notebook.AppendPage(vboxTab3, new Label(Resx.dialog_edit_article_tab3_label));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Enable/Disable Components
                entryDesignation.Sensitive = (_totalNumberOfFinanceDocuments > 0) ? false : true;

                //Show or Hide vboxTab2
                if (_article.Type != null)
                {
                    _vboxTab2.Visible = _article.Type.HavePrice;
                }

                //Assign Initial Value for Family
                DefineInitialValueForXpoComboBoxFamily();
                //Call UI Update for VatExemptionReason
                UpdateUIVatExemptionReason();

                //Events
                _xpoComboBoxFamily.Changed           += xpoComboBoxFamily_Changed;
                xpoComboBoxType.Changed              += xpoComboBoxType_Changed;
                _xpoComboBoxVatDirectSelling.Changed += xpoComboBoxVatDirectSelling_Changed;
                if (_xpoComboBoxVatOnTable != null)
                {
                    _xpoComboBoxVatOnTable.Changed += xpoComboBoxVatDirectSelling_Changed;
                }
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 26
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                // HBoxs
                HBox hbox1 = new HBox(true, _boxSpacing);
                HBox hbox2 = new HBox(true, _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));

                //PrinterType
                _xpoComboBoxPrinterType = new XPOComboBox(DataSourceRow.Session, typeof(SYS_ConfigurationPrintersType), (DataSourceRow as SYS_ConfigurationPrinters).PrinterType, "Designation");
                BOWidgetBox boxPrinterType = new BOWidgetBox(Resx.global_printer_type, _xpoComboBoxPrinterType);
                vboxTab1.PackStart(boxPrinterType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPrinterType, DataSourceRow, "PrinterType", SettingsApp.RegexGuid, 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));

                //NetworkName
                Entry       entryNetworkName = new Entry();
                BOWidgetBox boxNetworkName   = new BOWidgetBox(Resx.global_networkname, entryNetworkName);
                vboxTab1.PackStart(boxNetworkName, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxNetworkName, _dataSourceRow, "NetworkName", SettingsApp.RegexHardwarePrinterNetworkNameAndUsbEndpoint, false));

                //Tab2
                _vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //ThermalMaxCharsPerLineNormal
                _entryThermalMaxCharsPerLineNormal = new Entry();
                BOWidgetBox boxThermalMaxCharsPerLineNormal = new BOWidgetBox(Resx.global_printer_thermal_max_chars_per_line_normal, _entryThermalMaxCharsPerLineNormal);
                _vboxTab2.PackStart(boxThermalMaxCharsPerLineNormal, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalMaxCharsPerLineNormal, _dataSourceRow, "ThermalMaxCharsPerLineNormal", SettingsApp.RegexInteger, true));

                //ThermalMaxCharsPerLineNormalBold
                _entryThermalMaxCharsPerLineNormalBold = new Entry();
                BOWidgetBox boxThermalMaxCharsPerLineNormalBold = new BOWidgetBox(Resx.global_printer_thermal_max_chars_per_line_normal_bold, _entryThermalMaxCharsPerLineNormalBold);
                _vboxTab2.PackStart(boxThermalMaxCharsPerLineNormalBold, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalMaxCharsPerLineNormalBold, _dataSourceRow, "ThermalMaxCharsPerLineNormalBold", SettingsApp.RegexInteger, true));

                //ThermalMaxCharsPerLineSmall
                _entryThermalMaxCharsPerLineSmall = new Entry();
                BOWidgetBox boxThermalMaxCharsPerLineSmall = new BOWidgetBox(Resx.global_printer_thermal_max_chars_per_line_small, _entryThermalMaxCharsPerLineSmall);
                _vboxTab2.PackStart(boxThermalMaxCharsPerLineSmall, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalMaxCharsPerLineSmall, _dataSourceRow, "ThermalMaxCharsPerLineSmall", SettingsApp.RegexInteger, true));

                //ThermalEncoding
                _entryThermalEncoding = new Entry();
                BOWidgetBox boxThermalEncoding = new BOWidgetBox(Resx.global_printer_thermal_encoding, _entryThermalEncoding);
                //_vboxTab2.PackStart(boxThermalEncoding, false, false, 0);
                hbox1.PackStart(boxThermalEncoding, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalEncoding, _dataSourceRow, "ThermalEncoding", SettingsApp.RegexAlfaNumeric, false));

                //ThermalCutCommand
                _entryThermalCutCommand = new Entry();
                BOWidgetBox boxThermalCutCommand = new BOWidgetBox(Resx.global_printer_thermal_cut_command, _entryThermalCutCommand);
                //_vboxTab2.PackStart(boxThermalCutCommand, false, false, 0);
                hbox1.PackStart(boxThermalCutCommand, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalCutCommand, _dataSourceRow, "ThermalCutCommand", SettingsApp.RegexAlfaNumericExtended, false));

                // Pack hbox
                _vboxTab2.PackStart(hbox1, false, false, 0);

                //ThermalOpenDrawerValueM
                _entryThermalOpenDrawerValueM = new Entry();
                BOWidgetBox boxThermalOpenDrawerValueM = new BOWidgetBox(Resx.global_printer_thermal_open_drawer_value_m, _entryThermalOpenDrawerValueM);
                //_vboxTab2.PackStart(boxThermalOpenDrawerValueM, false, false, 0);
                hbox2.PackStart(boxThermalOpenDrawerValueM, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalOpenDrawerValueM, _dataSourceRow, "ThermalOpenDrawerValueM", SettingsApp.RegexAlfaNumericExtended, false));

                //ThermalOpenDrawerValueT1
                _entryThermalOpenDrawerValueT1 = new Entry();
                BOWidgetBox boxThermalOpenDrawerValueT1 = new BOWidgetBox(Resx.global_printer_thermal_open_drawer_value_t1, _entryThermalOpenDrawerValueT1);
                //_vboxTab2.PackStart(boxThermalOpenDrawerValueT1, false, false, 0);
                hbox2.PackStart(boxThermalOpenDrawerValueT1, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalOpenDrawerValueT1, _dataSourceRow, "ThermalOpenDrawerValueT1", SettingsApp.RegexAlfaNumericExtended, false));

                //ThermalOpenDrawerValueT2
                _entryThermalOpenDrawerValueT2 = new Entry();
                BOWidgetBox boxThermalOpenDrawerValueT2 = new BOWidgetBox(Resx.global_printer_thermal_open_drawer_value_t2, _entryThermalOpenDrawerValueT2);
                //_vboxTab2.PackStart(boxThermalOpenDrawerValueT2, false, false, 0);
                hbox2.PackStart(boxThermalOpenDrawerValueT2, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalOpenDrawerValueT2, _dataSourceRow, "ThermalOpenDrawerValueT2", SettingsApp.RegexAlfaNumericExtended, false));

                // Pack hbox
                _vboxTab2.PackStart(hbox2, false, false, 0);

                //ThermalPrintLogo
                _entryThermalImageCompanyLogo = new Entry();
                BOWidgetBox boxThermalImageCompanyLogo = new BOWidgetBox(Resx.global_printer_thermal_image_company_logo, _entryThermalImageCompanyLogo);
                _vboxTab2.PackStart(boxThermalImageCompanyLogo, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxThermalImageCompanyLogo, _dataSourceRow, "ThermalImageCompanyLogo", SettingsApp.RegexAlfaNumericFilePath, false));

                //ThermalPrintLogo
                CheckButton checkButtonThermalPrintLogo = new CheckButton(Resx.global_printer_thermal_print_logo);
                _vboxTab2.PackStart(checkButtonThermalPrintLogo, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonThermalPrintLogo, _dataSourceRow, "ThermalPrintLogo"));

                // Events
                _xpoComboBoxPrinterType.Changed += XpoComboBoxPrinterType_Changed;

                //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));
                _notebook.AppendPage(_vboxTab2, new Label(Resx.global_record_main_properties));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 27
0
        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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_description"), entryTaxDescription);
                vboxTab1.PackStart(boxTaxDescription, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxTaxDescription, _dataSourceRow, "TaxDescription", SettingsApp.RegexAlfaNumericExtended, true));

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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);
            }
        }
Exemplo n.º 28
0
        private void InitUI()
        {
            try
            {
                //Get XpoObject Reference from DataSourceRow
                //Template dataSourceRow = (DataSourceRow as Template);

                //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));

                //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));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                /* Tab2 Sample
                 *
                 * //Tab2
                 * VBox vboxTab2 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing };
                 *
                 * //Notes
                 * Entry entryNotes = new Entry();
                 * BOWidgetBox boxNotes = new BOWidgetBox(Resx.global_notes, entryNotes);
                 * vboxTab2.PackStart(boxNotes, false, false, 0);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxNotes, _dataSourceRow, "Notes", SettingsApp.RegexAlfa, false));
                 *
                 * //CreatedAt
                 * Entry entryCreatedAt = new Entry() { WidthRequest = 250 };
                 * BOWidgetBox boxCreatedAt = new BOWidgetBox(Resx.global_date, entryCreatedAt);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCreatedAt, _dataSourceRow, "CreatedAt", SettingsApp.RegexDateTime, false));
                 *
                 * //UpdatedAt
                 * Entry entryUpdatedAt = new Entry();
                 * BOWidgetBox boxUpdatedAt = new BOWidgetBox(Resx.global_date, entryUpdatedAt);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxUpdatedAt, _dataSourceRow, "UpdatedAt", SettingsApp.RegexDateTime, false));
                 *
                 * //Hbox CreatedAt and UpdatedAt
                 * HBox hboxCreatedAtAndUpdatedAt = new HBox(false, _boxSpacing);
                 * hboxCreatedAtAndUpdatedAt.PackStart(boxCreatedAt, true, true, 0);
                 * hboxCreatedAtAndUpdatedAt.PackStart(boxUpdatedAt, true, true, 0);
                 * vboxTab2.PackStart(hboxCreatedAtAndUpdatedAt, false, false, 0);
                 *
                 * //CreatedBy
                 * XPOComboBox xpoComboBoxCreatedBy = new XPOComboBox(DataSourceRow.Session, typeof(SYS_UserDetail), (DataSourceRow as FIN_ArticleClass).CreatedBy, "Name") { WidthRequest = 250 };
                 * BOWidgetBox boxCreatedBy = new BOWidgetBox(Resx.global_user, xpoComboBoxCreatedBy);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCreatedBy, DataSourceRow, "CreatedBy", SettingsApp.RegexGuid, true));
                 *
                 * //CreatedWhere
                 * XPOComboBox xpoComboBoxCreatedWhere = new XPOComboBox(DataSourceRow.Session, typeof(POS_ConfigurationPlaceTerminal), (DataSourceRow as FIN_ArticleClass).CreatedWhere, "Designation");
                 * BOWidgetBox boxCreatedWhere = new BOWidgetBox(Resx.global_terminal, xpoComboBoxCreatedWhere);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCreatedWhere, DataSourceRow, "CreatedWhere", SettingsApp.RegexGuid, true));
                 *
                 * //Hbox CreatedBy and CreatedWhere
                 * HBox hboxCreatedByAndCreatedWhere = new HBox(false, _boxSpacing);
                 * hboxCreatedByAndCreatedWhere.PackStart(boxCreatedBy, true, true, 0);
                 * hboxCreatedByAndCreatedWhere.PackStart(boxCreatedWhere, true, true, 0);
                 * vboxTab2.PackStart(hboxCreatedByAndCreatedWhere, false, false, 0);
                 *
                 * //ButtonImage
                 * FileChooserButton fileChooserButtonImage = new FileChooserButton(string.Empty, FileChooserAction.Open) { HeightRequest = 23 };
                 * Image fileChooserImagePreviewButtonImage = new Image() { WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height };
                 * Frame fileChooserFrameImagePreviewButtonImage = new Frame();
                 * fileChooserFrameImagePreviewButtonImage.ShadowType = ShadowType.None;
                 * fileChooserFrameImagePreviewButtonImage.Add(fileChooserImagePreviewButtonImage);
                 * fileChooserButtonImage.SetFilename(((FIN_ArticleFamily)DataSourceRow).ButtonImage);
                 * fileChooserButtonImage.Filter = Utils.GetFileFilterImages();
                 * fileChooserButtonImage.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewButtonImage.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewButtonImage.WidthRequest, fileChooserImagePreviewButtonImage.HeightRequest));
                 * BOWidgetBox boxfileChooserButtonImage = new BOWidgetBox(Resx.global_button_image, fileChooserButtonImage);
                 * HBox hboxfileChooserAndimagePreviewButtonImage = new HBox(false, _boxSpacing);
                 * hboxfileChooserAndimagePreviewButtonImage.PackStart(boxfileChooserButtonImage, true, true, 0);
                 * hboxfileChooserAndimagePreviewButtonImage.PackStart(fileChooserFrameImagePreviewButtonImage, false, false, 0);
                 * vboxTab1.PackStart(hboxfileChooserAndimagePreviewButtonImage, false, false, 0);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserButtonImage, _dataSourceRow, "ButtonImage", string.Empty, true));
                 *
                 * //Notes
                 * EntryMultiline entryMultilineNotes = new EntryMultiline();
                 * entryMultilineNotes.Value.Text = (DataSourceRow as FIN_Article).Notes;
                 * Label labelMultilineNotes = new Label(Resx.global_notes);
                 * vboxTab4.PackStart(entryMultilineNotes, true, true, 0);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(entryMultilineNotes, labelMultilineNotes, DataSourceRow, "Notes", SettingsApp.RegexAlfaNumericExtended, false));
                 *
                 * //Append Tab
                 * _notebook.AppendPage(vboxTab2, new Label(Resx.global_notes));
                 */

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                /* Events Sample
                 *
                 * //Capture Events
                 * //_crudWidgetList.BeforeUpdate += delegate { ShowEventOutput(); };
                 */
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 29
0
        private void InitUI()
        {
            try
            {
                //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));

                //PortName
                Entry       entryPortName = new Entry();
                BOWidgetBox boxPortName   = new BOWidgetBox(Resx.global_hardware_com_portname, entryPortName);
                vboxTab1.PackStart(boxPortName, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPortName, _dataSourceRow, "PortName", SettingsApp.RegexHardwarePortName, true));

                //BaudRate
                Entry       entryBaudRate = new Entry();
                BOWidgetBox boxBaudRate   = new BOWidgetBox(Resx.global_hardware_com_baudrate, entryBaudRate);
                vboxTab1.PackStart(boxBaudRate, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxBaudRate, _dataSourceRow, "BaudRate", SettingsApp.RegexHardwareBaudRate, true));

                //Parity
                Entry       entryParity = new Entry();
                BOWidgetBox boxParity   = new BOWidgetBox(Resx.global_hardware_com_parity, entryParity);
                vboxTab1.PackStart(boxParity, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxParity, _dataSourceRow, "Parity", SettingsApp.RegexHardwareParity, true));

                //StopBits
                Entry       entryStopBits = new Entry();
                BOWidgetBox boxStopBits   = new BOWidgetBox(Resx.global_hardware_com_stopbits, entryStopBits);
                vboxTab1.PackStart(boxStopBits, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxStopBits, _dataSourceRow, "StopBits", SettingsApp.RegexHardwareStopBits, true));

                //DataBits
                Entry       entryDataBits = new Entry();
                BOWidgetBox boxDataBits   = new BOWidgetBox(Resx.global_hardware_com_databits, entryDataBits);
                vboxTab1.PackStart(boxDataBits, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDataBits, _dataSourceRow, "DataBits", SettingsApp.RegexHardwareDataBits, 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));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Exemplo n.º 30
0
        private void InitUI()
        {
            try
            {
                //Init Local Vars
                _configurationCountry = (_dataSourceRow as erp_customer).Country;
                /* When customers already have a document issued to them, edit Fiscal Number field is not allowed */
                if (_dialogMode != DialogMode.Insert)
                {
                    _customer = (_dataSourceRow as erp_customer);

                    /* IN009249 - begin */
                    string customerFiscalNumberCrypto = GlobalFramework.PluginSoftwareVendor.Encrypt(_customer.FiscalNumber);
                    string countSQL = string.Format("EntityFiscalNumber = '{0}'", customerFiscalNumberCrypto);

                    var countResult = GlobalFramework.SessionXpo.Evaluate(typeof(fin_documentfinancemaster), CriteriaOperator.Parse("Count()"), CriteriaOperator.Parse(countSQL));
                    _totalNumberOfFinanceDocuments = Convert.ToUInt16(countResult);
                    /* IN009249 - end */

                    if (_customer.Oid == SettingsApp.XpoOidDocumentFinanceMasterFinalConsumerEntity)
                    {
                        _isFinalConsumerEntity = true;
                    }
                }

                //erp_customer customers = null;
                SortingCollection sortCollection = new SortingCollection();
                sortCollection.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));
                CriteriaOperator criteria            = CriteriaOperator.Parse(string.Format("(Disabled = 0 OR Disabled IS NULL)"));
                ICollection      collectionCustomers = GlobalFramework.SessionXpo.GetObjects(GlobalFramework.SessionXpo.GetClassInfo(typeof(erp_customer)), criteria, sortCollection, int.MaxValue, false, true);

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), entryCode);
                vboxTab1.PackStart(boxCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true));

                //FiscalNumber
                _entryFiscalNumber = new Entry();
                BOWidgetBox boxFiscalNumber = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_number"), _entryFiscalNumber);
                vboxTab1.PackStart(boxFiscalNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFiscalNumber, _dataSourceRow, "FiscalNumber", _configurationCountry.RegExFiscalNumber, true));/* IN009061 */

                //Name
                _entryName = new Entry();
                BOWidgetBox boxName = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_name"), _entryName);
                vboxTab1.PackStart(boxName, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxName, _dataSourceRow, "Name", SettingsApp.RegexAlfaNumericPlus, true));/* IN009253 */

                //Discount
                Entry       entryDiscount = new Entry();
                BOWidgetBox boxDiscount   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_discount"), entryDiscount);
                vboxTab1.PackStart(boxDiscount, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscount, _dataSourceRow, "Discount", SettingsApp.RegexPercentage, true));

                //PriceType IN:009261
                XPOComboBox xpoComboBoxPriceType = new XPOComboBox(DataSourceRow.Session, typeof(fin_configurationpricetype), (DataSourceRow as erp_customer).PriceType, "Designation", null, null, 1);
                BOWidgetBox boxPriceType         = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_price_type"), xpoComboBoxPriceType);
                vboxTab1.PackStart(boxPriceType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPriceType, DataSourceRow, "PriceType", SettingsApp.RegexGuid, true));

                //CustomerType IN009261
                SortProperty[] sortPropertyCostumerType = new SortProperty[1];
                sortPropertyCostumerType[0] = new SortProperty("Designation", SortingDirection.Descending);

                _xpoComboBoxCustomerType = new XPOComboBox(DataSourceRow.Session, typeof(erp_customertype), (DataSourceRow as erp_customer).CustomerType, "Designation", null, sortPropertyCostumerType, 1);
                BOWidgetBox boxCustomerType = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_customer_types"), _xpoComboBoxCustomerType);
                vboxTab1.PackStart(boxCustomerType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCustomerType, DataSourceRow, "CustomerType", SettingsApp.RegexGuid, true));

                ////DISABLED : DiscountGroup
                //XPOComboBox xpoComboBoxDiscountGroup = new XPOComboBox(DataSourceRow.Session, typeof(erp_customerdiscountgroup), (DataSourceRow as erp_customer).DiscountGroup, "Designation");
                //BOWidgetBox boxDiscountGroup = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_discount_group, xpoComboBoxDiscountGroup);
                //vboxTab1.PackStart(boxDiscountGroup, false, false, 0);
                //_crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDiscountGroup, DataSourceRow, "DiscountGroup", SettingsApp.RegexGuid, true));

                //Supplier
                CheckButton checkButtonSupplier = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_supplier"));
                vboxTab1.PackStart(checkButtonSupplier, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonSupplier, _dataSourceRow, "Supplier"));

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                //Tab2

                VBox vboxTab2 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Address
                _entryAddress = new Entry();
                BOWidgetBox boxAddress = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_address"), _entryAddress);
                vboxTab2.PackStart(boxAddress, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAddress, _dataSourceRow, "Address", SettingsApp.RegexAlfaNumericPlus, false));/* IN009253 */

                //Locality
                _entryLocality = new Entry();
                BOWidgetBox boxLocality = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_locality"), _entryLocality);
                vboxTab2.PackStart(boxLocality, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLocality, _dataSourceRow, "Locality", SettingsApp.RegexAlfaNumericPlus, false));/* IN009253 */

                //ZipCode
                _entryZipCode = new Entry()
                {
                    WidthRequest = 100
                };;
                BOWidgetBox boxZipCode = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_zipcode"), _entryZipCode);
                vboxTab2.PackStart(boxZipCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxZipCode, _dataSourceRow, "ZipCode", _configurationCountry.RegExZipCode, false));

                //City
                _entryCity = new Entry();
                BOWidgetBox boxCity = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_city"), _entryCity);
                vboxTab2.PackStart(boxCity, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCity, _dataSourceRow, "City", SettingsApp.RegexAlfaNumericPlus, false)); /* IN009176, IN009253 */

                //Hbox ZipCode and City
                HBox hboxZipCodeAndCity = new HBox(false, _boxSpacing);
                hboxZipCodeAndCity.PackStart(boxZipCode, true, true, 0);
                hboxZipCodeAndCity.PackStart(boxCity, true, true, 0);
                vboxTab2.PackStart(hboxZipCodeAndCity, false, false, 0);

                //CountrySortProperty
                SortProperty[] sortPropertyCountry = new SortProperty[1];
                sortPropertyCountry[0] = new SortProperty("Designation", SortingDirection.Ascending);
                //Country
                _xpoComboBoxCountry = new XPOComboBox(DataSourceRow.Session, typeof(cfg_configurationcountry), (DataSourceRow as erp_customer).Country, "Designation", null, sortPropertyCountry);
                BOWidgetBox boxCountry = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_country"), _xpoComboBoxCountry);
                vboxTab2.PackStart(boxCountry, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCountry, DataSourceRow, "Country", SettingsApp.RegexGuid, true));

                //Phone
                Entry       entryPhone = new Entry();
                BOWidgetBox boxPhone   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_phone"), entryPhone);
                vboxTab2.PackStart(boxPhone, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPhone, _dataSourceRow, "Phone", SettingsApp.RegexAlfaNumericExtended, false));

                //MobilePhone
                Entry       entryMobilePhone = new Entry();
                BOWidgetBox boxMobilePhone   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_mobile_phone"), entryMobilePhone);
                vboxTab2.PackStart(boxMobilePhone, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxMobilePhone, _dataSourceRow, "MobilePhone", SettingsApp.RegexAlfaNumericExtended, false));

                //Hbox Phone and MobilePhone
                HBox hboxPhoneAndMobilePhone = new HBox(false, _boxSpacing);
                hboxPhoneAndMobilePhone.PackStart(boxPhone, true, true, 0);
                hboxPhoneAndMobilePhone.PackStart(boxMobilePhone, true, true, 0);
                vboxTab2.PackStart(hboxPhoneAndMobilePhone, false, false, 0);

                //Fax
                Entry       entryFax = new Entry();
                BOWidgetBox boxFax   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fax"), entryFax);
                vboxTab2.PackStart(boxFax, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFax, _dataSourceRow, "Fax", SettingsApp.RegexAlfaNumericExtended, false));

                //Email
                Entry       entryEmail = new Entry();
                BOWidgetBox boxEmail   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_email"), entryEmail);
                vboxTab2.PackStart(boxEmail, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxEmail, _dataSourceRow, "Email", SettingsApp.RegexEmail, false));

                //Hbox Fax and Email
                HBox hboxFaxAndEmail = new HBox(false, _boxSpacing);
                hboxFaxAndEmail.PackStart(boxFax, true, true, 0);
                hboxFaxAndEmail.PackStart(boxEmail, true, true, 0);
                vboxTab2.PackStart(hboxFaxAndEmail, false, false, 0);

                //Append Tab
                _notebook.AppendPage(vboxTab2, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_contacts")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                //Tab3

                VBox vboxTab3 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //CardNumber
                Entry       entryCardNumber = new Entry();
                BOWidgetBox boxCardNumber   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_card_number"), entryCardNumber);
                vboxTab3.PackStart(boxCardNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCardNumber, _dataSourceRow, "CardNumber", SettingsApp.RegexAlfaNumericExtended, false));

                //CardCredit
                Entry       entryCardCredit = new Entry();
                BOWidgetBox boxCardCredit   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_card_credit_amount"), entryCardCredit);
                vboxTab3.PackStart(boxCardCredit, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCardCredit, _dataSourceRow, "CardCredit", SettingsApp.RegexDecimalGreaterEqualThanZero, false));

                //DateOfBirth
                Entry       entryDateOfBirth = new Entry();
                BOWidgetBox boxDateOfBirth   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_dob"), entryDateOfBirth);
                vboxTab3.PackStart(boxDateOfBirth, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDateOfBirth, _dataSourceRow, "DateOfBirth", SettingsApp.RegexDate, false));

                //Append Tab
                _notebook.AppendPage(vboxTab3, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_others")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                _entryName.Sensitive          = GetEntryNameSensitiveValue();
                entryCardCredit.Sensitive     = false;
                _entryFiscalNumber.Sensitive  = GetEntryFiscalNumberSensitiveValue();
                _xpoComboBoxCountry.Sensitive = GetEntryFiscalNumberSensitiveValue();

                //Get References to GenericCRUDWidgetXPO
                _genericCRUDWidgetXPOFiscalNumber = (_crudWidgetList.GetFieldWidget("FiscalNumber") as GenericCRUDWidgetXPO);
                _genericCRUDWidgetXPOZipCode      = (_crudWidgetList.GetFieldWidget("ZipCode") as GenericCRUDWidgetXPO);
                //Call Validation
                _genericCRUDWidgetXPOFiscalNumber.ValidateField(ValidateFiscalNumberFunc);

                //Update Components
                UpdateCountryRegExComponents();
                //string teste = (DataSourceRow as erp_customer).CustomerType.Designation;
                //Events
                _entryFiscalNumber.Changed  += delegate { ValidateFiscalNumber(); };
                _xpoComboBoxCountry.Changed += delegate { UpdateCountryRegExComponents(); };
                //IN009260 Inserir Cliente permite código já inserido
                entryCode.FocusOutEvent += delegate
                {
                    foreach (erp_customer item in collectionCustomers)
                    {
                        if (entryCode.Text == item.Code.ToString())
                        {
                            Utils.ShowMessageTouch(GlobalApp.WindowBackOffice, DialogFlags.DestroyWithParent | DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_validation_error"), resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "dialog_message_code_number_exists"));
                            entryCode.Text = "";
                        }
                    }
                };

                entryOrd.FocusOutEvent += delegate
                {
                    foreach (erp_customer item in collectionCustomers)
                    {
                        if (entryOrd.Text == item.Code.ToString())
                        {
                            Utils.ShowMessageTouch(GlobalApp.WindowBackOffice, DialogFlags.DestroyWithParent | DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_validation_error"), resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "dialog_message_code_number_exists"));
                            entryOrd.Text = "";
                        }
                    }
                };
            }
            catch (System.Exception ex)
            {
                _log.Error("void DialogCustomer.InitUI(): " + ex.Message, ex);
            }
        }