Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
            public CCPage(CCreator parent, ITisPageData page)
#endif

                : base(parent, page != null? page.Name:String.Empty,
                       parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(page, false) : null,
                       parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(page, true) : null)
            {
                try
                {
                    if (groups == null)
                    {
                        groups = new List <CCGroup>();
                    }
                    else
                    {
                        groups.Clear();
                    }

                    this.Attachments      = CCUtils.GetAttachments(page);
                    this.EflowOwner       = page;
                    this.ParentCollection = page.ParentCollection;
                    this.ParentForm       = page.ParentForm;
                    this.PageID           = page.PageId;
                    this.NamedParent      = page.ParentFormExists ? page.ParentForm.Name : String.Empty;
                    List <String> grpNames = new List <String>();

                    foreach (ITisFieldData fld in page.LinkedFields)
                    {
                        if (grpNames.Contains(fld.ParentFieldGroup.Name.ToUpper()))
                        {
                            continue;
                        }
                        grpNames.Add(fld.ParentFieldGroup.Name.ToUpper());
                        groups.Add(new CCGroup(this.ParentCreator, fld.ParentFieldGroup));
                    }

                    foreach (ITisFieldTableData fldTbl in page.LinkedFieldTables)
                    {
                        if (grpNames.Contains(fldTbl.ParentFieldGroup.Name.ToUpper()))
                        {
                            continue;
                        }
                        grpNames.Add(fldTbl.ParentFieldGroup.Name.ToUpper());
                        groups.Add(new CCGroup(this.ParentCreator, fldTbl.ParentFieldGroup));
                    }
                }
                catch (Exception ex)
                {
                    ILog.LogError(ex);
                }
            }