Exemple #1
0
        void InitPage(CrudAPI crudapi, UnicontaBaseEntity master)
        {
            ribbonControl = frmRibbon;
            var Comp = api.CompanyEntity;

            BusyIndicator = busyIndicator;
            layoutControl = layoutItems;
            if (LoadedRow == null)
            {
                frmRibbon.DisableButtons("Delete");
                editrow = CreateNew() as DebtorPaymentMandateClient;
                editrow.SetMaster(master ?? api.CompanyEntity);
                var dc = master as Uniconta.DataModel.DCAccount;
                //if (dc != null)
                //    editrow._MandateId = dc._Account.ToString(); //TODO:Udfyld evt. MandateId med Kontonummer
            }
            lookupDCAccount.api      = crudapi;
            layoutItems.DataContext  = editrow;
            frmRibbon.OnItemClicked += frmRibbon_OnItemClicked;

            if (editrow.MandateId == 0) //TODO:TEST DENNE
            {
                liDCAccount.IsEnabled = true;
            }
            else
            {
                liDCAccount.IsEnabled = false;
            }

            if (master == null)
            {
                liDCAccount.Visibility = Visibility.Visible;
            }
        }
        void InitPage(CrudAPI crudapi, UnicontaBaseEntity master)
        {
            ribbonControl = frmRibbon;
            var Comp = api.CompanyEntity;

            BusyIndicator = busyIndicator;
            layoutControl = layoutItems;
            if (LoadedRow == null)
            {
                frmRibbon.DisableButtons("Delete");
                editrow = CreateNew() as DebtorPaymentMandateClient;
                editrow.SetMaster(master ?? api.CompanyEntity);
                var dc = master as Uniconta.DataModel.DCAccount;
            }
            lookupDCAccount.api      = crudapi;
            layoutItems.DataContext  = editrow;
            frmRibbon.OnItemClicked += frmRibbon_OnItemClicked;

            if (editrow.DCAccount == null)
            {
                liDCAccount.IsEnabled = true;
            }
            else
            {
                liDCAccount.IsEnabled = false;
            }

            if (editrow._Status == MandateStatus.None || editrow._Status == MandateStatus.Unregistered || editrow._Status == MandateStatus.Error)
            {
                liAltMandateId.IsEnabled = true;
            }
            else
            {
                liAltMandateId.IsEnabled = false;
            }


            if (master == null)
            {
                liDCAccount.Visibility = Visibility.Visible;
            }

            SetFields();
        }