コード例 #1
0
    public void InitializeTreeListNode(String title, iSabaya.TreeListNode rootNode, String pattern)
    {
        this.Title    = title;
        this.RootNode = rootNode;
        this.Pattern  = pattern;

        popupTreeList.HeaderText = this.Title;
        if (null == this.RootNode)
        {
            return;
        }
        IList <iSabaya.TreeListNode> tnodes;
        IList <iSabaya.TreeListNode> childrenNodes = this.RootNode.Children;

        if (this.checkIsActive)
        {
            childrenNodes = new List <iSabaya.TreeListNode>();
            foreach (iSabaya.TreeListNode node in this.RootNode.Children)
            {
                if (node.IsActive == IsActive)
                {
                    childrenNodes.Add(node);
                }
            }
        }

        //rootNode.Children.GetType().GetProperty();
        if (String.IsNullOrEmpty(pattern))
        {
            tnodes = childrenNodes;
        }

        else
        {
            tnodes = new List <iSabaya.TreeListNode>();
            Regex regExp = new Regex(pattern + ".*");
            foreach (iSabaya.TreeListNode n in childrenNodes)
            {
                if (regExp.IsMatch(n.Code.ToString()))
                {
                    tnodes.Add(n);
                }
            }
        }

        IList <WebHelper.Node> nodes = new List <WebHelper.Node>();

        foreach (iSabaya.TreeListNode n in tnodes)
        {
            nodes.Add(new WebHelper.Node(n.ToString(iSabayaContext.CurrentLanguage.Code), n.NodeID, n.Code, n.Parent == null ? 0 : n.Parent.NodeID));
            if (n.Children.Count > 0)
            {
                addChildren(nodes, n);
            }
        }

        treeList.DataSource = nodes;
        treeList.DataBind();
        //treeList.ExpandAll();
    }
コード例 #2
0
    protected void cbSelect_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e)
    {
        iSabaya.TreeListNode node = iSabaya.TreeListNode.Find(iSabayaContext, int.Parse(e.Parameter));
        SelectedNode = node;
        JsonObjectCollection obj = new JsonObjectCollection();

        obj.Add(new JsonStringValue("NodeId", node.NodeID + ""));
        obj.Add(new JsonStringValue("Desc", node.ToString(iSabayaContext.CurrentLanguage.Code)));
        obj.Add(new JsonStringValue("ParentDesc", node.Parent.ToString(iSabayaContext.CurrentLanguage.Code)));
        obj.Add(new JsonStringValue("ParentId", node.Parent.NodeID.ToString()));
        e.Result = obj.ToString();
    }
コード例 #3
0
 private void addChildren(IList <WebHelper.Node> nodes, iSabaya.TreeListNode n)
 {
     foreach (iSabaya.TreeListNode sn in n.Children)
     {
         if (null == sn.EffectivePeriod || sn.EffectivePeriod.Includes(DateTime.Now))
         {
             nodes.Add(new WebHelper.Node(sn.ToString(iSabayaContext.CurrentLanguage.Code), sn.NodeID, sn.Code, sn.Parent == null ? 0 : sn.Parent.NodeID));
             if (sn.Children.Count > 0)
             {
                 addChildren(nodes, sn);
             }
         }
     }
 }
コード例 #4
0
 public ScheduleSpecificDate(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval,
                             TreeListNode timeCategory, DateTime date, MultilingualString title)
     : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory, title)
 {
     this.date = date;
 }
コード例 #5
0
 public virtual IList <T> GetInstances(DateTime when, TreeListNode parentCategory)
 {
     return(GetInstances(this, when, parentCategory));
 }
コード例 #6
0
 public virtual bool ContainsCategoryParent(DateTime when, TreeListNode parentCategory)
 {
     return(ContainsCategoryParent(this, when, parentCategory));
 }
コード例 #7
0
 public IList <T> GetInstances(TreeListNode category)
 {
     return(GetInstances(this, category));
 }
