//XpoMode public TreeViewConfigurationPaymentCondition(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(FIN_ConfigurationPaymentCondition); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView FIN_ConfigurationPaymentCondition defaultValue = (pDefaultValue != null) ? pDefaultValue as FIN_ConfigurationPaymentCondition : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationPaymentCondition); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Code") { Title = Resx.global_record_code, MinWidth = 100 }); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = Resx.global_designation, Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("Acronym") { Title = Resx.global_ConfigurationPaymentCondition_Acronym }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = Resx.global_record_date_updated, MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); }
//XpoMode public TreeViewWorkSessionPeriod(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(pos_worksessionperiod); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView pos_worksessionperiod defaultValue = (pDefaultValue != null) ? pDefaultValue as pos_worksessionperiod : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : null; //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation") }); columnProperties.Add(new GenericTreeViewColumnProperty("DateStart") { Type = typeof(DateTime), Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date_start") }); columnProperties.Add(new GenericTreeViewColumnProperty("DateEnd") { Type = typeof(DateTime), Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date_end") }); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; SortProperty[] sortProperty = new SortProperty[1]; sortProperty[0] = new SortProperty("DateStart", SortingDirection.Ascending); XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortProperty); //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 ); }
//XpoMode public TreeViewDocumentFinanceYears(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(fin_documentfinanceyears); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView fin_documentfinanceyears defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_documentfinanceyears : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogDocumentFinanceYears); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("FiscalYear") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_year") }); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_date_updated"), MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model : Use Default Filter CriteriaOperator criteria = (ReferenceEquals(pXpoCriteria, null)) ? CriteriaOperator.Parse("(Disabled = 0 OR Disabled IS NULL)") : pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Protection to Disable Series Before Creating Year this.RecordBeforeInsert += TreeViewDocumentFinanceYears_RecordBeforeInsert; this.RecordAfterInsert += TreeViewDocumentFinanceYears_RecordAfterInsert; //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 ); }
//XpoMode public TreeViewConfigurationPreferenceParameter(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(CFG_ConfigurationPreferenceParameter); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView CFG_ConfigurationPreferenceParameter defaultValue = (pDefaultValue != null) ? pDefaultValue as CFG_ConfigurationPreferenceParameter : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationPreferenceParameter); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("ResourceString") { Title = Resx.global_designation, Expand = true, ResourceString = true }); columnProperties.Add(new GenericTreeViewColumnProperty("Value") { Title = Resx.global_value, Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = Resx.global_record_date_updated, MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model : pXpoCriteria Parameter sent by BO CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); this.RecordAfterUpdate += TreeViewConfigurationPreferenceParameter_RecordAfterUpdate; //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 ); }
//DataTable Mode public TreeViewDocumentFinanceArticle(Window pSourceWindow, DataRow pDefaultValue, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView DataRow defaultValue = (pDefaultValue != null) ? pDefaultValue : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(PosDocumentFinanceArticleDialog); //Column Formats CellRendererText cellRendererCurrency = new CellRendererText() { Alignment = Pango.Alignment.Right, Xalign = 1.0F }; int decimalsColumnWidth = 100; //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); /*00*/ columnProperties.Add(new GenericTreeViewColumnProperty("Oid") { Type = typeof(Guid), Visible = false }); /*01*/ columnProperties.Add(new GenericTreeViewColumnProperty("Article.Code") { Type = typeof(FIN_Article), Title = Resx.global_record_code, ChildName = "Code", MinWidth = 60, MaxWidth = 150, Alignment = 1.0F, CellRenderer = new CellRendererText() { Alignment = Pango.Alignment.Right, Xalign = 1.0F, ForegroundGdk = new Gdk.Color(255, 0, 0) } }); /*02*/ columnProperties.Add(new GenericTreeViewColumnProperty("Article.Designation") { Type = typeof(FIN_Article), Title = Resx.global_designation, ChildName = "Designation", MinWidth = 170, MaxWidth = 170 }); /*03*/ columnProperties.Add(new GenericTreeViewColumnProperty("Quantity") { Type = typeof(Decimal), Title = Resx.global_quantity_acronym, MinWidth = 70, MaxWidth = 100, Alignment = 1.0F, InitialValue = 1.0m, CellRenderer = new CellRendererText() { Alignment = Pango.Alignment.Right, Xalign = 1.0F, } }); /*04: Used to store DefaultCurrency price, Set visible = true to show it, Default is Hidden */ columnProperties.Add(new GenericTreeViewColumnProperty("Price") { Type = typeof(Decimal), Title = string.Format("{0}{1}", Resx.global_price, "*"), MinWidth = decimalsColumnWidth, MaxWidth = decimalsColumnWidth, Alignment = 1.0F, CellRenderer = cellRendererCurrency, Visible = false }); /*05: Visible Display Value, In Current Selected Currency*/ columnProperties.Add(new GenericTreeViewColumnProperty("PriceDisplay") { Type = typeof(Decimal), Title = Resx.global_price, MinWidth = decimalsColumnWidth, MaxWidth = decimalsColumnWidth, Alignment = 1.0F, CellRenderer = cellRendererCurrency }); /*06*/ columnProperties.Add(new GenericTreeViewColumnProperty("ConfigurationVatRate.Value") { Type = typeof(FIN_ConfigurationVatRate), ChildName = "Value", Title = Resx.global_vat_rate, MinWidth = 60, MaxWidth = 60, Alignment = 1.0F, //TODO: Put to Work for SqlServer else appears has 23.0000 not 23.00 FormatProvider = new FormatterDecimal(), CellRenderer = new CellRendererText() { Alignment = Pango.Alignment.Right, Xalign = 1.0F, } }); /*07*/ columnProperties.Add(new GenericTreeViewColumnProperty("VatExemptionReason.Acronym") { Type = typeof(FIN_ConfigurationVatExemptionReason), Title = Resx.global_vat_exemption_reason_acronym, ChildName = "Acronym", MinWidth = 60, MaxWidth = 60, Visible = false }); /*08*/ columnProperties.Add(new GenericTreeViewColumnProperty("Discount") { Type = typeof(Decimal), Title = Resx.global_discount, MinWidth = 60, MaxWidth = 60, Alignment = 1.0F, CellRenderer = cellRendererCurrency }); /*09*/ columnProperties.Add(new GenericTreeViewColumnProperty("TotalNet") { Type = typeof(Decimal), Title = Resx.global_totalnet_acronym, MinWidth = decimalsColumnWidth, MaxWidth = decimalsColumnWidth, Alignment = 1.0F, CellRenderer = cellRendererCurrency }); /*10*/ columnProperties.Add(new GenericTreeViewColumnProperty("TotalFinal") { Type = typeof(Decimal), Title = Resx.global_totalfinal_acronym, MinWidth = decimalsColumnWidth, MaxWidth = decimalsColumnWidth, Alignment = 1.0F, CellRenderer = cellRendererCurrency }); //Other Invisible Fields /*11*/ columnProperties.Add(new GenericTreeViewColumnProperty("PriceFinal") { Type = typeof(Decimal), Visible = false }); /*12*/ columnProperties.Add(new GenericTreeViewColumnProperty("PriceType") { Type = typeof(PriceType), Visible = false }); /*13*/ columnProperties.Add(new GenericTreeViewColumnProperty("Token1") { Type = typeof(string), Visible = false }); //MediaNova:ClassifiedID /*14*/ columnProperties.Add(new GenericTreeViewColumnProperty("Token2") { Type = typeof(string), Visible = false }); //MediaNova:FriendlyID /*15*/ columnProperties.Add(new GenericTreeViewColumnProperty("Notes") { Type = typeof(string), Visible = false }); //init DataTable DataTable dataTable = GetDataTable(columnProperties, false); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter pDefaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here dataTable, //Created Here typeDialogClass //Created Here ); }
//XpoMode public TreeViewDocumentOrderTicket(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(FIN_DocumentOrderTicket); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView FIN_DocumentOrderTicket defaultValue = (pDefaultValue != null) ? pDefaultValue as FIN_DocumentOrderTicket : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : null; //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("TicketId") { Title = Resx.global_ticket_number, MinWidth = 50 }); columnProperties.Add(new GenericTreeViewColumnProperty("DateStart") { Title = Resx.global_date, MinWidth = 100 }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedBy") { Title = Resx.global_user_name, ChildName = "Name", MinWidth = 100 }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedWhere") { Title = Resx.global_terminal_name, ChildName = "Designation", MinWidth = 100 }); //Sort Order SortProperty[] sortProperty = new SortProperty[1]; sortProperty[0] = new SortProperty("TicketId", SortingDirection.Ascending); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortProperty); //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 ); }
//XpoMode public TreeViewCustomer(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(erp_customer); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView erp_customer defaultValue = (pDefaultValue != null) ? pDefaultValue as erp_customer : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogCustomer); //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("Name") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_name"), MinWidth = 200, Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("FiscalNumber") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_number"), MinWidth = 150 }); columnProperties.Add(new GenericTreeViewColumnProperty("CardNumber") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_card_number"), MinWidth = 150 }); 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.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; /* IN009162 - customer sorting changes when "PosDocumentFinanceDialog" window */ string sortedColumn = "Ord"; // Default one if ("PosDocumentFinanceDialog".Equals(pSourceWindow.GetType().Name)) { sortedColumn = "UpdatedAt"; } SortProperty sortPropertyForCustomer = new SortProperty(sortedColumn, DevExpress.Xpo.DB.SortingDirection.Descending); XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortPropertyForCustomer); //Custom Events //WIP: this.CursorChanged += TreeViewCustomer_CursorChanged; //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); //Protected Records ProtectedRecords.Add(SettingsApp.XpoOidDocumentFinanceMasterFinalConsumerEntity);//FinalConsumerEntity }
//XpoMode public TreeViewSystemBackup(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(sys_systembackup); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView sys_systembackup defaultValue = (pDefaultValue != null) ? pDefaultValue as sys_systembackup : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : null; //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Version") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_version"), MinWidth = 60, CellRenderer = new CellRendererText() { Alignment = Pango.Alignment.Right, Xalign = 1.0F } }); columnProperties.Add(new GenericTreeViewColumnProperty("CreatedAt") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date"), MinWidth = 180 }); columnProperties.Add(new GenericTreeViewColumnProperty("FileNamePacked") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_file"), MinWidth = 240 }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_date_updated"), MinWidth = 150, MaxWidth = 150 }); //Sort Order SortProperty[] sortProperty = new SortProperty[2]; sortProperty[0] = new SortProperty("Version", SortingDirection.Descending); sortProperty[1] = new SortProperty("CreatedAt", SortingDirection.Ascending); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortProperty); //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 ); }
//XpoMode public TreeViewDocumentFinanceMaster(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(fin_documentfinancemaster); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView fin_documentfinancemaster defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_documentfinancemaster : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : null; //Config int fontGenericTreeViewColumn = Convert.ToInt16(GlobalFramework.Settings["fontGenericTreeViewColumn"]); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Date") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_document_date"), MinWidth = 140 }); columnProperties.Add(new GenericTreeViewColumnProperty("DocumentNumber") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_document_number"), MinWidth = 120 }); /* IN009067 */ //#if (DEBUG) columnProperties.Add(new GenericTreeViewColumnProperty("DocumentStatusStatus") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_document_status"), MinWidth = 50, MaxWidth = 50 }); //#endif columnProperties.Add(new GenericTreeViewColumnProperty("EntityName") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_entity"), MinWidth = 260, MaxWidth = 260, FormatProvider = new FormatterDecrypt() /* IN009075 - FormatterDecrypt() created */ }); /* IN009067 */ columnProperties.Add(new GenericTreeViewColumnProperty("EntityFiscalNumber") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_number"), MinWidth = 100, FormatProvider = new FormatterDecrypt() /* IN009075 - FormatterDecrypt() created */ }); /* IN009067 */ columnProperties.Add(new GenericTreeViewColumnProperty("TotalFinal") { /* IN009166 */ Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_total_final"), MinWidth = 100, //Alignment = 1.0F, FormatProvider = new FormatterDecimalCurrency(), CellRenderer = new CellRendererText() { FontDesc = new Pango.FontDescription() { Size = fontGenericTreeViewColumn }, Alignment = Pango.Alignment.Right, Xalign = 1.0F } }); /* IN009161 - changing columns order */ /* IN009067 - Adding TotalOfCredit column */ /* IN009151 - fix for "CreditTotals" (CreditInvoiceTotal column added) */ /* #TODO - SQL refactoring */ string queryForTotalOfCredit = @" SELECT SUM(CreditAmount) + SUM(CreditInvoiceTotal) as CreditTotals FROM view_documentfinancepaymentdocumenttotal WHERE DocumentPayed = '{0}';"; /* Fixed by IN009151 */ /*string query3 = @" * SELECT * ISNULL(SUM(DocFinMasterPay.CreditAmount), 0) + * ( * SELECT * ISNULL(SUM(DocFinMaster.TotalFinal), 0) AS TotalFinal * FROM * fin_documentfinancemaster AS DocFinMaster * WHERE * DocumentType = 'fa924162-beed-4f2f-938d-919deafb7d47' * AND * DocFinMaster.DocumentParent = '{0}' * AND * ( DocFinMaster.DocumentStatusStatus <> 'A' AND DocFinMaster.Disabled <> 1) * GROUP BY * DocFinMaster.DocumentParent * ) AS CreditAmount * FROM * fin_documentfinancemasterpayment AS DocFinMasterPay * LEFT JOIN * fin_documentfinancepayment AS DocFinPay ON (DocFinPay.Oid = DocFinMasterPay.DocumentFinancePayment) * WHERE * DocFinMasterPay.DocumentFinanceMaster = '{0}' * AND * (DocFinPay.PaymentStatus <> 'A' AND DocFinPay.Disabled <> 1) * GROUP BY * DocFinMasterPay.DocumentFinanceMaster; * * "; */ columnProperties.Add(new GenericTreeViewColumnProperty("TotalOfCredit") { Query = queryForTotalOfCredit, Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_document_finance_column_total_credit_rc_nc_based"), MinWidth = 100, //Alignment = 1.0F, FormatProvider = new FormatterDecimalCurrency(), /* IN009067 */ CellRenderer = new CellRendererText() { FontDesc = new Pango.FontDescription() { Size = fontGenericTreeViewColumn }, Alignment = Pango.Alignment.Right, Xalign = 1.0F } }); /* IN009067 - adding "ViewDocumentFinancePaymentDocumentTotal" result to TotalDebit column */ /*string queryForTotalDebit = @" * SELECT * fmaTotalFinal - ( * SELECT * SUM(CreditAmount) as CreditTotals * FROM * view_documentfinancepaymentdocumenttotal * WHERE * DocumentPayed = '{0}' * ) AS Result * FROM * view_documentfinancepayment * WHERE * fmaOid = '{0}' AND * fpaPaymentStatus <> 'A' * GROUP BY * fmaOid, fmaTotalFinal;";*/ /* Fixed by IN009151 */ /* * "UNION" with a "NOT EXISTS" was necessary to keep "0" value as part of calculation and then avoiding "NULL" cases that affect calculation result. * * "CASE/WHEN" implemented to remove Debit values from credit-documents (NCs) and transport-documents (GTs) * * Replacing use of "view_documentfinancepayment" */ /* #TODO - SQL refactoring */ string stringFormatIndexZero = "{0}"; /* The following document types has no debit amount: * Orçamento * Guia ou Nota de Devolução * Guia de Transporte * Fatura Simplificada * Documento de Conferência * Fatura Pró-Forma * Fatura-Recibo * Nota de Crédito * Guia de Consignação * Guia de Remessa * Guia de Movimentação de Ativos Fixos Próprios */ string queryForTotalDebit = $@" SELECT ( CASE WHEN DFM.DocumentType IN ( '{SettingsApp.XpoOidDocumentFinanceTypeBudget}', '{SettingsApp.XpoOidDocumentFinanceTypeConferenceDocument}', '{SettingsApp.XpoOidDocumentFinanceTypeConsignmentGuide}', '{SettingsApp.XpoOidDocumentFinanceTypeCreditNote}', '{SettingsApp.XpoOidDocumentFinanceTypeDeliveryNote}', '{SettingsApp.XpoOidDocumentFinanceTypeInvoiceAndPayment}', '{SettingsApp.XpoOidDocumentFinanceTypeOwnAssetsDriveGuide}', '{SettingsApp.XpoOidDocumentFinanceTypeProformaInvoice}', '{SettingsApp.XpoOidDocumentFinanceTypeReturnGuide}', '{SettingsApp.XpoOidDocumentFinanceTypeSimplifiedInvoice}', '{SettingsApp.XpoOidDocumentFinanceTypeTransportationGuide}' ) THEN NULL ELSE ( DFM.TotalFinal - ( ( SELECT SUM(DocFinMaster.TotalFinal) AS TotalFinal FROM fin_documentfinancemaster AS DocFinMaster WHERE DocumentType = 'fa924162-beed-4f2f-938d-919deafb7d47' AND DocFinMaster.DocumentParent = DFM.Oid AND ( DocFinMaster.DocumentStatusStatus <> 'A' AND DocFinMaster.Disabled <> 1) GROUP BY DocFinMaster.DocumentParent UNION SELECT 0 AS CreditAmount WHERE NOT EXISTS ( SELECT 1 FROM fin_documentfinancemaster AS DFMNC WHERE DocumentType = 'fa924162-beed-4f2f-938d-919deafb7d47' AND DFMNC.DocumentParent = DFM.Oid AND ( DFMNC.DocumentStatusStatus <> 'A' AND DFMNC.Disabled <> 1) ) ) + ( SELECT SUM(DocFinMasterPay.CreditAmount) AS CreditAmount FROM fin_documentfinancemasterpayment AS DocFinMasterPay LEFT JOIN fin_documentfinancepayment AS DocFinPay ON (DocFinPay.Oid = DocFinMasterPay.DocumentFinancePayment) WHERE DocFinMasterPay.DocumentFinanceMaster = DFM.Oid AND (DocFinPay.PaymentStatus <> 'A' AND DocFinPay.Disabled <> 1) GROUP BY DocFinMasterPay.DocumentFinanceMaster UNION SELECT 0 AS CreditAmount WHERE NOT EXISTS ( SELECT 1 FROM fin_documentfinancemasterpayment AS DFMRC LEFT JOIN fin_documentfinancepayment AS DFPRC ON (DFPRC.Oid = DFMRC.DocumentFinancePayment) WHERE DFMRC.DocumentFinanceMaster = DFM.Oid AND ( DFPRC.PaymentStatus <> 'A' AND DFMRC.Disabled <> 1) ) ) ) ) END ) AS Balance FROM fin_documentfinancemaster DFM WHERE DFM.Oid = '{stringFormatIndexZero}'; "; columnProperties.Add(new GenericTreeViewColumnProperty("TotalDebit") { //This Query Exists 3 Locations, Find it and change in all Locations - Required "GROUP BY fmaOid,fmaTotalFinal" to work with SQLServer Query = queryForTotalDebit, Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_debit"), MinWidth = 100, //Alignment = 1.0F, FormatProvider = new FormatterDecimalCurrency(), /* IN009067 */ CellRenderer = new CellRendererText() { FontDesc = new Pango.FontDescription() { Size = fontGenericTreeViewColumn }, Alignment = Pango.Alignment.Right, Xalign = 1.0F } }); /* IN009067 - Adding RelatedDocuments column */ string relatedDocumentsQuery = logicpos.DataLayer.GenerateRelatedDocumentsQuery(); columnProperties.Add(new GenericTreeViewColumnProperty("RelatedDocuments") { Query = relatedDocumentsQuery, Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_document_finance_column_related_doc"), MinWidth = 100 }); //Sort Order SortProperty[] sortProperty = new SortProperty[2]; /* IN009067 - setting up descending sort */ sortProperty[0] = new SortProperty("Date", SortingDirection.Descending); sortProperty[1] = new SortProperty("DocumentNumber", SortingDirection.Descending); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; //New Sort collection for pagination created (3/7/19) IN009223 IN009227 SortingCollection sortCollection = new SortingCollection(sortProperty); XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortProperty) { TopReturnedObjects = SettingsApp.PaginationRowsPerPage * base.CurrentPageNumber, Sorting = sortCollection }; //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 ); }
//XpoMode public TreeViewConfigurationCashRegister(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(pos_configurationcashregister); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView pos_configurationcashregister defaultValue = (pDefaultValue != null) ? pDefaultValue as pos_configurationcashregister : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationCashRegister); //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_Drawer"), Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("Drawer") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationCashRegister") }); columnProperties.Add(new GenericTreeViewColumnProperty("AutomaticDrawer") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationCashRegister_AutomaticDrawer") }); columnProperties.Add(new GenericTreeViewColumnProperty("ActiveSales") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationCashRegister_ActiveSales") }); columnProperties.Add(new GenericTreeViewColumnProperty("AllowChargeBacks") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_ConfigurationCashRegister_AllowChargeBacks") }); 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.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); }
//XpoMode public TreeViewUserProfile(Window pSourceWindow, XPGuidObject defaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { Type xpoGuidObjectType = typeof(sys_userprofile); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView sys_userprofile xpoDefaultValue = (defaultValue != null) ? defaultValue as sys_userprofile : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogUserProfile); // XPO column properties 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_profile"), Expand = true }); //configure criteria/xpcollection/model CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); }
//XpoMode public TreeViewUserCommissionGroup(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(pos_usercommissiongroup); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView pos_usercommissiongroup defaultValue = (pDefaultValue != null) ? pDefaultValue as pos_usercommissiongroup : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogUserCommissionGroup); //Config int fontGenericTreeViewColumn = Convert.ToInt16(GlobalFramework.Settings["fontGenericTreeViewColumn"]); //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("Commission") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_commission"), MinWidth = 100, //Alignment = 1.0F, FormatProvider = new FormatterDecimal(), //CellRenderer = new CellRendererText() //{ // FontDesc = new Pango.FontDescription() { Size = fontGenericTreeViewColumn }, // Alignment = Pango.Alignment.Right, // Xalign = 1.0F //} }); 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.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); }
//XpoMode public TreeViewArticleFamily(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(fin_articlefamily); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView fin_articlefamily defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_articlefamily : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogArticleFamily); //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("Printer") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_device_printer"), ChildName = "Designation" }); 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.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //TODO: Clean Comments : Moved Events to XPOWidget - Capture Events - VIEW DialogArticleFamily _crudWidgetList.BeforeUpdate and _crudWidgetList.AfterUpdate //this.RecordBeforeInsert += delegate { // _log.Debug(string.Format("[{0}] [{1}]", this.GetType(), "RecordBeforeInsert")); // _log.Debug(string.Format("Dialog.DataSourceRow: [{0}]", (_dialog as DialogArticleFamily).DataSourceRow)); // _log.Debug(string.Format("Dialog.CrudWidgetList: [{0}]", (_dialog as DialogArticleFamily).CrudWidgetList)); //}; //TODO: Test Events Here //this.RecordBeforeUpdate += delegate { _log.Debug(string.Format("[{0}] [{1}]", this.GetType(), "RecordBeforeUpdate"));}; //this.RecordBeforeDelete += delegate { _log.Debug(string.Format("[{0}] [{1}]", this.GetType(), "RecordBeforeDelete"));}; //this.RecordAfterInsert += delegate { _log.Debug(string.Format("[{0}] [{1}]", this.GetType(), "RecordAfterInsert")); }; //this.RecordAfterUpdate += delegate { _log.Debug(string.Format("[{0}] [{1}]", this.GetType(), "RecordAfterUpdate"));}; //this.RecordAfterDelete += delegate { _log.Debug(string.Format("[{0}] [{1}]", this.GetType(), "RecordAfterDelete"));}; //this.RecordBeforeConfirm += delegate { _log.Debug(string.Format("[{0}] [{1}]", this.GetType(), "RecordBeforeConfirm"));}; //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 ); }
//XpoMode public TreeViewSystemAuditType(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(sys_systemaudittype); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView sys_systemaudittype defaultValue = (pDefaultValue != null) ? pDefaultValue as sys_systemaudittype : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : null; //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("UpdatedAt") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_date_updated"), MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; SortProperty[] sortProperty = new SortProperty[1]; sortProperty[0] = new SortProperty("Code", SortingDirection.Ascending); XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortProperty); //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 ); }
//DataTable Mode public TreeViewPartialPayment(Window pSourceWindow, DataRow pDefaultValue, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars DataRow defaultValue = (pDefaultValue != null) ? pDefaultValue : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : null; //Defaults CellRendererText cellRendererCurrency = new CellRendererText() { Alignment = Pango.Alignment.Right, Xalign = 1.0F }; int decimalsColumnWidth = 100; //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); /*00*/ columnProperties.Add(new GenericTreeViewColumnProperty("Oid") { Type = typeof(Guid), Visible = false }); /*01*/ columnProperties.Add(new GenericTreeViewColumnProperty("Code") { Type = typeof(String), Title = Resx.global_record_code }); /*02*/ columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Type = typeof(String), Title = Resx.global_designation, Expand = true }); /*03*/ columnProperties.Add(new GenericTreeViewColumnProperty("PriceFinal") { Type = typeof(Decimal), Title = Resx.global_price, MinWidth = decimalsColumnWidth, MaxWidth = decimalsColumnWidth, CellRenderer = cellRendererCurrency }); /*04*/ columnProperties.Add(new GenericTreeViewColumnProperty("Vat") { Type = typeof(Decimal), Title = Resx.global_vat_rate, MinWidth = decimalsColumnWidth, MaxWidth = decimalsColumnWidth, Alignment = 1.0F, CellRenderer = cellRendererCurrency }); /*05*/ columnProperties.Add(new GenericTreeViewColumnProperty("Discount") { Type = typeof(Decimal), Title = Resx.global_discount, MinWidth = decimalsColumnWidth, MaxWidth = decimalsColumnWidth, Alignment = 1.0F, CellRenderer = cellRendererCurrency }); /*06*/ columnProperties.Add(new GenericTreeViewColumnProperty("Place") { Type = typeof(String), Title = Resx.global_placetable_place }); //Other Invisible Fields /*07*/ columnProperties.Add(new GenericTreeViewColumnProperty("Price") { Type = typeof(Decimal), Visible = false }); /*08*/ columnProperties.Add(new GenericTreeViewColumnProperty("Quantity") { Type = typeof(Int16), Visible = false }); /*09*/ columnProperties.Add(new GenericTreeViewColumnProperty("UnitMeasure") { Type = typeof(String), Visible = false }); /*10*/ columnProperties.Add(new GenericTreeViewColumnProperty("PlaceOid") { Type = typeof(Guid), Visible = false }); /*11*/ columnProperties.Add(new GenericTreeViewColumnProperty("TableOid") { Type = typeof(Guid), Visible = false }); /*12*/ columnProperties.Add(new GenericTreeViewColumnProperty("PriceType") { Type = typeof(PriceType), Visible = false }); /*13*/ columnProperties.Add(new GenericTreeViewColumnProperty("Token1") { Type = typeof(string), Visible = false }); //ClassifiedID /*14*/ columnProperties.Add(new GenericTreeViewColumnProperty("Token2") { Type = typeof(string), Visible = false }); //FriendlyID /*15*/ columnProperties.Add(new GenericTreeViewColumnProperty("Notes") { Type = typeof(string), Visible = false }); //init DataTable DataTable dataTable = GetDataTable(columnProperties); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter pDefaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here dataTable, //Created Here typeDialogClass //Created Here ); //Use this in SelectRecord to format TreeView to Touch //this.FormatColumnPropertiesForTouch(); }
//XpoMode public TreeViewConfigurationVatExceptionReason(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(fin_configurationvatexemptionreason); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView fin_configurationvatexemptionreason defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_configurationvatexemptionreason : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationVatExemptionReason); //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_vat_rate") }); 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.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); //Protected Records ProtectedRecords.Add(SettingsApp.XpoOidConfigurationVatExemptionReasonM99);//M99 }
//XpoMode public TreeViewDocumentFinanceYearSerieTerminal(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(fin_documentfinanceyearserieterminal); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView fin_documentfinanceyearserieterminal defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_documentfinanceyearserieterminal : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogDocumentFinanceYearSerieTerminal); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("FiscalYear") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_fiscal_year"), ChildName = "Designation" }); //columnProperties.Add(new GenericTreeViewColumnProperty("DocumentType") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinanceseries_documenttype, ChildName = "Designation" }); //columnProperties.Add(new GenericTreeViewColumnProperty("Serie") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinance_series, ChildName = "Designation" }); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("Terminal") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_configurationplaceterminal"), ChildName = "Designation" }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_date_updated"), MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model : Use Default Filter CriteriaOperator criteria = (ReferenceEquals(pXpoCriteria, null)) ? CriteriaOperator.Parse("(Disabled = 0 OR Disabled IS NULL)") : pXpoCriteria; //Init Collection XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Override default Sorting SortingCollection sortingCollection = new SortingCollection(); sortingCollection.Add(new SortProperty("Terminal", DevExpress.Xpo.DB.SortingDirection.Ascending)); sortingCollection.Add(new SortProperty("Ord", DevExpress.Xpo.DB.SortingDirection.Ascending)); xpoCollection.Sorting = sortingCollection; //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 ); }
//XpoMode public TreeViewArticleClass(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(FIN_ArticleClass); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView FIN_ArticleClass defaultValue = (pDefaultValue != null) ? pDefaultValue as FIN_ArticleClass : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogArticleClass); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Code") { Title = Resx.global_record_code, MinWidth = 100 }); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = Resx.global_designation, Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("Acronym") { Title = Resx.global_acronym }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = Resx.global_record_date_updated, MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; SortProperty[] sortProperty = new SortProperty[1]; sortProperty[0] = new SortProperty("Code", SortingDirection.Ascending); XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortProperty); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); //Protected Records ProtectedRecords.Add(new Guid("6924945d-f99e-476b-9c4d-78fb9e2b30a3")); //P ProtectedRecords.Add(new Guid("7622e5d2-2d52-4be9-bb8b-e5efae5ec791")); //S ProtectedRecords.Add(new Guid("0763a749-0066-49f1-a9cf-5f9577395476")); //O ProtectedRecords.Add(new Guid("82c158f9-9c30-468f-9d15-8bde112998f4")); //I }
//XpoMode public TreeViewArticleStock(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(fin_articlestock); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView fin_articlestock defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_articlestock : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : null; //Config int fontGenericTreeViewColumn = Convert.ToInt16(GlobalFramework.Settings["fontGenericTreeViewColumn"]); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Quantity") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_stock_movement"), MinWidth = 100, FormatProvider = new FormatterStockMovement(), }); columnProperties.Add(new GenericTreeViewColumnProperty("Date") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date"), MinWidth = 100, FormatProvider = new FormatterDate(), }); columnProperties.Add(new GenericTreeViewColumnProperty("Customer") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_entity"), ChildName = "Name", MinWidth = 125 }); columnProperties.Add(new GenericTreeViewColumnProperty("DocumentNumber") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_document_number"), MinWidth = 125 }); columnProperties.Add(new GenericTreeViewColumnProperty("Article") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_article"), ChildName = "Designation", MinWidth = 125 }); columnProperties.Add(new GenericTreeViewColumnProperty("Quantity") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_quantity"), MinWidth = 100, //Alignment = 1.0F, FormatProvider = new FormatterDecimal(), //CellRenderer = new CellRendererText() //{ // FontDesc = new Pango.FontDescription() { Size = fontGenericTreeViewColumn }, // Alignment = Pango.Alignment.Right, // Xalign = 1.0F //} }); 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.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; SortProperty[] sortProperty = new SortProperty[2]; sortProperty[0] = new SortProperty("CreatedAt", SortingDirection.Ascending); sortProperty[1] = new SortProperty("Ord", SortingDirection.Ascending); XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortProperty); //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 ); }
//XpoMode public TreeViewArticleSubFamily(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(fin_articlesubfamily); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView fin_articlesubfamily defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_articlesubfamily : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogArticleSubFamily); //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("Family") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_article_family"), ChildName = "Designation" }); columnProperties.Add(new GenericTreeViewColumnProperty("Printer") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_device_printer"), ChildName = "Designation" }); 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.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); }
//XpoMode public TreeViewConfigurationCurrency(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(CFG_ConfigurationCurrency); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView CFG_ConfigurationCurrency defaultValue = (pDefaultValue != null) ? pDefaultValue as CFG_ConfigurationCurrency : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationCurrency); //Config int fontGenericTreeViewColumn = Convert.ToInt16(GlobalFramework.Settings["fontGenericTreeViewColumn"]); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Code") { Title = Resx.global_record_code, MinWidth = 100 }); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = Resx.global_designation, Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("Acronym") { Title = Resx.global_ConfigurationCurrency_Acronym }); //columnProperties.Add(new GenericTreeViewColumnProperty("ExchangeRate") { // Title = Resx.global_exchangerate, // Type = typeof(Decimal), // Alignment = 1.0F // //WIP // //FontDesc = new Pango.FontDescription() { Size = 11 }, // Removed, this will make Trees that use it has diferent row Sizes // //,CellRenderer = new CellRendererText() { Alignment = Pango.Alignment.Right, Xalign = 1.0F } //}); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = Resx.global_record_date_updated, MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); }