Example #1
0
        public DocumentFinanceDialogPage3(Window pSourceWindow, String pPageName, String pPageIcon, Widget pWidget, bool pEnabled = true)
            : base(pSourceWindow, pPageName, pPageIcon, pWidget, pEnabled)
        {
            //Init private vars
            _pagePad = (_sourceWindow as PosDocumentFinanceDialog).PagePad;
            _session = (_pagePad as DocumentFinanceDialogPagePad).Session;
            _posDocumentFinanceDialog = (_sourceWindow as PosDocumentFinanceDialog);

            //Init Tree
            _treeViewArticles = new TreeViewDocumentFinanceArticle(
                pSourceWindow,
                null, //DefaultValue
                null, //DialogType
                GenericTreeViewMode.Default,
                GenericTreeViewNavigatorMode.Default
                );

            //Settings
            string fontGenericTreeViewFinanceDocumentArticleColumnTitle = GlobalFramework.Settings["fontGenericTreeViewFinanceDocumentArticleColumnTitle"];
            string fontGenericTreeViewFinanceDocumentArticleColumn      = GlobalFramework.Settings["fontGenericTreeViewFinanceDocumentArticleColumn"];

            //Format Columns FontSizes for Touch
            _treeViewArticles.FormatColumnPropertiesForTouch(fontGenericTreeViewFinanceDocumentArticleColumnTitle, fontGenericTreeViewFinanceDocumentArticleColumn);
            //Disable View Button
            _treeViewArticles.Navigator.ButtonView.Sensitive = false;

            PackStart(_treeViewArticles);

            //Events
            _treeViewArticles.RecordAfterInsert += delegate
            {
                //FORCE Assign FriendlyId to Designation
                FIN_Article article = (_treeViewArticles.DataSourceRow["Article.Code"] as FIN_Article);
                treeViewArticlesRecordAfterChange();
            };
            _treeViewArticles.RecordAfterDelete += delegate { treeViewArticlesRecordAfterChange(); };
            _treeViewArticles.RecordAfterUpdate += delegate { treeViewArticlesRecordAfterChange(); };
        }
