Пример #1
0
        public CCCollection(CCreator parent, ITisClientServicesModule csm, ITisCollectionData collection)
#endif
            : base(parent, collection != null? collection.Name:String.Empty,
                   parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(collection) : null,
                   parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(collection, false) : null,
                   parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(collection, true) : null)
        {
            try
            {
                Priority         = WorkflowPriorityLevel.Normal;
                FlowType         = String.Empty;
                TargetQueue      = String.Empty;
                LoginApplication = String.Empty;
                LoginStation     = String.Empty;
                ImagePath        = String.Empty;

                if (forms == null)
                {
                    forms = new List <CCForm>();
                }
                else
                {
                    forms.Clear();
                }

                this.LoginStation     = csm.Session.StationName;
                this.LoginApplication = csm.Application.AppName;
                this.ParentCollection = collection;
                this.FlowType         = collection.FlowType;
                this.EflowOwner       = collection;
                this.ImagePath        = collection.GetAttachmentFileName(CCEnums.CCFilesExt.TIF.ToString());

                #region remove the collection image path from the attachments.
                List <String> att = new List <string>();
                att.AddRange(CCUtils.GetAttachments(csm, collection.AttachedFileManager));

                for (int ia = att.Count - 1; ia >= 0; ia--)
                {
                    if (String.Compare(Path.GetFileName(att[ia]), this.ImagePath, true) == 0)
                    {
                        att.RemoveAt(ia);
                    }
                }
                #endregion

                this.Attachments = att.ToArray();

                this.Priority = collection.PriorityLevel;

                //-- Create forms --\\
                foreach (ITisFormData frm in collection.Forms)
                {
                    forms.Add(new CCForm(this.ParentCreator, frm));
                }
            }
            catch (Exception ex)
            {
                ILog.LogError(ex);
            }
        }
Пример #2
0
            internal CCFieldArray(CCreator parent, ITisFieldArrayData fieldArray)
                : this(parent, fieldArray != null? fieldArray.Name:String.Empty,
                       parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(fieldArray) : null,
                       parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(fieldArray, false) : null,
                       parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(fieldArray, true) : null)
            {
                this.EflowOwner       = fieldArray;
                this.ParentCollection = fieldArray.ParentCollection;
                this.ParentForm       = fieldArray.ParentForm;
                this.ParentPage       = fieldArray.ParentPage;
                this.ParentGroup      = fieldArray.ParentFieldGroup;
                this.ParentTable      = fieldArray.ParentFieldTable;
                this.NamedParent      = fieldArray.ParentFieldTable.Name;

                if (fields == null)
                {
                    fields = new List <CCField>();
                }
                else
                {
                    fields.Clear();
                }

                foreach (ITisFieldData fd in fieldArray.LinkedFields)
                {
                    fields.Add(new CCField(this.ParentCreator, fd));
                }
            }
Пример #3
0
            public CCTable(CCreator parent, ITisFieldTableData fieldTable)
#endif
                : this(parent, fieldTable.Name,
                       parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(fieldTable) : null,
                       parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(fieldTable, false) : null,
                       parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(fieldTable, true) : null)
            {
                this.EflowOwner       = fieldTable;
                this.ParentCollection = fieldTable.ParentCollection;
                this.ParentForm       = fieldTable.ParentForm;
                this.ParentPage       = fieldTable.ParentPage;
                this.ParentGroup      = fieldTable.ParentFieldGroup;
                this.NamedParent      = fieldTable.ParentFieldGroupExists ? fieldTable.ParentFieldGroup.Name : String.Empty;

                List <CCFieldArray> fas = new List <CCFieldArray>();

                if (fieldArrays == null)
                {
                    fieldArrays = new List <CCFieldArray>();
                }
                else
                {
                    fieldArrays.Clear();
                }

                foreach (ITisFieldArrayData fa in fieldTable.FieldArrays)
                {
                    fieldArrays.Add(new CCFieldArray(this.ParentCreator, fa));
                }
            }
Пример #4
0
            public CCForm(CCreator parent, ITisFormData form)
#endif
                : base(parent, form != null? form.Name:String.Empty,
                       parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(form) : null,
                       parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(form, false) : null,
                       parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(form, true) : null)
            {
                try
                {
                    if (pages == null)
                    {
                        pages = new List <CCPage>();
                    }
                    else
                    {
                        pages.Clear();
                    }

                    this.ParentCollection = form.ParentCollection;
                    this.FormType         = form.FormType;
                    this.EflowOwner       = form;
                    this.NamedParent      = form.ParentCollection.Name;

                    foreach (ITisPageData pg in form.LinkedPages)
                    {
                        pages.Add(new CCPage(this.ParentCreator, pg));
                    }
                }
                catch (Exception ex)
                {
                    ILog.LogError(ex);
                }
            }
Пример #5
0
            public CCField(CCreator parent, ITisFieldData field) :
#endif
                this(parent, field != null? field.Name:String.Empty, field != null? field.Contents:String.Empty, field != null? field.Confidence:short.MinValue, field != null? field.FieldBoundingRect:new TIS_RECT(),
                     parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(field) : null,
                     parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(field, false) : null,
                     parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(field, true) : null)
            {
                this.EflowOwner       = field;
                this.ParentCollection = field.ParentCollection;
                this.ParentForm       = field.ParentForm;
                this.ParentPage       = field.ParentPage;
                this.ParentGroup      = field.ParentFieldGroup;
                this.ParentFieldArray = field.ParentFieldArray;
                this.Index            = field.TableRepetitionIndex;
                this.ParentTable      = field.ParentFieldTable;
                if (field.ParentFieldArrayExists)
                {
                    this.NamedParent = field.ParentFieldArray.Name;
                }
                else if (field.ParentFieldGroupExists)
                {
                    this.NamedParent = field.ParentFieldGroup.Name;
                }
            }
Пример #6
0
            public CCGroup(CCreator parent, ITisFieldGroupData group)
#endif
                : base(parent, group != null? group.Name:String.Empty,
                       parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(group) : null,
                       parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(group, false) : null,
                       parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(group, true) : null)
            {
                try
                {
                    if (fields == null)
                    {
                        fields = new List <CCField>();
                    }
                    else
                    {
                        fields.Clear();
                    }

                    if (tables == null)
                    {
                        tables = new List <CCTable>();
                    }
                    else
                    {
                        tables.Clear();
                    }

                    this.EflowOwner       = group;
                    this.ParentCollection = group.ParentCollection;
                    this.ParentForm       = group.ParentForm;
                    this.NamedParent      = group.ParentForm.Name;

                    List <String> fieldNames = new List <String>();
                    foreach (ITisFieldData fld in group.LinkedFields)
                    {
                        if (fieldNames.Contains(fld.Name.ToUpper()))
                        {
                            continue;
                        }
                        if (this.ParentPage == null)
                        {
                            this.ParentPage = fld.ParentPage;
                        }
                        fields.Add(new CCField(this.ParentCreator, fld));
                        fieldNames.Add(fld.Name);
                    }

                    foreach (ITisFieldTableData fldTbl in group.LinkedFieldTables)
                    {
                        if (this.ParentPage == null)
                        {
                            this.ParentPage = fldTbl.ParentPage;
                        }
                        tables.Add(new CCTable(this.ParentCreator, fldTbl));
                    }
                }
                catch (Exception ex)
                {
                    ILog.LogError(ex);
                }
            }