Пример #1
0
 public UserOrgUnit(User user, OrgUnit orgUnit)
     : this()
 {
     this.EffectivePeriod = TimeInterval.EffectiveNow;
     this.User            = user;
     this.OrgUnit         = orgUnit;
 }
 public SelfAuthenticatedUser(SystemEnum systemID,
                              Organization organization,
                              OrgUnit orgUnit,
                              string officialIDNo,
                              string loginName,
                              string firstNameTh, string firstNameEn,
                              string lastNameTh, string lastNameEn,
                              string middleNameTh, string middleNameEn,
                              string emailAddress,
                              string mobilePhone, string phoneCenter, string phoneCenterTo, string phoneDirect, string address, bool isBulidin = false)
     : base(systemID,
            organization,
            officialIDNo,
            loginName,
            firstNameTh, firstNameEn,
            lastNameTh, lastNameEn,
            middleNameTh, middleNameEn,
            emailAddress,
            mobilePhone)
 {
     this.OrgUnit       = orgUnit;
     this.PhoneCenter   = phoneCenter;
     this.PhoneCenterTo = phoneCenterTo;
     this.PhoneDirect   = phoneDirect;
     this.MustChangePasswordAfterFirstLogon = false;
     this.EffectivePeriod     = TimeInterval.EffectiveNow;
     this.ResponsibleOrgUnits = new List <UserOrgUnit>();
     this.Address             = address;
     this.IsBuiltin           = isBulidin;
 }
Пример #3
0
 public PersonOrgRelation(TreeListNode relationshipCategory, String code, String relationshipNo,
                          int seqNo, int level, Person person, Organization org, OrgUnit orgUnit,
                          DateTime effectiveDate, String reference, String remark, User updatedBy)
 {
     this.code                 = code;
     this.relationshipNo       = relationshipNo;
     this.relationshipCategory = relationshipCategory;
     this.seqNo                = seqNo;
     this.level                = level;
     this.person               = person;
     this.organization         = org;
     this.orgUnit              = orgUnit;
     this.EffectivePeriod      = new TimeInterval(effectiveDate);
     this.Reference            = reference;
     this.Remark               = remark;
     this.updatedBy            = updatedBy;
 }
Пример #4
0
        public static IList <PersonOrgRelation> List(Context context, TreeListNode category, Organization org, OrgUnit orgUnit, DateTime onDate)
        {
            AbstractCriterion orgUnitExp = orgUnit == null?Expression.IsNull("OrgUnit") : Expression.Eq("OrgUnit", orgUnit);

            return(context.PersistenceSession.CreateCriteria <PersonOrgRelation>()
                   .Add(Expression.Eq("RelationshipCategory", category))
                   .Add(Expression.Eq("Organization", org))
                   .Add(orgUnitExp)
                   .Add(Expression.Le("EffectivePeriod.From", onDate))
                   .Add(Expression.Ge("EffectivePeriod.To", onDate))
                   .List <PersonOrgRelation>());
        }