Example #2
0
        public DocumentFinanceDialogPage5(Window pSourceWindow, String pPageName, String pPageIcon, Widget pWidget, bool pEnabled = true)
            : base(pSourceWindow, pPageName, pPageIcon, pWidget, pEnabled)
        {
            //Init private vars
            _pagePad = (_sourceWindow as PosDocumentFinanceDialog).PagePad;
            _session = (_pagePad as DocumentFinanceDialogPagePad).Session;

            //Initials Values
            _intialValueConfigurationCountry = SettingsApp.ConfigurationSystemCountry;

            //ShipFrom Address
            _entryBoxShipFromAddressDetail = new EntryBoxValidation(_sourceWindow, Resx.global_address, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, true);
            _entryBoxShipFromAddressDetail.EntryValidation.Changed += delegate { Validate(); };

            //ShipFrom Region
            _entryBoxShipFromRegion = new EntryBoxValidation(_sourceWindow, Resx.global_region, KeyboardMode.Alfa, SettingsApp.RegexAlfa, false);
            _entryBoxShipFromRegion.EntryValidation.Changed += delegate { Validate(); };

            //ShipFrom PostalCode
            _entryBoxShipFromPostalCode = new EntryBoxValidation(_sourceWindow, Resx.global_zipcode, KeyboardMode.Alfa, SettingsApp.ConfigurationSystemCountry.RegExZipCode, true);
            _entryBoxShipFromPostalCode.EntryValidation.Changed += delegate { Validate(); };

            //ShipFrom City
            _entryBoxShipFromCity = new EntryBoxValidation(_sourceWindow, Resx.global_city, KeyboardMode.Alfa, SettingsApp.RegexAlfa, true);
            _entryBoxShipFromCity.EntryValidation.Changed += delegate { Validate(); };

            //ShipFrom Country
            CriteriaOperator criteriaOperatorCustomerCountry = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");

            _entryBoxSelectShipFromCountry = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCountry, TreeViewConfigurationCountry>(_sourceWindow, Resx.global_country, "Designation", "Oid", _intialValueConfigurationCountry, criteriaOperatorCustomerCountry, SettingsApp.RegexGuid, true);
            _entryBoxSelectShipFromCountry.EntryValidation.IsEditable = false;
            _entryBoxSelectShipFromCountry.EntryValidation.Changed   += delegate { Validate(); };
            _entryBoxSelectShipFromCountry.ClosePopup += delegate
            {
                //Require to Update RegExZipCode
                _entryBoxShipFromPostalCode.EntryValidation.Rule = _entryBoxSelectShipFromCountry.Value.RegExZipCode;
                _entryBoxShipFromPostalCode.EntryValidation.Validate();
            };

            //ShipFromDeliveryDate
            _entryBoxShipFromDeliveryDate = new EntryBoxValidationDatePickerDialog(_sourceWindow, Resx.global_ship_from_delivery_date, _pagePad.DateTimeFormat, _pagePad.InitalDateTime, KeyboardMode.AlfaNumeric, SettingsApp.RegexDateTime, true, _pagePad.DateTimeFormat);
            _entryBoxShipFromDeliveryDate.EntryValidation.Sensitive = true;
            _entryBoxShipFromDeliveryDate.EntryValidation.Text      = FrameworkUtils.DateTimeToString(FrameworkUtils.CurrentDateTimeAtomic()).ToString();
            _entryBoxShipFromDeliveryDate.EntryValidation.Validate();
            //Assign Min Date to Validation
            _entryBoxShipFromDeliveryDate.DateTimeMin              = FrameworkUtils.CurrentDateTimeAtomic();
            _entryBoxShipFromDeliveryDate.EntryValidation.Changed += _entryBoxShipFromDeliveryDate_ClosePopup;
            _entryBoxShipFromDeliveryDate.ClosePopup += _entryBoxShipFromDeliveryDate_ClosePopup;

            //ShipFromDeliveryID
            _entryBoxShipFromDeliveryID = new EntryBoxValidation(_sourceWindow, Resx.global_ship_from_delivery_id, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            _entryBoxShipFromDeliveryID.EntryValidation.Changed += delegate { Validate(); };

            //ShipFromWarehouseID
            _entryBoxShipFromWarehouseID = new EntryBoxValidation(_sourceWindow, Resx.global_ship_from_warehouse_id, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            _entryBoxShipFromWarehouseID.EntryValidation.MaxLength = 50;
            _entryBoxShipFromWarehouseID.EntryValidation.Changed  += delegate { Validate(); };

            //ShipFromLocationID
            _entryBoxShipFromLocationID = new EntryBoxValidation(_sourceWindow, Resx.global_ship_from_location_id, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            _entryBoxShipFromLocationID.EntryValidation.MaxLength = 30;
            _entryBoxShipFromLocationID.EntryValidation.Changed  += delegate { Validate(); };

            //HBox hboxDeliveryDate+DeliveryID
            HBox hboxDeliveryDateAndDeliveryID = new HBox(true, 0);

            hboxDeliveryDateAndDeliveryID.PackStart(_entryBoxShipFromDeliveryDate, true, true, 0);
            hboxDeliveryDateAndDeliveryID.PackStart(_entryBoxShipFromDeliveryID, true, true, 0);

            //HBox ZipCode+City+Country
            HBox hboxZipCodeAndCityAndCountry = new HBox(true, 0);

            hboxZipCodeAndCityAndCountry.PackStart(_entryBoxShipFromPostalCode, true, true, 0);
            hboxZipCodeAndCityAndCountry.PackStart(_entryBoxShipFromCity, true, true, 0);
            hboxZipCodeAndCityAndCountry.PackStart(_entryBoxSelectShipFromCountry, true, true, 0);

            //HBox hboxWarehouseID+LocationID
            HBox hboxhboxWarehouseIDAndLocationID = new HBox(true, 0);

            hboxhboxWarehouseIDAndLocationID.PackStart(_entryBoxShipFromWarehouseID, true, true, 0);
            hboxhboxWarehouseIDAndLocationID.PackStart(_entryBoxShipFromLocationID, true, true, 0);

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

            vbox.PackStart(_entryBoxShipFromAddressDetail, false, false, 0);
            vbox.PackStart(_entryBoxShipFromRegion, false, false, 0);
            vbox.PackStart(hboxZipCodeAndCityAndCountry, false, false, 0);
            vbox.PackStart(hboxDeliveryDateAndDeliveryID, false, false, 0);
            vbox.PackStart(hboxhboxWarehouseIDAndLocationID, false, false, 0);
            PackStart(vbox);
        }
Example #3
0
        public DocumentFinanceDialogPage8(Window pSourceWindow, String pPageName, String pPageIcon, Widget pWidget, bool pEnabled = true)
            : base(pSourceWindow, pPageName, pPageIcon, pWidget, pEnabled)
        {
            //Init private vars
            _pagePad        = (_sourceWindow as PosDocumentFinanceDialog).PagePad;
            _session        = (_pagePad as DocumentFinanceDialogPagePad).Session;
            _crudWidgetList = new GenericCRUDWidgetListXPO(_session);

            //Get Target Object
            //Guid customerGuid = new Guid("0cf40622-578b-417d-b50f-e945fefb5d68");//Consumidor Final|0.0
            Guid customerGuid = new Guid("765859cc-29c2-4925-be89-0486d03684f2");//Carlos Fernandes|5.0

            //Guid customerGuid = new Guid("78c08879-6d08-4146-9cc9-914f427926c6");//Cristina Janeiro|12.5
            _valueCustomer = (erp_customer)FrameworkUtils.GetXPGuidObject(_session, typeof(erp_customer), customerGuid);

            //Client (Used in _crudWidgetList)
            _entryBoxClient = new EntryBoxValidation(_sourceWindow, string.Format("{0}/WL", resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_customer")), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, true);
            _entryBoxClient.EntryValidation.Changed += delegate { Validate(); };
            _entryBoxClientValidation = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_customer"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, true);
            _entryBoxClientValidation.EntryValidation.Changed += delegate { Validate(); };
            //FiscalNumber
            _entryBoxFiscalNumber = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_number"), KeyboardMode.Alfa, _valueCustomer.Country.RegExFiscalNumber, true);
            _entryBoxFiscalNumber.EntryValidation.Changed += delegate { /*ValidateFiscalNumber();*/ Validate(); };
            //Address
            _entryBoxAddress = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_address"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            //_entryBoxAddress.WidthRequest = _pagePad.EntryBoxMaxWidth;
            _entryBoxAddress.EntryValidation.Changed += delegate { Validate(); };
            //Locality
            _entryBoxLocality = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_locality"), KeyboardMode.Alfa, SettingsApp.RegexAlfa, false);
            //_entryBoxLocality.WidthRequest = _pagePad.EntryBoxMaxWidth;
            _entryBoxLocality.EntryValidation.Changed += delegate { Validate(); };
            //ZipCode
            _entryBoxZipCode = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_zipcode"), KeyboardMode.Alfa, _valueCustomer.Country.RegExZipCode, false);
            _entryBoxZipCode.WidthRequest             = 200;
            _entryBoxZipCode.EntryValidation.Changed += delegate { Validate(); };
            //City
            _entryBoxCity = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_city"), KeyboardMode.Alfa, SettingsApp.RegexAlfa, false);
            //_entryBoxCity.WidthRequest = _pagePad.EntryBoxMaxWidth - 200;
            _entryBoxCity.EntryValidation.Changed += delegate { Validate(); };

            //Country (Used in _crudWidgetList)
            CriteriaOperator criteriaOperator = CriteriaOperator.Parse("CurrencyCode = 'EUR'");

            _entryBoxSelectCountry = new XPOEntryBoxSelectRecord <cfg_configurationcountry, TreeViewConfigurationCountry>(_sourceWindow, string.Format("{0}/WL", resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_country")), "Designation", "Oid", _valueCustomer.Country, criteriaOperator);
            //_entryBoxSelectCountry.WidthRequest = _pagePad.EntryBoxMaxWidth;
            _entryBoxSelectCountry.Entry.IsEditable = false;
            //CountryValidation
            _entryBoxSelectCountryValidation = new XPOEntryBoxSelectRecordValidation <cfg_configurationcountry, TreeViewConfigurationCountry>(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_country"), "Designation", "Oid", _valueCustomer.Country, criteriaOperator, SettingsApp.RegexGuid, true);
            //_entryBoxSelectCountryValidation.WidthRequest = _pagePad.EntryBoxMaxWidth;
            _entryBoxSelectCountryValidation.EntryValidation.IsEditable = false;
            //Test _selectedXPGuidObject :)
            //_entryBoxSelectCountryValidation.EntryValidation.Changed += delegate {
            //  _log.Debug(string.Format("_entryBoxCountryValidation.Selected.Code3: [{0}]", _entryBoxSelectCountryValidation.Value.Code3));
            //};

            //Notes
            _entryBoxNotes = new EntryBoxValidation(_sourceWindow, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false);
            //_entryBoxNotes.WidthRequest = _pagePad.EntryBoxMaxWidth;
            _entryBoxNotes.EntryValidation.Changed += delegate { Validate(); };

            ////OPTIONAL: REQUIRE Assign Values TO Work On NON XpoWidget Mode ELSE Leave Blanck and XPOWidget Init Will fill Initial Values
            //_entryBoxClient.Entry.Text = xCustomer.Name;
            _entryBoxClientValidation.EntryValidation.Text = _valueCustomer.Name;
            ////Assign Value First
            //_entryBoxCountry.Value = xCustomer.Country;
            //_entryBoxCountry.Entry.Text = xCustomer.Country.Designation;
            ////Assign Value First
            //_entryBoxCountryValidation.Value = xCustomer.Country;
            //_entryBoxCountryValidation.EntryValidation.Text = xCustomer.Country.Designation;

            //Using Labels ;)
            GenericCRUDWidget <XPGuidObject> crudWidgetClientName    = new GenericCRUDWidgetXPO(_entryBoxClient, _entryBoxClient.Label, _valueCustomer, "Name", SettingsApp.RegexAlfaNumericExtended, true);
            GenericCRUDWidget <XPGuidObject> crudWidgetClientCountry = new GenericCRUDWidgetXPO(_entryBoxSelectCountry, _entryBoxSelectCountry.Label, _valueCustomer, "Country", SettingsApp.RegexGuid, true);

            _crudWidgetList.Add(crudWidgetClientName);
            _crudWidgetList.Add(crudWidgetClientCountry);

            Button button = new Button("VALIDATE & UpdateRecord");

            button.Clicked += delegate
            {
                if (_crudWidgetList.ValidateRecord())
                {
                    //Using WidgetList
                    _crudWidgetList.UpdateRecord(DialogMode.Update);
                }
            };

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

            vbox.PackStart(_entryBoxClient, false, false, 0);
            vbox.PackStart(_entryBoxClientValidation, false, false, 0);
            vbox.PackStart(_entryBoxSelectCountry, false, false, 0);
            vbox.PackStart(_entryBoxSelectCountryValidation, false, false, 0);
            vbox.PackStart(button, true, true, 0);
            PackStart(vbox);
        }