Esempio n. 1
0
        private string InvokeReplacement(string columnKey, string columnValue)
        {
            object instance = null;

            ReportsInvokeReplaceModel invokeModel = this.indexSqlManager[this.sectionIndex].InvokeReplacementColumnModels[columnKey];

            if (!this.invokeInstances.ContainsKey(columnKey))
            {
                Assembly asm = Assembly.LoadFile(invokeModel.SelectDll);

                Type executingType = asm.GetType(invokeModel.NamespaceValue);

                instance = Activator.CreateInstance(executingType);

                this.invokeInstances.Add(columnKey, instance);
            }
            else
            {
                instance = this.invokeInstances[columnKey];
            }

            string output = instance.InvokeMethod(
                instance,
                invokeModel.SelectedMethod,
                new object[] { columnValue }).ParseToString();

            return(output);
        }
Esempio n. 2
0
        internal void UpdateInvokeReplaceModel(ReportsInvokeReplaceModel invokeModel)
        {
            if (invokeModel == null)
            {
                return;
            }

            string itemKey = this.BuildItemKey(invokeModel.TableName, invokeModel.ColumnName);

            if (this.invokeMethods.ContainsKey(itemKey))
            {
                this.invokeMethods.Remove(itemKey);
            }

            if (invokeModel.SelectDll.IsNullEmptyOrWhiteSpace())
            {
                return;
            }

            this.invokeMethods.Add(itemKey, invokeModel);
        }
 public void UpdateInvokeReplaceModel(ReportsInvokeReplaceModel invokeModel)
 {
     this.SqlManager.UpdateInvokeReplaceModel(invokeModel);
 }