Ejemplo n.º 1
0
        void localMenu_OnItemClicked(string ActionType)
        {
            var selectedItem = dgInvStorageProfileGrid.SelectedItem as InvStorageProfileLocalClient;

            switch (ActionType)
            {
            case "Search":
                LoadData();
                break;

            case "ItemFilter":
                if (itemFilterDialog == null)
                {
                    if (itemFilterCleared)
                    {
                        itemFilterDialog = new CWServerFilter(api, typeof(InvItemClient), null, null, InventoryUserFields);
                    }
                    else
                    {
                        itemFilterDialog = new CWServerFilter(api, typeof(InvItemClient), null, null, InventoryUserFields);
                    }
                    itemFilterDialog.Closing += itemFilterDialog_Closing;
#if !SILVERLIGHT
                    itemFilterDialog.Show();
                }
                else
                {
                    itemFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                itemFilterDialog.Show();
#endif
                break;
Ejemplo n.º 2
0
        void localMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "Search":
                LoadData();
                break;

            case "DebtorFilter":
                if (debtorFilterDialog == null)
                {
                    if (debtorFilterCleared)
                    {
                        debtorFilterDialog = new CWServerFilter(api, typeof(DebtorClient), null, null, DebtorUserFields);
                    }
                    else
                    {
                        debtorFilterDialog = new CWServerFilter(api, typeof(DebtorClient), null, null, DebtorUserFields);
                    }
                    debtorFilterDialog.Closing += debtorFilterDialog_Closing;
#if !SILVERLIGHT
                    debtorFilterDialog.Show();
                }
                else
                {
                    debtorFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                debtorFilterDialog.Show();
#endif
                break;
        void localMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "ItemFilter":
                if (itemFilterDialog == null)
                {
                    if (itemFilterCleared)
                    {
                        itemFilterDialog = new CWServerFilter(api, typeof(InvStockStatus), null, null, ItemUserFields);
                    }
                    else
                    {
                        itemFilterDialog = new CWServerFilter(api, typeof(InvStockStatus), null, null, ItemUserFields);
                    }
                    itemFilterDialog.Closing += itemFilterDialog_Closing;
#if !SILVERLIGHT
                    itemFilterDialog.Show();
                }
                else
                {
                    itemFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                itemFilterDialog.Show();
#endif
                break;
Ejemplo n.º 4
0
        void localMenu_OnItemClicked(string ActionType)
        {
            GLAccountClient selectedItem = dgGLAccount.View.MasterRootRowsContainer.FocusedView.DataControl.CurrentItem as GLAccountClient;

            switch (ActionType)
            {
            case "Search":
                InitQuery();
                break;

            case "GLAccountFilter":
                if (glAccountFilterDialog == null)
                {
                    glAccountFilterDialog          = new CWServerFilter(api, typeof(GLAccountClient), glAccountDefaultFilter, null, GLAccountUserFields);
                    glAccountFilterDialog.Closing += glAccountFilterDialog_Closing;
#if !SILVERLIGHT
                    glAccountFilterDialog.Show();
                }
                else
                {
                    glAccountFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                glAccountFilterDialog.Show();
#endif
                break;
Ejemplo n.º 5
0
        private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "RefreshGrid":
                InitQuery();
                break;

            case "ApplyFilter":
                if (filterDialog == null)
                {
                    if (defaultFilterCleared)
                    {
                        filterDialog = new CWServerFilter(api, typeof(InvBOMClient), null, defaultSort);
                    }
                    else
                    {
                        filterDialog = new CWServerFilter(api, typeof(InvBOMClient), defaultFilters, defaultSort);
                    }
                    filterDialog.Closing += FilterDialog_Closing;
#if !SILVERLIGHT
                    filterDialog.Show();
                }
                else
                {
                    filterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                filterDialog.Show();
#endif
                break;
        void localMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "ItemFilter":
                if (filterDialog == null)
                {
                    if (filterCleared)
                    {
                        filterDialog = new CWServerFilter(api, typeof(GLTransDCSumClient), null, null);
                    }
                    else
                    {
                        filterDialog = new CWServerFilter(api, typeof(GLTransDCSumClient), null, null);
                    }
                    filterDialog.Closing += itemFilterDialog_Closing;
#if !SILVERLIGHT
                    filterDialog.Show();
                }
                else
                {
                    filterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                filterDialog.Show();
#endif
                break;
        private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "GroupByCategoryType":
                GroupByCatType();
                break;

            case "ShowBudget":
                showBudget = !showBudget;
                ShowBudget();
                if (showBudget)
                {
                    LoadGrid();
                }
                break;

            case "RefreshGrid":
                if (master != null)
                {
                    LoadGrid();
                }
                else
                {
                    BindGrid();
                }
                break;

            case "ProjectTransFilter":
                if (proTransFilterDialog == null)
                {
                    if (proTransFilterCleared)
                    {
                        proTransFilterDialog = new CWServerFilter(api, typeof(ProjectTransClient), null, null, null);
                    }
                    else
                    {
                        proTransFilterDialog = new CWServerFilter(api, typeof(ProjectTransClient), null, null, null);
                    }
                    proTransFilterDialog.Closing += ProTransFilterDialog_Closing;
#if !SILVERLIGHT
                    proTransFilterDialog.Show();
                }
                else
                {
                    proTransFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                proTransFilterDialog.Show();
#endif
                break;
        void localMenu_OnItemClicked(string ActionType)
        {
            var selectedItem = dgCreateEmailList.SelectedItem as CrmCampaignMemberClient;

            switch (ActionType)
            {
            case "Search":
                LoadEmails();
                break;

            case "DeleteRow":
                if (selectedItem != null)
                {
                    ;
                }
                dgCreateEmailList.DeleteRow();
                break;

            case "DebtorFilter":

                if (debtorFilterDialog == null)
                {
                    if (debtorFilterCleared)
                    {
                        debtorFilterDialog = new CWServerFilter(api, typeof(DebtorClient), null, debtorDefaultSort, DebtorUserFields);
                    }
                    else
                    {
                        debtorFilterDialog = new CWServerFilter(api, typeof(DebtorClient), debtorDefaultFilters, debtorDefaultSort, DebtorUserFields);
                    }
                    debtorFilterDialog.Closing += debtorFilterDialog_Closing;
#if !SILVERLIGHT
                    debtorFilterDialog.Show();
                }
                else
                {
                    debtorFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                debtorFilterDialog.Show();
#endif
                break;
        void localMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "ItemFilter":
                if (itemFilterDialog == null)
                {
                    itemFilterDialog          = new CWServerFilter(api, typeof(EmployeeDebSales), null, null);
                    itemFilterDialog.Closing += itemFilterDialog_Closing;
#if !SILVERLIGHT
                    itemFilterDialog.Show();
                }
                else
                {
                    itemFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }

                itemFilterDialog.Show();
#endif
                break;
Ejemplo n.º 10
0
        private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "RefreshGrid":
                BindGrid(true);
                pivotDgInvTrans.RefreshData();
                break;

            case "LocalFilter":
                if (filterDialog == null)
                {
                    if (filterCleared)
                    {
                        filterDialog = new CWServerFilter(api, typeof(InvTransClient), null, null, UserFields);
                    }
                    else
                    {
                        filterDialog = new CWServerFilter(api, typeof(InvTransClient), null, null, UserFields);
                    }
                    filterDialog.Closing += filterDialog_Closing;
                    filterDialog.Show();
                }
                else
                {
                    filterDialog.Show(true);
                }
                break;

            case "ClearLocalFilter":
                filterDialog  = null;
                filterValues  = null;
                filterCleared = true;
                BindGrid();
                pivotDgInvTrans.RefreshData();
                break;

            case "ChartSettings":
                CWChartSettings cwChartSettingDialog = new CWChartSettings(pivotDgInvTrans.ChartSelectionOnly, pivotDgInvTrans.ChartProvideColumnGrandTotals,
                                                                           pivotDgInvTrans.ChartProvideRowGrandTotals, labelVisibility, seriesIndex, pivotDgInvTrans.ChartProvideDataByColumns, chartEnable);
                cwChartSettingDialog.Closed += delegate
                {
                    if (cwChartSettingDialog.DialogResult == true)
                    {
                        if (cwChartSettingDialog.IsChartVisible)
                        {
                            chartControl.Diagram = cwChartSettingDialog.ChartDaigram;
                            pivotDgInvTrans.ChartProvideEmptyCells = IsPivotTableProvideEmptyCells();
                            chartControl.Diagram.SeriesTemplate.LabelsVisibility = cwChartSettingDialog.labelVisibility;
                            chartControl.CrosshairEnabled                 = cwChartSettingDialog.crossHairEnabled;
                            pivotDgInvTrans.ChartProvideDataByColumns     = cwChartSettingDialog.chartProvideDataByColumns;
                            pivotDgInvTrans.ChartSelectionOnly            = cwChartSettingDialog.ChartSelectionOnly;
                            pivotDgInvTrans.ChartProvideColumnGrandTotals = cwChartSettingDialog.ChartProvideColumnGrandTotals;
                            pivotDgInvTrans.ChartProvideRowGrandTotals    = cwChartSettingDialog.ChartProvideRowGrandTotals;
                            seriesIndex             = cwChartSettingDialog.SeriesIndex;
                            chartControl.Visibility = Visibility.Visible;
                            if (rowgridSplitter.Height.Value == 0 && rowChartControl.Height.Value == 0)
                            {
                                rowgridSplitter.Height = new GridLength(5);
                                var converter = new GridLengthConverter();
                                rowChartControl.Height = (GridLength)converter.ConvertFrom("Auto");
                            }
                        }
                        else
                        {
                            chartControl.Visibility = Visibility.Collapsed;
                            rowgridSplitter.Height  = new GridLength(0);
                            rowChartControl.Height  = new GridLength(0);
                        }
                        chartEnable     = cwChartSettingDialog.IsChartVisible;
                        labelVisibility = cwChartSettingDialog.labelVisibility;
                    }
                };
                cwChartSettingDialog.Show();
                break;

            case "ImportPivotTableLayout":
                controlRibbon_BaseActions(ActionType);
                if (chartControl.Diagram != null)
                {
                    chartControl.Visibility = Visibility.Visible;
                    labelVisibility         = chartControl.Diagram.SeriesTemplate.LabelsVisibility;
                    seriesIndex             = GetSeriesId();
                }
                break;

            default:
                controlRibbon_BaseActions(ActionType);
                break;
            }
        }
        private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "ExpandAndCollapse":
                if (dgCreditorTrans.ItemsSource == null)
                {
                    return;
                }
                IsCollapsed = dgCreditorTrans.IsMasterRowExpanded(0);
                SetExpandAndCollapse(IsCollapsed);
                break;

            case "ViewDownloadRow":
                var selectedItem = dgChildCreditorTrans.SelectedItem as CreditorTransClientTotal;
                if (selectedItem != null)
                {
                    DebtorTransactions.ShowVoucher(dgChildCreditorTrans.syncEntity, api, busyIndicator);
                }
                break;

            case "ViewTransactions":
                var item = dgChildCreditorTrans.SelectedItem as CreditorTransClientTotal;
                if (item != null)
                {
                    AddDockItem(TabControls.AccountsTransaction, item, string.Format("{0} : {1}", Uniconta.ClientTools.Localization.lookup("CreditorTransactions"), item._Account));
                }
                break;

            case "VoucherTransactions":
                var selItem = dgChildCreditorTrans.SelectedItem as CreditorTransClientTotal;
                if (selItem != null)
                {
                    AddDockItem(TabControls.AccountsTransaction, dgChildCreditorTrans.syncEntity, string.Format("{0} ({1})", Uniconta.ClientTools.Localization.lookup("VoucherTransactions"), selItem._Voucher));
                }
                break;

            case "CreditorFilter":
                if (creditorFilterDialog == null)
                {
                    if (creditorFilterCleared)
                    {
                        creditorFilterDialog = new CWServerFilter(api, typeof(CreditorClient), null, null, CreditorUserFields);
                    }
                    else
                    {
                        creditorFilterDialog = new CWServerFilter(api, typeof(CreditorClient), null, null, CreditorUserFields);
                    }
                    creditorFilterDialog.Closing += creditorFilterDialog_Closing;
#if !SILVERLIGHT
                    creditorFilterDialog.Show();
                }
                else
                {
                    creditorFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                creditorFilterDialog.Show();
#endif
                break;
        private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "ExpandAndCollapse":
                if (dgDebtorTrans.ItemsSource == null)
                {
                    return;
                }
                SetExpandAndCollapse(dgDebtorTrans.IsMasterRowExpanded(0));
                break;

            case "ViewDownloadRow":
                var selectedItem = childDgDebtorTrans.SelectedItem as DebtorTransClientTotal;
                if (selectedItem != null)
                {
                    DebtorTransactions.ShowVoucher(childDgDebtorTrans.syncEntity, api, busyIndicator);
                }
                break;

            case "SendAsEmail":
                if (dgDebtorTrans.ItemsSource == null)
                {
                    UnicontaMessageBox.Show(Uniconta.ClientTools.Localization.lookup("zeroRecords"), Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK);
                    return;
                }
                SendMail();
                break;

            case "ViewTransactions":
                var item = childDgDebtorTrans.SelectedItem as DebtorTransClientTotal;
                if (item != null)
                {
                    AddDockItem(TabControls.AccountsTransaction, item, string.Format("{0} : {1}", Uniconta.ClientTools.Localization.lookup("DebtorTransactions"), item._Account));
                }
                break;

            case "VoucherTransactions":
                var selItem = childDgDebtorTrans.SelectedItem as DebtorTransClientTotal;
                if (selItem != null)
                {
                    AddDockItem(TabControls.AccountsTransaction, childDgDebtorTrans.syncEntity, string.Format("{0} ({1})", Uniconta.ClientTools.Localization.lookup("VoucherTransactions"), selItem._Voucher));
                }
                break;

            case "DebtorFilter":

                if (debtorFilterDialog == null)
                {
                    if (debtorFilterCleared)
                    {
                        debtorFilterDialog = new CWServerFilter(api, typeof(DebtorClient), null, null, DebtorUserFields);
                    }
                    else
                    {
                        debtorFilterDialog = new CWServerFilter(api, typeof(DebtorClient), null, null, DebtorUserFields);
                    }
                    debtorFilterDialog.Closing += debtorFilterDialog_Closing;
#if !SILVERLIGHT
                    debtorFilterDialog.Show();
                }
                else
                {
                    debtorFilterDialog.Show(true);
                }
#elif SILVERLIGHT
                }
                debtorFilterDialog.Show();
#endif
                break;
        public void OpenFilterDialog()
        {
            try
            {
                if (!string.IsNullOrEmpty(selectedDataSourceName) && tableType != null)
                {
                    if (lstOfFilters.ContainsKey(selectedDataSourceName))
                    {
                        filterValues = lstOfFilters[selectedDataSourceName];
                    }
                    else
                    {
                        filterValues = null;
                    }

                    List <FilterProperties> filterProps;
                    if (lstOfNewFilters.ContainsKey(selectedDataSourceName))
                    {
                        filterProps = lstOfNewFilters[selectedDataSourceName];
                    }
                    else
                    {
                        filterProps = null;
                    }

                    if (lstOfSorters.ContainsKey(selectedDataSourceName))
                    {
                        PropSort = lstOfSorters[selectedDataSourceName];
                    }
                    else
                    {
                        PropSort = null;
                    }
                    Filter[]            filters = null;
                    SortingProperties[] sorters = null;
                    //if (filterValues != null)
                    //    filters = Utility.CreateDefaultFilter(filterValues, tableType);
                    if (filterValues != null)
                    {
                        filters = filterProps.Select(p => new Filter()
                        {
                            name = p.PropertyName, value = p.UserInput, parameterType = p.ParameterType
                        }).ToArray();
                    }
                    if (PropSort != null)
                    {
                        sorters = Utility.CreateDefaultSort(PropSort);
                    }
                    var fixedComp = fixedCompanies?.FirstOrDefault(x => x.DatasourceName == selectedDataSourceName);
                    if (fixedComp == null || this.company.CompanyId == fixedComp.CompanyId)
                    {
                        filterDialog = new CWServerFilter(api, tableType, filters, sorters, null);
                    }
                    else
                    {
                        var comp    = CWDefaultCompany.loadedCompanies.FirstOrDefault(x => x.CompanyId == fixedComp.CompanyId) as Company;
                        var compApi = new CrudAPI(api.session, comp);
                        filterDialog = new CWServerFilter(compApi, tableType, filters, sorters, null);
                    }
                    filterDialog.Closing += FilterDialog_Closing;
                    filterDialog.Show();
                }
            }
            catch (Exception ex)
            {
                UnicontaMessageBox.Show(ex);
            }
        }