コード例 #8
0
 public static T GetInstance(ICategorizedTemporalList <T> list, DateTime when, TreeListNode category)
 {
     foreach (T i in list)
     {
         ICategorizedTemporal item = (ICategorizedTemporal)i;
         if (item.EffectivePeriod.IsEffectiveOn(when) && item.Category == category)
         {
             return(i);
         }
     }
     return(default(T));
 }
コード例 #9
0
        public static PartyAddress FindEffectiveByPartyCategory(Context context, Party party, TreeListNode catNode)
        {
            DateTime  now  = DateTime.Now;
            ICriteria crit = context.PersistenceSession.CreateCriteria <PartyAddress>()
                             .Add(Expression.Le("EffectivePeriod.From", now))
                             .Add(Expression.Ge("EffectivePeriod.To", now))
                             .Add(Expression.Eq("Party", party))
                             .Add(Expression.Eq("Category", catNode));

            return(crit.UniqueResult <PartyAddress>());
        }
コード例 #10
0
        //protected IList<Relation> relations = new List<Relation>();
        //public virtual IList<Relation> Relations
        //{
        //    get { return relations; }
        //    set { this.relations = value; }
        //}

        #endregion persistent

        public virtual IList <Relation> ListRelation(Context context, DateTime onDate, TreeListNode category)
        {
            ICriteria crit = context.PersistenceSession.CreateCriteria <Relation>()
                             .Add(Expression.Le("EffectivePeriod.From", onDate))
                             .Add(Expression.Ge("EffectivePeriod.To", onDate))
                             .Add(Expression.Eq("Relationship", this));

            if (null != category)
            {
                crit.Add(Expression.Eq("Category", this));
            }
            return(crit.List <Relation>());
        }
コード例 #11
0
        public static IList <PartyIdentity> FindByPartyCatergory(Context context, Party party, TreeListNode category)
        {
            ICriteria crit = context.PersistenceSession.CreateCriteria(typeof(PartyIdentity));

            crit.Add(Expression.Eq("Party", party));
            crit.Add(Expression.Eq("Category", category));
            return(crit.List <PartyIdentity>());
        }
コード例 #12
0
 public PartyIdentity(Party party, TreeListNode identityCategory, String identityNo,
                      User user)
     : base(party, identityCategory, null, null, null, null, user)
 {
     this.IdentityNo = identityNo;
 }
コード例 #13
0
 public PartyIdentity(Party party, TreeListNode identityCategory, String identityNo, TimeInterval effectivePeriod)
     : base(party, identityCategory, null, null, null, effectivePeriod, null)
 {
     this.IdentityNo = identityNo;
 }
コード例 #14
0
 public static IList <Relation> GetRelations(Context context, Relationship relationship,
                                             object firstEntity, object secondEntity, TreeListNode category)
 {
     return(GetRelations(context, relationship, TimeInterval.MinDate, firstEntity, secondEntity, category));
 }
コード例 #15
0
        public static IList <Relation> GetRelations(Context context, Relationship relationship, DateTime effectiveDate,
                                                    object firstEntity, object secondEntity, TreeListNode category)
        {
            ICriteria relationCriteria = context.PersistenceSession.CreateCriteria(typeof(Relation));

            if (relationship != null)
            {
                relationCriteria.Add(Expression.Eq("Relationship", relationship));
            }
            if (firstEntity != null)
            {
                relationCriteria.Add(Expression.Eq("FirstEntity", firstEntity));
            }
            if (secondEntity != null)
            {
                relationCriteria.Add(Expression.Eq("SecondEntity", secondEntity));
            }
            if (category != null)
            {
                relationCriteria.Add(Expression.Eq("Category", category));
            }
            if (effectiveDate > TimeInterval.MinDate && effectiveDate < TimeInterval.MaxDate)
            {
                relationCriteria.Add(Expression.Le("EffectivePeriod.To", effectiveDate));
                relationCriteria.Add(Expression.Ge("EffectivePeriod.From", effectiveDate));
            }
            return(relationCriteria.List <Relation>());
        }
