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(); }
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(); }
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); } } } }
public ScheduleSpecificDate(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval, TreeListNode timeCategory, DateTime date, MultilingualString title) : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory, title) { this.date = date; }
public virtual IList <T> GetInstances(DateTime when, TreeListNode parentCategory) { return(GetInstances(this, when, parentCategory)); }
public virtual bool ContainsCategoryParent(DateTime when, TreeListNode parentCategory) { return(ContainsCategoryParent(this, when, parentCategory)); }
public IList <T> GetInstances(TreeListNode category) { return(GetInstances(this, category)); }
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)); }
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>()); }
//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>()); }
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>()); }
public PartyIdentity(Party party, TreeListNode identityCategory, String identityNo, User user) : base(party, identityCategory, null, null, null, null, user) { this.IdentityNo = identityNo; }
public PartyIdentity(Party party, TreeListNode identityCategory, String identityNo, TimeInterval effectivePeriod) : base(party, identityCategory, null, null, null, effectivePeriod, null) { this.IdentityNo = identityNo; }
public static IList <Relation> GetRelations(Context context, Relationship relationship, object firstEntity, object secondEntity, TreeListNode category) { return(GetRelations(context, relationship, TimeInterval.MinDate, firstEntity, secondEntity, category)); }
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>()); }
public ScheduleYearlyOnDate(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval, TreeListNode timeCategory, DateTime date) : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory) { this.date = date; }
public PartyAddress(Party party, TreeListNode addressCategory, GeographicAddress address) : base(party, null, null, null, null, TimeInterval.EffectiveNow, null) { this.address = address; }
public virtual PartyAddress GetCurrentAddress(TreeListNode category) { return(GetAddress(category, DateTime.Now)); }
public virtual PartyIdentity GetCurrentIdentity(TreeListNode category) { return(GetIdentity(category, DateTime.Now)); }
public virtual PartyCategory GetCurrentCategory(TreeListNode categoryRootNode, TreeListNode categoryParentNode) { return(GetCategory(categoryRootNode, categoryParentNode, DateTime.Now)); }
public ScheduleMonthlyOnDayOfWeek(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval, TreeListNode timeCategory, int weekOfMonth, DayOfWeek dayOfWeek) : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory, dayOfWeek) { this.WeekOfMonth = weekOfMonth; }
public ScheduleWeekly(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval, TreeListNode timeCategory, DayOfWeek dayOfWeek) : base(seqNo, rescheduleIfHoliday, hourInterval, timeCategory, dayOfWeek) { }
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); }
public PartyCategory(Party party, TreeListNode category) : base(party, category, null, null, null, null, null) { }
public virtual bool ContainsCategory(DateTime when, TreeListNode category) { return(ContainsCategory(this, when, category)); }
public PartyCategory(Party party, TreeListNode category, string description, string reference, string remark, TimeInterval effectivePeriod, User user) : base(party, category, description, reference, remark, effectivePeriod, user) { }
public virtual T GetInstance(DateTime when, TreeListNode category) { return(GetInstance(this, when, category)); }
public static IList <PartyCategory> Find(Context context, TreeListNode category) { return(context.PersistenceSession.CreateCriteria <PartyCategory>() .Add(Expression.Eq("Category", category)) .List <PartyCategory>()); }
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); }
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()); }