Пример #1
0
        //XpoMode
        public TreeViewDocumentFinanceType(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default)
        {
            //Init Vars
            Type xpoGuidObjectType = typeof(fin_documentfinancetype);
            //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView
            fin_documentfinancetype defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_documentfinancetype : null;
            //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView
            Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogDocumentFinanceType);

            //Configure columnProperties
            List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>();

            columnProperties.Add(new GenericTreeViewColumnProperty("Code")
            {
                Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), MinWidth = 100
            });
            columnProperties.Add(new GenericTreeViewColumnProperty("Designation")
            {
                Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), Expand = true
            });
            columnProperties.Add(new GenericTreeViewColumnProperty("Acronym")
            {
                Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_acronym")
            });
            columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt")
            {
                Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_date_updated"), MinWidth = 150, MaxWidth = 150
            });

            //Configure Criteria/XPCollection/Model
            CriteriaOperator criteria = (ReferenceEquals(pXpoCriteria, null)) ? null : pXpoCriteria;

            SortProperty[] sortProperty = new SortProperty[1];
            sortProperty[0] = new SortProperty("Designation", SortingDirection.Ascending);
            XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria);

            //Call Base Initializer
            base.InitObject(
                pSourceWindow,                 //Pass parameter
                defaultValue,                  //Pass parameter
                pGenericTreeViewMode,          //Pass parameter
                pGenericTreeViewNavigatorMode, //Pass parameter
                columnProperties,              //Created Here
                xpoCollection,                 //Created Here
                typeDialogClass                //Created Here
                );
        }
Пример #2
0
 public ThermalPrinterBaseFinanceTemplate(sys_configurationprinters pPrinter, fin_documentfinancetype pDocumentType, List <int> pCopyNames)
     : this(pPrinter, pDocumentType, pCopyNames, false)
 {
 }
