public PersistentTemporalTitledEntity(DateTime effectiveDate, String code, MultilingualString title, MultilingualString description, String reference, String remark)
     : base(new TimeInterval(effectiveDate), reference, remark)
 {
     this.Code        = code;
     this.Title       = title;
     this.Description = description;
 }
Esempio n. 2
0
 public PartyAttribute(Party party, TreeListNode attributeKey, MultilingualString valueMLS)
 {
     base.party           = party;
     this.AttributeKey    = attributeKey;
     base.valueMLS        = valueMLS;
     base.EffectivePeriod = new TimeInterval(DateTime.Now);
 }
Esempio n. 3
0
        /*
         * public static State FindByCode(Context context, string code)
         * {
         *      ICriteria crit = context.PersistenceSession.CreateCriteria(typeof(State));
         *      crit.Add(Expression.Eq("Code", code));
         *      return crit.UniqueResult<State>();
         * }
         *
         * public static State FindByCode(Context context, string stateCode, bool isFinalState)
         * {
         *      ICriteria crit = context.PersistenceSession.CreateCriteria(typeof(State));
         *
         *      if (stateCode != null)
         *      {
         *              crit.Add(Expression.Eq("Code", stateCode));
         *      }
         *
         *      crit.Add(Expression.Eq("IsFinalState", isFinalState));
         *      return crit.UniqueResult<State>();
         * }
         */
        public virtual StateTransition AddTransition(int seqNo, State toState, MultilingualString title, Rule transitionRule)
        {
            StateTransition transition = new StateTransition(seqNo, title, this, toState, transitionRule);

            this.Transitions.Add(transition);
            return(transition);
        }
 public PersistentTemporalTitledEntity(PersistentTemporalTitledEntity original)
     : base(original)
 {
     this.Code        = original.Code;
     this.Title       = MultilingualString.Clone(original.Title);
     this.Description = MultilingualString.Clone(original.Description);
 }
Esempio n. 5
0
 public static void Update(this MultilingualString ms, Context context)
 {
     foreach (MLSValue v in ms.Values)
     {
         context.Persist(v);
     }
 }
Esempio n. 6
0
 public DotNetRule(string name, string version, MultilingualString description,
                   string assemblyName, string qualifiedClassName)
     : base(name, version, description)
 {
     this.assemblyName       = assemblyName;
     this.qualifiedClassName = qualifiedClassName;
 }
Esempio n. 7
0
        public virtual void Append(MultilingualString mls)
        {
            if (mls == null)
            {
                return;
            }

            foreach (MLSValue rv in mls.Values)
            {
                bool notFound = true;
                foreach (LanguageStringBuilder b in this.Content)
                {
                    if (b.Language == rv.LanguageCode)
                    {
                        b.Builder.Append(rv.Value);
                        notFound = false;
                        break;
                    }
                }
                if (notFound)
                {
                    LanguageStringBuilder b = new LanguageStringBuilder(rv.LanguageCode);
                    b.Builder.Append(rv.Value);
                    this.Content.Add(b);
                }
            }
        }
Esempio n. 8
0
 public MLSValue(MultilingualString owner, string languageCode, string value)
 {
     this.LanguageCode = languageCode;
     this.Owner        = owner;
     this.Value        = value;
     this.UpdatedTS    = DateTime.Now;
 }
 public MultiBracketSchedule(String code, MultilingualString title, MultilingualString description,
                             bool lowerBoundIsInclusive, bool applyRateToAmountOverBracketLowerBound,
                             String reference, String remark, DateTime effectiveDate, User updatedBy)
     : base(code, title, description, reference, remark, effectiveDate, updatedBy)
 {
     this.ApplyRateToAmountOverBracketLowerBound = applyRateToAmountOverBracketLowerBound;
     this.LowerBoundIsInclusive = lowerBoundIsInclusive;
 }
