public void Run(Provider provider, CategoryBase category) { int?providerId = null; int?categoryId = null; if (provider != null) { providerId = provider.ID; } if (category != null) { categoryId = category.ID; } #if !DEBUG // Indicates which method to execute ProcessItem processItem = new ProcessItem(Guid.NewGuid().ToString()); processItem.AssemblyName = typeof(PriceCalculator).Assembly.FullName; processItem.ClassName = typeof(PriceCalculator).FullName; processItem.ConstructorParameters = new object[] { true, MembershipHelper.GetUser().UserId }; processItem.MethodName = "Run"; processItem.MethodParameters = new object[] { providerId, categoryId }; // Add the task for processing whenever possible DynamicProcessorRemoting processor = (DynamicProcessorRemoting)Activator.GetObject(typeof(DynamicProcessorRemoting), Config.RemotingProcessor); processor.AddTask(processItem); #else new PriceCalculator(true, MembershipHelper.GetUser().UserId).Run(providerId, categoryId); #endif }
private void RunOffline(bool trackChanges, object[] parameters) { // Indicates which method to execute string id = Guid.NewGuid().ToString(); ProcessItem processItem = new ProcessItem(id); processItem.AssemblyName = typeof(PriceCalculator).Assembly.FullName; processItem.ClassName = typeof(PriceCalculator).FullName; processItem.ConstructorParameters = new object[] { trackChanges, MembershipHelper.GetUser().UserId }; processItem.MethodName = "Run"; processItem.MethodParameters = parameters; // Add the task for processing whenever possible DynamicProcessorRemoting processor = (DynamicProcessorRemoting)Activator.GetObject(typeof(DynamicProcessorRemoting), Config.RemotingProcessor); processor.AddTask(processItem); }
public void Run(MasterPriceSearchParameters mpsp, GridState gs, Currency currency, PriceBaseStatus status) { #if !DEBUG // Indicates which method to execute string id = Guid.NewGuid().ToString(); ProcessItem processItem = new ProcessItem(id); processItem.AssemblyName = typeof(PriceCalculator).Assembly.FullName; processItem.ClassName = typeof(PriceCalculator).FullName; processItem.ConstructorParameters = new object[] { true, MembershipHelper.GetUser().UserId }; processItem.MethodName = "Run"; processItem.MethodParameters = new object[] { mpsp, gs, currency, status }; // Add the task for processing whenever possible DynamicProcessorRemoting processor = (DynamicProcessorRemoting)Activator.GetObject(typeof(DynamicProcessorRemoting), Config.RemotingProcessor); processor.AddTask(processItem); #else new PriceCalculator(true, MembershipHelper.GetUser().UserId).Run(mpsp, gs, currency, status); #endif }
public void ImportOffLine(Guid id) { // Change the status to indicate we are processing this import file PriceImport pi = GetById(id); // Indicates which method to execute ProcessItem processItem = new ProcessItem(id.ToString()); processItem.AssemblyName = typeof(PriceImportController).Assembly.FullName; processItem.ClassName = typeof(PriceImportController).FullName; processItem.ConstructorParameters = new object[] { this.SessionFactoryConfigPath.Replace("~/", "") }; processItem.MethodName = "Import"; processItem.MethodParameters = new object[] { id, MembershipHelper.GetUser().UserId }; // Add the task for processing whenever possible DynamicProcessorRemoting processor = (DynamicProcessorRemoting)Activator.GetObject(typeof(DynamicProcessorRemoting), Config.RemotingProcessor); if (processor.AddTask(processItem)) { pi.ImportStatus = ImportStatus.SendToExecute; Save(pi); } }