Пример #1
0
        private void LocalMenu_OnItemClicked(string ActionType)
        {
            switch (ActionType)
            {
            case "RegenerateOrder":
                RegenerateOrderFromProjectTrans();
                break;

            case "AppendProjTrans":
                var defaultdate = BasePage.GetSystemDefaultDate().Date;
                var cw          = new CWInterval(DateTime.MinValue, defaultdate);
                cw.Closing += delegate
                {
                    if (cw.DialogResult == true)
                    {
                        LoadNotInvoiced(cw.FromDate, cw.ToDate);
                    }
                };
                cw.Show();
                break;

            default:
                gridRibbon_BaseActions(ActionType);
                break;
            }
        }
        private void localMenu_OnItemClicked(string ActionType)
        {
            var selectedItem = dgGLTransExported.SelectedItem as GLTransExportedClient;

            switch (ActionType)
            {
            case "NewExport":
                var today   = GetSystemDefaultDate();
                var lst     = (ICollection <GLTransExportedClient>)dgGLTransExported.ItemsSource;
                var maxDate = (lst != null && lst.Count > 0) ? (from rec in lst select rec._ToDate).Max() : today.AddYears(-1).AddDays(-today.Day);

                var        start       = maxDate.AddDays(1);
                var        end         = start.AddMonths(1).AddDays(-1);
                CWInterval winInterval = new CWInterval(start, end);
                winInterval.Closed += delegate
                {
                    if (winInterval.DialogResult == true)
                    {
                        var glTransExported = new GLTransExportedClient();
                        glTransExported.SetMaster(api.CompanyEntity);
                        glTransExported._FromDate = winInterval.FromDate;
                        glTransExported._ToDate   = winInterval.ToDate;
                        AddDockItem(TabControls.GLTransPage, new object[] { glTransExported, "NewExport" }, Uniconta.ClientTools.Localization.lookup("AccountsTransaction"));
                    }
                };
                winInterval.Show();
                break;

            case "DeleteExport":
                if (selectedItem != null)
                {
                    DeleteRecord(selectedItem);
                }
                break;

            case "ShowExport":
                if (selectedItem != null)
                {
                    AddDockItem(TabControls.GLTransPage, new object[] { selectedItem, "ShowExport" }, Uniconta.ClientTools.Localization.lookup("AccountsTransaction"));
                }
                break;

            case "ShowSupplement":
                if (selectedItem != null && selectedItem._SuppJournalPostedId != 0)
                {
                    AddDockItem(TabControls.GLTransPage, new object[] { selectedItem, "ShowSupplement" }, Uniconta.ClientTools.Localization.lookup("SupplementaryTransactions"));
                }
                break;

            default:
                gridRibbon_BaseActions(ActionType);
                break;
            }
        }
        void setInterval()
        {
            CWInterval winInterval = new CWInterval(fromDate, toDate);

            winInterval.Closed += delegate
            {
                if (winInterval.DialogResult == true)
                {
                    fromDate = winInterval.FromDate;
                    toDate   = winInterval.ToDate;
                    SetStatusText();
                    saveGrid(true);
                }
            };
            winInterval.Show();
        }
Пример #4
0
        private void RemoveBankStatmentOrSettelements(string ActionType, BankStatementClient selectedItem)
        {
            var        text        = string.Format("{0}: {1}, {2}", Uniconta.ClientTools.Localization.lookup("BankStatement"), selectedItem._Account, selectedItem._Name);
            var        defaultdate = BasePage.GetSystemDefaultDate().Date;
            CWInterval Wininterval = new CWInterval(defaultdate, defaultdate, showJrPostId: true);

            Wininterval.Closing += delegate
            {
                if (Wininterval.DialogResult == true)
                {
                    EraseYearWindow erWindow = new EraseYearWindow(text, false);
                    erWindow.Closing += async delegate
                    {
                        if (erWindow.DialogResult == true)
                        {
                            BankStatementAPI bkapi  = new BankStatementAPI(api);
                            ErrorCodes       result = ErrorCodes.NoSucces;

                            if (ActionType == "DeleteStatement")
                            {
                                result = await bkapi.DeleteLines(selectedItem, Wininterval.FromDate, Wininterval.ToDate, OnlyVoided : Wininterval.OnlyVoided);
                            }
                            else if (ActionType == "RemoveSettlements")
                            {
                                result = await bkapi.RemoveSettlements(selectedItem, Wininterval.FromDate, Wininterval.ToDate, Wininterval.JournalPostedId, Wininterval.Voucher);
                            }

                            if (result != ErrorCodes.Succes)
                            {
                                UtilDisplay.ShowErrorCode(result);
                            }
                        }
                    };
                    erWindow.Show();
                }
            };
            Wininterval.Show();
        }