Пример #3
0
        private void InitUI1()
        {
            //EntryBoxValidation with KeyBoard Input
            EntryBoxValidation entryBoxValidation = new EntryBoxValidation(this, "EntryBoxValidation", KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, true);

            entryBoxValidation.EntryValidation.Sensitive = false;
            entryBoxValidation.ButtonKeyBoard.Sensitive  = false;
            _vbox.PackStart(entryBoxValidation, true, true, _padding);

            //EntryBoxValidation with KeyBoard Input and Custom Buttons : Start without KeyBoard, and KeyBoard Button After all Others
            _entryBoxValidationCustomButton1 = new EntryBoxValidation(this, "EntryBoxValidationCustomButton", KeyboardMode.None, SettingsApp.RegexAlfaNumericExtended, false);
            TouchButtonIcon customButton1 = _entryBoxValidationCustomButton1.AddButton("CustomButton1", @"Icons/Windows/icon_window_orders.png");
            TouchButtonIcon customButton2 = _entryBoxValidationCustomButton1.AddButton("CustomButton2", @"Icons/Windows/icon_window_pay_invoice.png");
            TouchButtonIcon customButton3 = _entryBoxValidationCustomButton1.AddButton("CustomButton3", @"Icons/Windows/icon_window_orders.png");

            //Now we manually Init Keyboard
            _entryBoxValidationCustomButton1.EntryValidation.KeyboardMode = KeyboardMode.AlfaNumeric;
            _entryBoxValidationCustomButton1.InitKeyboard(_entryBoxValidationCustomButton1.EntryValidation);
            //Test Required Rule
            customButton1.Clicked += customButton1_Clicked;
            customButton2.Clicked += customButton2_Clicked;
            customButton3.Clicked += customSharedButton_Clicked;
            _vbox.PackStart(_entryBoxValidationCustomButton1, true, true, _padding);

            //EntryBoxValidationButton
            EntryBoxValidationButton entryBoxValidationButton = new EntryBoxValidationButton(this, "EntryBoxValidationButton", KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true);

            entryBoxValidationButton.Button.Clicked += customSharedButton_Clicked;
            _vbox.PackStart(entryBoxValidationButton, true, true, _padding);

            //Test XPOEntryBoxSelectRecordValidation without KeyBoard Input
            fin_documentfinancetype defaultValueDocumentFinanceType     = (fin_documentfinancetype)FrameworkUtils.GetXPGuidObject(GlobalFramework.SessionXpo, typeof(fin_documentfinancetype), SettingsApp.XpoOidDocumentFinanceTypeInvoice);
            CriteriaOperator        criteriaOperatorDocumentFinanceType = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");
            XPOEntryBoxSelectRecordValidation <fin_documentfinancetype, TreeViewDocumentFinanceType> entryBoxSelectDocumentFinanceType = new XPOEntryBoxSelectRecordValidation <fin_documentfinancetype, TreeViewDocumentFinanceType>(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinanceseries_documenttype"), "Designation", "Oid", defaultValueDocumentFinanceType, criteriaOperatorDocumentFinanceType, SettingsApp.RegexGuid, true);

            //entryBoxSelectDocumentFinanceType.EntryValidation.IsEditable = false;
            entryBoxSelectDocumentFinanceType.ClosePopup += delegate { };
            _vbox.PackStart(entryBoxSelectDocumentFinanceType, true, true, _padding);

            //Test XPOEntryBoxSelectRecordValidation with KeyBoard Input
            CriteriaOperator criteriaOperatorXPOEntryBoxSelectRecordValidationTextMode = null;

            _xPOEntryBoxSelectRecordValidationTextMode = new XPOEntryBoxSelectRecordValidation <erp_customer, TreeViewCustomer>(this, "XPOEntryBoxSelectRecordValidationTextMode", "Name", "Name", null, criteriaOperatorXPOEntryBoxSelectRecordValidationTextMode, KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, false);
            //_xPOEntryBoxSelectRecordValidationTextMode.EntryValidation.Sensitive = false;
            //Start Disabled
            //_xPOEntryBoxSelectRecordValidationTextMode.ButtonKeyBoard.Sensitive = false;
            _xPOEntryBoxSelectRecordValidationTextMode.ClosePopup += delegate { };
            _vbox.PackStart(_xPOEntryBoxSelectRecordValidationTextMode, true, true, _padding);

            //Test XPOEntryBoxSelectRecordValidation without KeyBoard Input / Guid
            CriteriaOperator criteriaOperatorXPOEntryBoxSelectRecordValidationGuidMode = null;
            XPOEntryBoxSelectRecordValidation <erp_customer, TreeViewCustomer> xPOEntryBoxSelectRecordValidationGuidMode = new XPOEntryBoxSelectRecordValidation <erp_customer, TreeViewCustomer>(this, "XPOEntryBoxSelectRecordValidationGuidMode", "Name", "Oid", null, criteriaOperatorXPOEntryBoxSelectRecordValidationGuidMode, KeyboardMode.None, SettingsApp.RegexGuid, true);

            _xPOEntryBoxSelectRecordValidationTextMode.ClosePopup += delegate { };
            _vbox.PackStart(xPOEntryBoxSelectRecordValidationGuidMode, true, true, _padding);

            //Test DateTime Picker
            DateTime initalDateTime = DateTime.Now;
            EntryBoxValidationDatePickerDialog entryBoxShipToDeliveryDate = new EntryBoxValidationDatePickerDialog(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ship_to_delivery_date"), "dateFormat", DateTime.Now, SettingsApp.RegexDate, true, SettingsApp.DateFormat);

            //entryBoxShipToDeliveryDate.EntryValidation.Sensitive = true;
            entryBoxShipToDeliveryDate.EntryValidation.Text = initalDateTime.ToString(SettingsApp.DateFormat);

            //entryBoxShipToDeliveryDate.EntryValidation.Validate();
            //entryBoxShipToDeliveryDate.ClosePopup += delegate { };
            _vbox.PackStart(entryBoxShipToDeliveryDate, true, true, _padding);

            //Test DateTime Picker with KeyBoard
            EntryBoxValidationDatePickerDialog entryBoxShipToDeliveryDateKeyboard = new EntryBoxValidationDatePickerDialog(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ship_to_delivery_date"), SettingsApp.DateTimeFormat, DateTime.Now, KeyboardMode.AlfaNumeric, SettingsApp.RegexDateTime, true, SettingsApp.DateTimeFormat);

            entryBoxShipToDeliveryDateKeyboard.EntryValidation.Sensitive = false;
            entryBoxShipToDeliveryDateKeyboard.ButtonKeyBoard.Sensitive  = false;
            //entryBoxShipToDeliveryDate.EntryValidation.Sensitive = true;
            entryBoxShipToDeliveryDateKeyboard.EntryValidation.Text = initalDateTime.ToString(SettingsApp.DateTimeFormat);
            _vbox.PackStart(entryBoxShipToDeliveryDateKeyboard, true, true, _padding);

            //Simple ListView
            List <string> itemList = new List <string>();

            itemList.Add("Looking for Kiosk mode in Android Lollipop 5.0");
            itemList.Add("Think of a hypothetical ATM machine that is running Android");
            itemList.Add("In this article we provide a brief overview of how");
            itemList.Add("Kiosk Mode can be implemented without any modifications");
            itemList.Add("The Home key brings you back to the Home screen");

            //ListComboBox
            ListComboBox listComboBox = new ListComboBox(itemList, itemList[3]);

            _vbox.PackStart(listComboBox, true, true, _padding);

            //ListComboBoxTouch
            ListComboBoxTouch listComboBoxTouch = new ListComboBoxTouch(this, "ListComboBoxTouch (Todo: Highlight Validation in Component)", itemList, itemList[4]);

            _vbox.PackStart(listComboBoxTouch, true, true, _padding);

            //EntryMultiline entryTouchMultiline = new EntryMultiline(this, KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true, 100, 10);
            //vbox.PackStart(entryTouchMultiline, true, true, padding);
            EntryBoxValidationMultiLine entryBoxMultiLine = new EntryBoxValidationMultiLine(this, "EntryBoxMultiLine", KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true, 18, 6)
            {
                HeightRequest = 200
            };

            //Start Disabled
            entryBoxMultiLine.EntryMultiline.Sensitive = false;
            entryBoxMultiLine.ButtonKeyBoard.Sensitive = false;
            _vbox.PackStart(entryBoxMultiLine, true, true, _padding);


            /*
             * ListRadioButtonTouch listRadioButtonTouch = new ListRadioButtonTouch(this, "Label", itemList, itemList[4]);
             * _fixedContent.Put(listRadioButtonTouch, 100, 320);
             *
             * string initialShipFromDeliveryDate = FrameworkUtils.CurrentDateTimeAtomic().ToString(SettingsApp.DateFormat);
             * //EntryBoxValidationButton entryBoxDate = new EntryBoxValidationButton(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ship_from_delivery_date, KeyboardModes.Alfa, regexDate, false);
             * //entryBoxDate.EntryValidation.Text = initialShipFromDeliveryDate;
             * //entryBoxDate.EntryValidation.Validate();
             *
             * EntryBoxValidationDatePickerDialog entryBoxDate = new EntryBoxValidationDatePickerDialog(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ship_from_delivery_date, SettingsApp.RegexDate, false);
             * entryBoxDate.EntryValidation.Text = initialShipFromDeliveryDate;
             * entryBoxDate.EntryValidation.Validate();
             * entryBoxDate.ClosePopup += delegate
             * {
             *  _log.Debug(string.Format("entryBoxDate.Value: [{0}]", entryBoxDate.Value));
             * };
             * vbox.PackStart(entryBoxDate, true, true, padding);
             */
        }
Пример #4
0
        public PosDocumentFinanceArticleDialog(Window pSourceWindow, GenericTreeViewDataTable pTreeView, DialogFlags pDialogFlags, DialogMode pDialogMode, DataRow pDataSourceRow)
            : base(pSourceWindow, pDialogFlags, pDialogMode, pDataSourceRow)
        {
            //Parameters
            _sourceWindow  = pSourceWindow;
            _dialogMode    = pDialogMode;
            _dataSourceRow = pDataSourceRow;
            //References
            _posDocumentFinanceDialog = (_sourceWindow as PosDocumentFinanceDialog);
            _currencyDisplay          = (_posDocumentFinanceDialog.PagePad.Pages[0] as DocumentFinanceDialogPage1).EntryBoxSelectConfigurationCurrency.Value;
            //Require to Update ExchangeRate after create Database
            _currencyDisplay.Reload();

            //Get Reference for documentFinanceType
            _documentFinanceType = ((_sourceWindow as PosDocumentFinanceDialog).PagePad.Pages[0] as DocumentFinanceDialogPage1).EntryBoxSelectDocumentFinanceType.Value;

            //Init Local Vars
            String windowTitle = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_insert_articles");

            //Get Default System Currency
            _currencyDefaultSystem = SettingsApp.ConfigurationSystemCurrency;
            //Consignation Invoice default values
            _vatRateConsignationInvoice = (fin_configurationvatrate)GlobalFramework.SessionXpo.GetObjectByKey(typeof(fin_configurationvatrate), SettingsApp.XpoOidConfigurationVatRateDutyFree);
            _vatRateConsignationInvoiceExemptionReason = (fin_configurationvatexemptionreason)GlobalFramework.SessionXpo.GetObjectByKey(typeof(fin_configurationvatexemptionreason), SettingsApp.XpoOidConfigurationVatExemptionReasonM99);

            //TODO:THEME
            _windowSize = new Size(760, 360);

            String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_finance_article.png");

            //Get Discount from Select Customer
            _discountGlobal = FrameworkUtils.StringToDecimal(((pSourceWindow as PosDocumentFinanceDialog).PagePad.Pages[1] as DocumentFinanceDialogPage2).EntryBoxCustomerDiscount.EntryValidation.Text);
            //Get PriceType from Customer
            var customerObject = ((pSourceWindow as PosDocumentFinanceDialog).PagePad.Pages[1] as DocumentFinanceDialogPage2).EntryBoxSelectCustomerName;

            if (customerObject.Value != null)
            {
                Guid customerOid = customerObject.Value.Oid;
                _customer = (erp_customer)GlobalFramework.SessionXpo.GetObjectByKey(typeof(erp_customer), customerOid);
            }

            //ActionArea Buttons
            _buttonOk     = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok);
            _buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel);

            //ActionArea
            ActionAreaButtons actionAreaButtons = new ActionAreaButtons();

            actionAreaButtons.Add(new ActionAreaButton(_buttonOk, ResponseType.Ok));
            actionAreaButtons.Add(new ActionAreaButton(_buttonCancel, ResponseType.Cancel));

            //Init Content
            Fixed fixedContent = new Fixed();

            //Init Transport Documents Lists
            _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeDeliveryNote.ToString());
            _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeTransportationGuide.ToString());
            _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeOwnAssetsDriveGuide.ToString());
            _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeConsignmentGuide.ToString());
            _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeReturnGuide.ToString());

            //Init Components
            InitUI();

            //Put
            fixedContent.Put(_vboxEntrys, 0, 0);

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, _windowSize, fixedContent, actionAreaButtons);
        }