コード例 #16
0
 public ScheduleYearlyOnDate(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval,
                             TreeListNode timeCategory, DateTime date)
     : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory)
 {
     this.date = date;
 }
コード例 #17
0
 public PartyAddress(Party party, TreeListNode addressCategory, GeographicAddress address)
     : base(party, null, null, null, null, TimeInterval.EffectiveNow, null)
 {
     this.address = address;
 }
コード例 #18
0
 public virtual PartyAddress GetCurrentAddress(TreeListNode category)
 {
     return(GetAddress(category, DateTime.Now));
 }
コード例 #19
0
 public virtual PartyIdentity GetCurrentIdentity(TreeListNode category)
 {
     return(GetIdentity(category, DateTime.Now));
 }
コード例 #20
0
 public virtual PartyCategory GetCurrentCategory(TreeListNode categoryRootNode, TreeListNode categoryParentNode)
 {
     return(GetCategory(categoryRootNode, categoryParentNode, DateTime.Now));
 }
コード例 #21
0
 public ScheduleMonthlyOnDayOfWeek(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval,
                                   TreeListNode timeCategory, int weekOfMonth, DayOfWeek dayOfWeek)
     : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory, dayOfWeek)
 {
     this.WeekOfMonth = weekOfMonth;
 }
コード例 #22
0
 public ScheduleWeekly(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval,
                       TreeListNode timeCategory, DayOfWeek dayOfWeek)
     : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory, dayOfWeek)
 {
 }
コード例 #23
0
        public static IList <T> GetInstances(ICategorizedTemporalList <T> list, DateTime when, TreeListNode parentCategory)
        {
            CategorizedTemporalList <T> matches = new CategorizedTemporalList <T>();

            foreach (T i in list)
            {
                ICategorizedTemporal item = (ICategorizedTemporal)i;
                if (item.EffectivePeriod.IsEffectiveOn(when) && item.Category.Parent == parentCategory)
                {
                    matches.Add(i);
                }
            }
            return(matches);
        }
コード例 #24
0
 public PartyCategory(Party party, TreeListNode category)
     : base(party, category, null, null, null, null, null)
 {
 }
コード例 #25
0
 public virtual bool ContainsCategory(DateTime when, TreeListNode category)
 {
     return(ContainsCategory(this, when, category));
 }
コード例 #26
0
 public PartyCategory(Party party, TreeListNode category, string description, string reference,
                      string remark, TimeInterval effectivePeriod, User user)
     : base(party, category, description, reference, remark, effectivePeriod, user)
 {
 }
コード例 #27
0
 public virtual T GetInstance(DateTime when, TreeListNode category)
 {
     return(GetInstance(this, when, category));
 }
コード例 #28
0
 public static IList <PartyCategory> Find(Context context, TreeListNode category)
 {
     return(context.PersistenceSession.CreateCriteria <PartyCategory>()
            .Add(Expression.Eq("Category", category))
            .List <PartyCategory>());
 }
コード例 #29
0
        public static bool ContainsCategoryParent(ICategorizedTemporalList <T> list, DateTime when, TreeListNode parentCategory)
        {
            bool exist = false;

            foreach (T i in list)
            {
                ICategorizedTemporal item = (ICategorizedTemporal)i;
                if (item.EffectivePeriod.IsEffectiveOn(when) && item.Category.Parent == parentCategory)
                {
                    exist = true;
                    break;
                }
            }
            return(exist);
        }
コード例 #30
0
 public virtual IList <PersonOrgRelation> ListPersonOrgRelations(Context context, TreeListNode category, Person person, DateTime onDate)
 {
     return(context.PersistenceSession
            .QueryOver <PersonOrgRelation>()
            .Where(r => r.Organization == this &&
                   r.RelationshipCategory == category &&
                   r.Person == person &&
                   r.EffectivePeriod.From <= onDate &&
                   r.EffectivePeriod.To >= onDate)
            .List());
 }