Esempio n. 10
0
 public StateTransition(int seqNo, MultilingualString title, State fromState, State toState, Rule transitionRule)
 {
     this.seqNo          = seqNo;
     this.title          = title;
     this.fromState      = fromState;
     this.toState        = toState;
     this.transitionRule = transitionRule;
 }
Esempio n. 11
0
        public virtual MultilingualString ToMultilingualString()
        {
            MultilingualString n = null;

            if (this.Prefix != null)
            {
                n = this.Prefix.Affix.Clone();
            }
            if (this.FirstName != null)
            {
                if (n == null)
                {
                    n = this.FirstName.Clone();
                }
                else
                {
                    n.Append(" ");
                    n.Append(this.FirstName);
                }
            }
            if (this.MiddleName != null)
            {
                if (n == null)
                {
                    n = this.MiddleName.Clone();
                }
                else
                {
                    n.Append(" ");
                    n.Append(this.MiddleName);
                }
            }
            if (this.LastName != null)
            {
                if (n == null)
                {
                    n = this.LastName.Clone();
                }
                else
                {
                    n.Append(" ");
                    n.Append(this.LastName);
                }
            }
            if (this.Suffix != null)
            {
                if (n == null)
                {
                    n = this.Suffix.Affix.Clone();
                }
                else
                {
                    n.Append(" ");
                    n.Append(this.Suffix.Affix);
                }
            }
            return(n);
        }
Esempio n. 12
0
 public ScheduleDetail(int seqNo, RescheduleOption rescheduleIfHoliday, TimeInterval hourInterval,
                       TreeListNode timeCategory, MultilingualString title)
 {
     this.SeqNo = seqNo;
     this.RescheduleIfHoliday = rescheduleIfHoliday;
     this.hourInterval        = hourInterval;
     this.Title        = title;
     this.TimeCategory = timeCategory;
 }
Esempio n. 13
0
        //public static String GetUserInfo(this SelfAuthenticatedUser user, Context context)
        //{
        //    StringBuilder name = new StringBuilder(user.Name.ToString());
        //    foreach (PersonOrgRelation employer in user.Person.FindCurrentEmployments(context))
        //    {
        //        name.Append(", ");
        //        name.Append(employer.Organization.ToString());
        //        if (null != employer.OrgUnit)
        //        {
        //            name.Append("-");
        //            name.Append(employer.OrgUnit.ToString());
        //        }
        //    }
        //    return name.ToString();
        //}

        public static void Persist(this MultilingualString ms, Context context)
        {
            context.Persist(ms);
            foreach (MLSValue v in ms.Values)
            {
                v.Owner = ms;
                context.Persist(v);
            }
        }
Esempio n. 14
0
 public TreeListNode(TreeListNode parent, int seqNo, String code, MultilingualString title)
 {
     this.seqNo = seqNo;
     this.code  = code;
     this.title = title;
     if (null != parent)
     {
         parent.AddChild(this);
     }
 }
Esempio n. 15
0
 public PartyName(Party owner, String code, MultilingualString name, MultilingualString shortName,
                  TimeInterval effectivePeriod, User updatedBy)
 {
     this.party           = owner;
     this.code            = code;
     this.name            = name;
     this.shortName       = shortName;
     this.EffectivePeriod = effectivePeriod;
     this.updatedBy       = updatedBy;
 }
Esempio n. 16
0
 public OrgName(OrgBase owner, String code, MultilingualString name, MultilingualString shortName,
                TimeInterval effectivePeriod, User updatedBy)
 {
     this.owner           = owner;
     this.code            = code;
     this.name            = name;
     this.shortName       = shortName;
     this.EffectivePeriod = effectivePeriod;
     this.updatedBy       = updatedBy;
 }
Esempio n. 17
0
        public virtual MultilingualString ToMultilingualString()
        {
            MultilingualString mls = new MultilingualString();

            foreach (LanguageStringBuilder b in this.Content)
            {
                mls.Values.Add(new MLSValue(mls, b.Language, b.Builder.ToString()));
            }
            return(mls);
        }
