Exemplo n.º 1
0
        /// <summary>
        /// [Static] Batch.CoreHistory() --> Used by the InternalHistory functions.
        /// </summary>
        private static void CoreHistory(ref List <string> result, ref ITisClientServicesModule csm, string CollectionName)
        {
            ITisCollectionData Collection = csm.Dynamic.GetSpecificCollection(CollectionName, false);

            if (csm != null)
            {
                if (Collection.NumberOfHistoryTags > 0)
                {
                    for (short j = 0; j < Collection.NumberOfHistoryTags; j++)
                    {
                        result.Add(Collection.GetHistoryDataTag(j).Name);
                    }
                }
            }

            csm.Dynamic.FreeSpecificCollection(Collection, true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Batch->InternalHistory() --> Returns a list of the stations a collection has gone through (when processed normally through the workflow).
        /// </summary>
        /// <param name="Collection">Is a ITisCollectionData object.</param>
        /// <returns>Returns a string array if the collection has any history, otherwise returns an empty array.</returns>
        /// <example><code>string[] history = b.InternalHistory(collData);</code></example>
        protected string[] InternalHistory(ITisCollectionData Collection)
        {
            List <string> result = new List <string>();

            if (Collection != null)
            {
                if (CheckLogon())
                {
                    try
                    {
                        if (Collection.NumberOfHistoryTags > 0)
                        {
                            for (short j = 0; j < Collection.NumberOfHistoryTags; j++)
                            {
                                //result.Add(Collection.get_HistoryDataTag(j).Name); 4.5
                                result.Add(Collection.GetHistoryDataTag(j).Name);
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        oCSM.Logger.RequestMessageLog(Constants.cStrLiteSdkBatch + Constants.cStrHistoryMethod + Constants.cStrFailedWithException +
                                                      ((e.InnerException != null) ? e.InnerException.ToString() : e.ToString()), Constants.cStrLiteSdk, Log.Severity.ERROR, 0, 0);
                    }
                }
                else
                if (oCSM != null)
                {
                    oCSM.Logger.RequestMessageLog(Constants.cStrLiteSdkBatch + Constants.cStrHistoryMethod + Constants.cStrCouldNotLogin,
                                                  Constants.cStrLiteSdk, Log.Severity.ERROR, 0, 0);
                }
                else
                {
                    throw new Exception(Constants.cStrLiteSdkBatch + Constants.cStrHistoryMethod + Constants.cStrCouldNotLogin);
                }
            }
            else
            if (oCSM != null)
            {
                oCSM.Logger.RequestMessageLog(Constants.cStrLiteSdkBatch + Constants.cStrHistoryMethod + Constants.cStrCollectionIsNull, Constants.cStrLiteSdk,
                                              Log.Severity.ERROR, 0, 0);
            }

            return(result.ToArray());
        }