Exemplo n.º 1
0
        /// <summary>
        /// Stamp the specified collection with the CustomDll version..
        /// </summary>
        ///<param name="csm"></param>
        /// <param name="collection">The collection to stamp.</param>
        /// <param name="staticData">Data that is stored statically.</param>
        /// <returns>A string with the DLL version.</returns>
        public static string StampStationDll(ITisClientServicesModule csm, ITisCollectionData oColl, string staticData)
        {
            StringBuilder result = new StringBuilder();

            try
            {
                if (!Disabled && oColl != null)
                {
                    //-- Get previous data --\\
                    string appName = csm != null ? csm.Session.StationName : Path.GetFileNameWithoutExtension(Application.ExecutablePath);

                    result.Append(oColl.get_NamedUserTags("DLL_VERSION_" + appName));
                    if (result.Length > 0)
                    {
                        result.Append("\r\n");
                    }

                    //-- Add environment data --\\
                    result.Append(staticData ?? string.Empty);

                    result.Append(", Time=" + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"));

                    //-- Set DLL name and version --\\s
                    oColl.set_NamedUserTags("DLL_VERSION_" + appName, result.ToString());
                }
            }
            catch (Exception ex)
            {
                ILog.LogError(ex);
            }

            return(result.ToString());
        }
Exemplo n.º 2
0
            private static string GetFieldBatchInfoCore(string tmpUpFolder, string appName, string fToCheck, string fn, List <string> result,
                                                        ITisCollectionData cd, out string origin)
            {
                string res = String.Empty;

                origin = String.Empty;

                try
                {
                    try
                    {
                        origin = cd.get_NamedUserTags(Constants.SupplierPortalDomainTag);
                    }
                    catch { }

                    if (origin == String.Empty)
                    {
                        origin = Constants.eFlowOrigin;
                    }

                    foreach (ITisFormData fd in cd.Forms)
                    {
                        foreach (ITisFieldData fld in fd.Fields)
                        {
                            if (ExistsInPipeStr(true, fld.Name, fToCheck))
                            {
                                result.Add(fd.Name + "_" + fld.Name + "=" + fld.Contents.ToString());
                            }
                        }

                        foreach (ITisPageData pd in fd.LinkedPages)
                        {
                            string tfn = pd.GetAttachmentFileName(".tif");

                            fn = tfn.Substring(0, tfn.IndexOf("_")) + ".tif";

                            if (!Directory.Exists(tmpUpFolder))
                            {
                                Directory.CreateDirectory(tmpUpFolder);
                            }

                            string tmpFn = String.Empty;

                            if (File.Exists(fn))
                            {
                                tmpFn = Path.Combine(tmpUpFolder, Path.GetFileName(fn));
                            }
                            else
                            {
                                string origFn = Path.GetFileName(fn);
                                fn    = Path.Combine(tmpUpFolder, getFileInDynamic(appName, origFn));
                                tmpFn = Path.Combine(tmpUpFolder, Path.GetFileName(origFn));
                            }

                            if (!File.Exists(tmpFn))
                            {
                                File.Copy(fn, tmpFn);
                            }

                            fn = tmpFn;

                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logging.WriteLog(ex.ToString());
                }

                res = fn;

                return(res);
            }