Esempio n. 18
0
 public static MultilingualString Clone(this MultilingualString original)
 {
     if (MultilingualString.IsNullOrEmpty(original))
     {
         return(null);
     }
     else
     {
         return(new MultilingualString(original));
     }
 }
Esempio n. 19
0
 public TimeSchedule(string code, MultilingualString title, MultilingualString description, TimeInterval effectivePeriod)
 {
     this.Code        = code;
     this.Title       = title;
     this.Description = description;
     if (effectivePeriod == null)
     {
         effectivePeriod = new TimeInterval();
     }
     this.EffectivePeriod = effectivePeriod;
 }
Esempio n. 20
0
 public BankTransactionType(int applicationID, User user, String code, TimeInterval effectivePeriod,
                            MultilingualString title, MultilingualString shortTitle, MultilingualString description,
                            bool isExecutable, bool isCredit, bool isDebit, bool isPrincipal, bool directlyAffectInvestmentUnits,
                            Rule creationRule, Rule validateRule, Rule rollbackRule)
     : base(applicationID, user, code, effectivePeriod, title, shortTitle, description,
            creationRule, validateRule, rollbackRule)
 {
     this.isPrincipal  = isPrincipal;
     this.isExecutable = isExecutable;
     this.isCredit     = isCredit;
     this.isDebit      = isDebit;
     this.directlyAffectInvestmentUnits = directlyAffectInvestmentUnits;
 }
Esempio n. 21
0
 public MultiStepRate(String code, MultilingualString title, MultilingualString description,
                      bool isLowerBoundInclusive, bool applyRateToTheEntireAmount,
                      String reference, String remark, DateTime effectiveDate, Person updatedBy)
 {
     this.code                       = code;
     this.title                      = title;
     this.description                = description;
     this.reference                  = reference;
     this.remark                     = remark;
     this.effectivePeriod            = new TimeInterval(effectiveDate);
     this.applyRateToTheEntireAmount = applyRateToTheEntireAmount;
     this.isLowerBoundInclusive      = isLowerBoundInclusive;
 }
Esempio n. 22
0
 public PersonName(Person person, TimeInterval effectivePeriod, NameAffix prefix,
                   MultilingualString firstName, MultilingualString lastName, MultilingualString middleName,
                   NameAffix suffix, string reference, string remark)
 {
     this.person          = person;
     this.EffectivePeriod = effectivePeriod;
     this.prefix          = prefix;
     this.firstName       = firstName;
     this.lastName        = lastName;
     this.middleName      = middleName;
     this.suffix          = suffix;
     this.Reference       = reference;
     this.Remark          = remark;
 }
Esempio n. 23
0
 public State(StatefulEntityType owner, int category, int seqNo, string code, MultilingualString title,
              bool isInitial, bool isFinal, Rule onEnterRule, Rule onExitRule)
 {
     this.owner          = owner;
     this.category       = category;
     this.seqNo          = seqNo;
     this.code           = code;
     this.title          = title;
     this.isInitialState = isInitial;
     this.isFinalState   = isFinal;
     this.onEnterRule    = onEnterRule;
     this.onExitRule     = onExitRule;
     this.updatedTS      = DateTime.Now;
 }
Esempio n. 24
0
 private static void ResplitIfFirstNameIncorrect(ref String namePrefix, ref String firstName)
 {
     if (namePrefix == "นางสาว")
     {
         if (firstName == "")
         {
             namePrefix = "นาง";
             firstName  = "สาว";
         }
         else if (-1 < illegalFirstChar.IndexOf((char)firstName[0]))
         {
             namePrefix = "นาง";
             firstName  = "สาว" + firstName;
         }
     }
 }
