Пример #1
0
 public void Submit(RetireDocumentCommand command, DocumentType documentType)
 {
     _commandRouter.RouteDocumentCommandWithOutSave(command);
     if (documentType == DocumentType.Order)
     {
         RetireDocument(command.DocumentId);
     }
     else if (documentType == DocumentType.ReturnsNote)
     {
         RemoveClosedReturnsDocument(command.DocumentId);
     }
 }
 public void Execute(RetireDocumentCommand command)
 {
    
 }
Пример #3
0
        private void Archive()
        {
            using (StructureMap.IContainer c1 = NestedContainer)
            {
                if (ArchiveItem.Count == 0)
                {
                    MessageBox.Show("No Ducuments to Archive", "Document Archiving ", MessageBoxButton.OKCancel);
                    return;
                }
                if (!ArchiveItem.Any(a => a.IsArchive))
                {
                    MessageBox.Show("Select Document to Archive", "Document Archiving ", MessageBoxButton.OKCancel);
                    return;
                }
                Config con = Using<IConfigService>(c1).Load();
                Guid userid = Using<IConfigService>(c1).ViewModelParameters.CurrentUserId;
                MessageBoxResult isConfirmed = MessageBox.Show("Are sure you want to archive these Document",
                                                               "Document Archiving ", MessageBoxButton.OKCancel);
                if (isConfirmed == MessageBoxResult.OK)
                {
                    foreach (var item in ArchiveItem.Where(s => s.IsArchive))
                    {
                        RetireDocumentCommand cmd = new RetireDocumentCommand(Guid.NewGuid(), item.OrderId, userid,
                                                                              item.IssuerCostCentreId, 0,
                                                                              con.CostCentreApplicationId,
                                                                              Guid.NewGuid(),
                                                                              item.RecipientCostCentreId, null, null);
                       Using<IRetireDocumentWFManager>(c1).Submit(cmd, (DocumentType) item.DocumentType);

                    }

                }
                MessageBox.Show("Document Archived successfully", "Order Archiving ", MessageBoxButton.OKCancel);
                LoadItemToArchive();
                
            }
        }
 public void Execute(RetireDocumentCommand command)
 {
     _commandRoutingOnRequestRepository.RetireEnvelopes(command.DocumentId);
 }
Пример #5
0
        private void TestRetire()
        {

            Distributor dist = _costCentreService.GetAll().OfType<Distributor>().FirstOrDefault();
            DistributorSalesman salesman = _costCentreService.GetAll().OfType<DistributorSalesman>().FirstOrDefault();
            Config con = _configService.Load();
            User user = _userService.GetByCostCentre(salesman.Id).First();
            RetireDocumentCommand cmd = new RetireDocumentCommand(Guid.NewGuid(), Guid.Parse("6AA572CB-EB09-4FC9-A760-89037C8DC7F6"), user.Id, dist.Id, 0,
                                                                  con.CostCentreApplicationId, Guid.NewGuid(),
                                                                  salesman.Id,null,null);
            //_retireDocumentWFManager.Submit(cmd);
            MessageBox.Show("RetireDocumentCommand note Done");

        }
Пример #6
0
 private static void TestArchivingCommand()
 {
     RetireDocumentCommand cmd = new RetireDocumentCommand();
     var route = ObjectFactory.GetInstance<IOutgoingDocumentCommandRouter>();
     var config = ObjectFactory.GetInstance<IConfigService>().Load();
     cmd.CommandGeneratedByCostCentreApplicationId = config.CostCentreApplicationId;
     cmd.CommandId = Guid.NewGuid();
     cmd.DocumentId = new Guid("71cba9ce-46d5-46b8-8448-2be79281055e");
    // cmd.ReciepientCostCentreId = Guid.NewGuid();
     route.RouteDocumentCommand(cmd);
 }