Exemplo n.º 1
0
        public static PlanCertificate ClearValues([NotNull] this PlanCertificate obj)
        {
            var ob = obj.MapTo <PlanCertificateDto>();

            ob.Rn = 0;
            ob.CertificateQuality = ob.CertificateQuality.ClearValues();
            ob.PersonalAccounts   = null;
            ob.State = PlanCertificateState.NotСonfirm;
            return(ob.MapTo <PlanCertificate>());
        }
Exemplo n.º 2
0
        public void Test2()
        {
            var pc  = new PlanCertificate();
            var pro = new PlanReceiptOrder();
            var pa  = new PlanReceiptOrderPersonalAccount();

            //var openStateMachine = new StateMachine<PlanCertificateState, ITrigger>(
            //    () => pc.State,
            //    state => pc.State = state);

//            openStateMachine.Configure(PlanCertificateState.Close)
//                .Permit(
//                    pro.WhenAnyValue(x => x.State)
//                        .Where(state => state == PlanReceiptOrderState.Close)
//                        .Select(_ => Unit.Default),
//                    PlanCertificateState.Close)
//                .Permit(
//                    pro.WhenAnyValue(x => x.State)
//                        .Where(state => state == PlanReceiptOrderState.Confirm)
//                        .Select(_ => Unit.Default),
//                    PlanCertificateState.Confirm);
        }
Exemplo n.º 3
0
        public void InsertTest()
        {
            var filterFactory            = Bootstrapper.IoC.GetExportedValue <IFilterViewModelFactory>();
            var routableViewModelManager = Bootstrapper.IoC.GetExportedValue <IRoutableViewModelManager>();
            var viewModel = routableViewModelManager.Get <IEditablePlanCertificateViewModel>();

            var planCertificate = new PlanCertificate
            {
                CertificateQuality = this.GetCertificateQuality(filterFactory),
                CountByDocument    = 1,
                CreationDate       = new DateTime(2013, 2, 2),
                Note             = "sd",
                StateDate        = new DateTime(2013, 2, 2),
                PlanReceiptOrder = GetPlanReceiptOrder(filterFactory),
                Price            = 1,
                UserCreator      = GetUser(filterFactory),
                CountFact        = 3,
                State            = PlanCertificateState.Close
            };

            viewModel.SetEditableObject(planCertificate, EditState.Insert);
            ((EditableContext <PlanCertificate>)viewModel).Wait();
        }
Exemplo n.º 4
0
 public PlanCertificateSetGroupState(PlanCertificate planCertificate, PersonalAccount personalAccount)
 {
     Rn = planCertificate.Rn;
     PersonalAccount = personalAccount.Numb;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlanCertificateSetStateSP"/> class.
 /// </summary>
 /// <param name="certificate">
 /// The certificate.
 /// </param>
 /// <param name="state">
 /// The state.
 /// </param>
 public PlanCertificateSetStateSP(PlanCertificate certificate, PlanCertificateState state)
 {
     Rn    = certificate.Rn;
     State = state;
 }
 public СonfirmStateFalling(PlanCertificate entity, IRepositoryFactory repositoryFactory, IPlanCertificateState strategy = null)
     : base(entity, repositoryFactory)
 {
     _strategy          = strategy;
     _repositoryFactory = repositoryFactory;
 }
 protected СonfirmStateBase(PlanCertificate entity, IRepositoryFactory repositoryFactory)
     : base(entity, repositoryFactory)
 {
 }
 public NotСonfirmState(PlanCertificate entity, IRepositoryFactory repositoryFactory)
     : base(entity, repositoryFactory)
 {
 }
 public СloseStateEmerge(PlanCertificate entity, IRepositoryFactory repositoryFactory)
     : base(entity, repositoryFactory)
 {
     _repositoryFactory = repositoryFactory;
 }
 public EntityBase(PlanCertificate entity, IRepositoryFactory repositoryFactory)
 {
     _repository = repositoryFactory.Create <PlanCertificate>();
     Entity      = entity;
 }
 public СloseStateBase(PlanCertificate entity, IRepositoryFactory repositoryFactory)
     : base(entity, repositoryFactory)
 {
 }