private void AddConfirmCommandToExecute() { var cmd = new ConfirmActivityCommand(); cmd.CommandCreatedDateTime = DateTime.Now; cmd.CommandGeneratedByCostCentreApplicationId = DocumentIssuerCostCentreApplicationId; cmd.CommandGeneratedByCostCentreId = FieldClerk.Id; cmd.CommandId = Guid.NewGuid(); cmd.Description = Description; cmd.DocumentId = Id; _AddCommand(cmd); }
public void Execute(ConfirmActivityCommand command) { _log.InfoFormat("Execute ConfirmActivityCommandHandler - Command Id {0} ", command.CommandId); _log.InfoFormat("Execute {1} - Command Id {0} ", command.CommandId, command.GetType().ToString()); try { tblActivityDocument doc = _context.tblActivityDocument.FirstOrDefault(s => s.Id == command.DocumentId); if (doc==null) return; doc.IM_Status = 1; _context.SaveChanges(); } catch (Exception ex) { _log.ErrorFormat("Error Execute {1} - Command Id {0} ", command.CommandId, command.GetType().ToString()); _log.Error("ConfirmActivityCommandHandler exception ", ex); throw; } }