Beispiel #1
0
        public virtual void CopyFrom(IWorkResource source)
        {
            if (source == null)
            {
                return;
            }

            OidResource = source.Oid;
            EntityType  = source.EntityType;
            Cost        = source.Cost;
            Resource    = source.Name;
            ResourceID  = source.ID;
        }
Beispiel #2
0
        public static WorkReportResource NewChild(WorkReport parent, IWorkResource item = null)
        {
            if (!CanAddObject())
            {
                throw new System.Security.SecurityException(Library.Resources.Messages.USER_NOT_ALLOWED);
            }

            WorkReportResource obj = DataPortal.Create <WorkReportResource>(new CriteriaCs(-1));

            obj.CopyFrom(parent);
            obj.CopyFrom(item);
            obj.MarkAsChild();
            return(obj);
        }
 public WorkReportResource GetItem(IWorkResource item)
 {
     return(this.FirstOrDefault <WorkReportResource>(x => (x.OidResource == item.Oid && x.EEntityType == item.EEntityType)));
 }
 public WorkReportResource NewItem(WorkReport parent, IWorkResource item)
 {
     this.AddItem(WorkReportResource.NewChild(parent, item));
     return(this[Count - 1]);
 }