Beispiel #1
0
        void Init(GLClosingSheet sheet)
        {
            this.DataContext = this;
            InitializeComponent();
            cmbFromAccount.api = cmbToAccount.api = api;
            SetRibbonControl(localMenu, dgGLTrans);
            localMenu.OnItemClicked += LocalMenu_OnItemClicked;

            if (AccountStatement.DefaultFromDate == DateTime.MinValue)
            {
                var now = BasePage.GetSystemDefaultDate();
                AccountStatement.DefaultToDate   = now;
                AccountStatement.DefaultFromDate = now.AddDays(1 - now.Day).AddMonths(-2);
            }
            var Pref = api.session.Preference;

            cbxAscending.IsChecked = Pref.Debtor_isAscending;
            cbxSkipBlank.IsChecked = Pref.Debtor_skipBlank;
#if !SILVERLIGHT
            cbxPageBreak.IsChecked = pageBreak;
            dgGLTrans.PageBreak    = pageBreak;
#endif
            cmbShowDimOnPrimo.ItemsSource   = new string[] { Uniconta.ClientTools.Localization.lookup("OnePrimo"), Uniconta.ClientTools.Localization.lookup("PrimoPerDim"), Uniconta.ClientTools.Localization.lookup("NoPrimo") };
            cmbShowDimOnPrimo.SelectedIndex = setShowDimOnPrimoIndex;
            txtDateTo.DateTime  = AccountStatement.DefaultToDate;
            txtDateFrm.DateTime = AccountStatement.DefaultFromDate;
            GetMenuItem();

            var Comp = api.CompanyEntity;
            if (Comp.RoundTo100)
            {
                Debit.HasDecimals = Credit.HasDecimals = Amount.HasDecimals = AmountBase.HasDecimals = AmountVat.HasDecimals = false;
            }

            accountCache = Comp.GetCache(typeof(Uniconta.DataModel.GLAccount));
            InitialLoad();
            dgGLTrans.RowDoubleClick      += DgGLTrans_RowDoubleClick;
            dgGLTrans.SelectedItemChanged += DgGLTrans_SelectedItemChanged;
            dgGLTrans.MasterRowExpanded   += DgGLTrans_MasterRowExpanded;
            dgGLTrans.MasterRowCollapsed  += DgGLTrans_MasterRowCollapsed;
            dgGLTrans.ShowTotalSummary();
#if SILVERLIGHT
            childDgGLTrans.CurrentItemChanged += ChildDgDebtorTrans_CurrentItemChanged;
#endif
            transApi = new Uniconta.API.GeneralLedger.ReportAPI(api);
            transApi.SetClosingSheet(sheet);

            if (_master != null)
            {
                cmbFromAccount.EditValue = _master._Account;
                cmbToAccount.EditValue   = _master._Account;
                LoadGLTrans();
            }
        }
Beispiel #2
0
 public GLAccountClosingSheetPage(UnicontaBaseEntity master)
     : base(master)
 {
     InitializeComponent();
     this.DataContext = this;
     masterRecord     = master as GLClosingSheet;
     postingApi       = new PostingAPI(api);
     rApi             = new Uniconta.API.GeneralLedger.ReportAPI(this.api);
     SetRibbonControl(localMenu, dgGLTable);
     dgGLTable.api      = api;
     localMenu.dataGrid = dgGLTable;
     dgGLTable.UpdateMaster(master);
     localMenu.OnItemClicked  += localMenu_OnItemClicked;
     dgGLTable.RowDoubleClick += dgGLTable_RowDoubleClick;
     dgGLTable.BusyIndicator   = busyIndicator;
     dgGLTable.View.DataControl.CurrentItemChanged += DataControl_CurrentItemChanged;
     ((TableView)dgGLTable.View).RowStyle           = Application.Current.Resources["RowStyle"] as Style;
 }