Esempio n. 25
0
 public StatefulTransactionType(int applicationID, User user, String code, TimeInterval effectivePeriod,
                                MultilingualString title)
 {
     this.SystemID = applicationID;
     this.code     = code;
     if (effectivePeriod == null)
     {
         this.effectivePeriod = new TimeInterval();
     }
     else
     {
         this.effectivePeriod = effectivePeriod;
     }
     this.title     = title;
     this.updatedBy = user;
     this.updatedTS = DateTime.Now;
 }
Esempio n. 26
0
 public Relationship(string code, MultilingualString forwardTitle, MultilingualString reverseTitle,
                     MultilingualString firstPartyTitle, MultilingualString secondPartyTitle,
                     MultilingualString description, TreeListNode categoryRoot, bool isPermanent,
                     TimeInterval effectivePeriod)
 {
     this.code              = code;
     this.forwardTitle      = forwardTitle;
     this.reverseTitle      = reverseTitle;
     this.firstPartyTitle   = firstPartyTitle;
     this.secondPartyTitle  = secondPartyTitle;
     this.description       = description;
     this.isPermanent       = isPermanent;
     this.EffectivePeriod   = effectivePeriod;
     this.CategoryRoot      = categoryRoot;
     this.EnteringEventRule = null;
     this.ExitingEventRule  = null;
 }
Esempio n. 27
0
 public TreeListNode(TreeListNode parent, int seqNo, String code, MultilingualString title,
                     MultilingualString shortTitle, bool isActive, bool isDefault, bool isImmutable,
                     String valueString, double valueNumber, DateTime valueDate)
 {
     this.seqNo       = seqNo;
     this.code        = code;
     this.title       = title;
     this.shortTitle  = shortTitle;
     this.valueNumber = valueNumber;
     this.isActive    = isActive;
     this.isDefault   = isDefault;
     this.isImmutable = isImmutable;
     if (null != parent)
     {
         parent.AddChild(this);
     }
 }
Esempio n. 28
0
        public static void Split(String fullName,
                                 out String namePrefix, out String firstName, out String lastName)
        {
            namePrefix = firstName = lastName = null;

            //MatchCollection mc = regExpThaiNameWithPrefix.Matches(fullName);
            //int i = mc.Count;
            String[] parts = threePartNamePattern.Split(fullName);
            if (parts.Length > 1)
            {
                namePrefix = parts[1];
                firstName  = parts[2];
                lastName   = parts[3];
                ResplitIfFirstNameIncorrect(ref namePrefix, ref firstName);
            }
            else
            {
                SplitNameWithoutPrefix(fullName, ref firstName, ref lastName);
            }
        }
Esempio n. 29
0
 public StatefulTransactionType(int applicationID, User user, String code, TimeInterval effectivePeriod,
                                MultilingualString title, MultilingualString shortTitle, MultilingualString description,
                                Rule creationRule, Rule validationRule, Rule rollbackRule)
 {
     this.SystemID    = applicationID;
     this.code        = code;
     this.description = description;
     if (effectivePeriod == null)
     {
         this.effectivePeriod = new TimeInterval();
     }
     else
     {
         this.effectivePeriod = effectivePeriod;
     }
     this.shortTitle     = shortTitle;
     this.title          = title;
     this.creationRule   = creationRule;
     this.validationRule = validationRule;
     this.rollbackRule   = rollbackRule;
     this.updatedBy      = user;
     this.updatedTS      = DateTime.Now;
 }
Esempio n. 30
0
        public static String ValueInCurrentLanguage(Context context, String code)
        {
            IList <MultilingualString> mlss = context.PersistenceSession
                                              .QueryOver <MultilingualString>()
                                              .Where(m => m.Code == code)
                                              .List();

            if (mlss.Count > 0)
            {
                MultilingualString mls = mlss[0];
                if (mls.Values.Count > 0)
                {
                    foreach (MLSValue mlsValue in mls.Values)
                    {
                        if (mlsValue.LanguageCode == context.CurrentLanguage.Code)
                        {
                            return(mlsValue.Value);
                        }
                    }
                }
            }
            return(null);
        }