Beispiel #1
0
        public Int64 Evaluate(Member.Member member)
        {
            Int64 workQueueId = -1;  // (-1) NO MATCH FOUND

            // INITIALIZE TO A INVALID WORK QUEUE ID SO THAT A MATCH WITH AN UNASSIGNED WORK QUEUE (0)
            // DOESN'T GET REASSIGNED TO THE DEFAULT WORK QUEUE FOR THE ROUTING RULE


            foreach (Int32 currentSequence in rules.Keys)   // CYCLE THROUGH ALL RULES

            {
                if (rules[currentSequence].MatchMember(member))    // MATCH FOUND

                {
                    workQueueId = rules[currentSequence].WorkQueueId; // ASSIGNED WORK QUEUE ID FROM RULE

                    break;                                            // STOP THE CYCLE (FIRST MATCH WINS)
                }
            }

            // ONLY DEFAULT WHEN NO MATCH HAS BEEN FOUND (-1)
            if (workQueueId == -1)
            {
                workQueueId = defaultWorkQueueId;
            }


            return(workQueueId);
        }
Beispiel #2
0
        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="preRegisterID"></param>
        /// <param name="email"></param>
        /// <param name="nickName"></param>
        /// <param name="birthday"></param>
        /// <param name="pwd"></param>
        /// <param name="iconNo"></param>
        /// <param name="sex"></param>
        /// <returns>返回用户ID</returns>
        public static Member.Member AddMember(String email, String pwd, String iconID, int sex)
        {
            try
            {
                Member.Member mym = new Member.Member();
                mym.MemberInfomation = new Member.MemberInfomation();
                mym.MemberPhoto = new Member.MemberPhoto();
                mym.Status = new Member.MemberStatus();
                mym.Settings = new Member.MemberSetting();
                mym.AllowLogin = true;

                mym.MemberPhoto.IconID = iconID;
                if (iconID != "")
                {
                    Photo.Photo myp = Photo.PhotoManager.GetPhoto(iconID);
                    mym.MemberInfomation.IconPath = myp.FileName;
                }

                mym.Settings.AutoAddOutCallingToMyFavorList = true;
                mym.Settings.HiddenMyPhoto = false;
                mym.Settings.StopMyAccount = false;

                mym.Email = email;
                mym.Password = CBB.Security.MD5Helper.getMd5Hash(pwd);
                mym.CreatedTime = DateTime.Now;
                mym.Sex = sex;
                mym.MemberInfomation.Sex = sex;

                mym.FinishedReg = false;
                mym.EmailIsVaild = false;

                MongoDatabase md = MongoDBHelper.MongoDB;
                MongoCollection<Member.Member> mc = md.GetCollection<Member.Member>("Members");
                mc.Insert(mym);

                return mym;

            }
            catch (CBB.ExceptionHelper.OperationException err)
            {
                throw err;
            }
        }
Beispiel #3
0
 public UniqueNumber(String memberId)
 {
     try
     {
         Member.Member obj = new Member.Member();
         MongoDatabase md = MongoDBHelper.MongoDB;
         MongoCollection<Member.Member> mc = md.GetCollection<Member.Member>(Member.Member.GetCollectionName());
         obj = mc.FindOne(Query.EQ("_id", ObjectId.Parse(memberId)));
         this.DefaultId = obj.UniqueNumber.DefaultId;
         this.ConvertedID = obj.UniqueNumber.ConvertedID;
         this.DomainNameID = obj.UniqueNumber.DomainNameID;
         this.IDType = obj.UniqueNumber.IDType;
         this.CreatedTime = obj.UniqueNumber.CreatedTime;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
Beispiel #4
0
 ///// <summary>
 ///// 最后操作时间
 ///// </summary>
 //public DateTime LastOperationTime
 //{
 //    get { return this.lastOperationTime; }
 //    set { this.lastOperationTime = value.ToLocalTime(); }
 //}
 //private DateTime lastOperationTime;
 ///// <summary>
 ///// 在线状态
 ///// </summary>
 //public String OnlineStr
 //{
 //    get { return GetOnlineStr(LastOperationTime); }
 //}
 //private String GetOnlineStr(DateTime lastOperationTime)
 //{
 //    String str = "";
 //    if (lastOperationTime != null)
 //    {
 //        TimeSpan sp = DateTime.Now - lastOperationTime;
 //        int rightnow = 300;
 //        int onehour = 3600;
 //        int oneweek = 604800;
 //        double spsec = sp.TotalSeconds;
 //        if (spsec < rightnow)
 //        {
 //            str = "在线";
 //            return str;
 //        }
 //        if (spsec > rightnow & spsec < onehour)
 //        {
 //            str = "刚刚在线";
 //            return str;
 //        }
 //        if (spsec > onehour & lastOperationTime.Date == DateTime.Now.Date)
 //        {
 //            str = "今天来过";
 //            return str;
 //        }
 //        else
 //        {
 //            if (spsec < oneweek)
 //            {
 //                str = "最近来过";
 //                return str;
 //            }
 //        }
 //    }
 //    return str;
 //}
 public Creater(String id)
 {
     try
     {
         Member.Member obj = new Member.Member();
         MongoDatabase md = MongoDBHelper.MongoDB;
         MongoCollection<Member.Member> mc = md.GetCollection<Member.Member>(Member.Member.GetCollectionName());
         obj = mc.FindOne(Query.EQ("_id", ObjectId.Parse(id)));
         this.MemberID = obj.ID;
         this.ICONPath = obj.MemberInfomation.IconPath;
         this.NickName = obj.MemberInfomation.NickName;
         this.Sex = obj.Sex;
         this.Height = obj.MemberInfomation.Height;
         this.IWant = obj.MemberInfomation.IWant;
         this.Age = obj.MemberInfomation.Age;
         this.City = obj.MemberInfomation.City;
         this.Career = obj.MemberInfomation.Career;
         if (obj.UniqueNumber != null)
         {
             this.UniqueNumber = obj.UniqueNumber;
         }
         this.MemberType = obj.MemberType;
         this.MemberPhoto = obj.MemberPhoto;
         //this.LastOperationTime = obj.LastOperationTime;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
        public Boolean MatchMember(Member.Member member)
        {
            Boolean match = true;


            if (!member.HasCurrentEnrollment)
            {
                throw new Exception("Member not actively enrolled. Unable to Route.");
            }


            Int64 currentEnrollmentInsurerId = 0;

            if (member.CurrentEnrollment.Program != null)
            {
                currentEnrollmentInsurerId = member.CurrentEnrollment.Program.InsurerId;
            }



            match = match && ((currentEnrollmentInsurerId == insurerId) || (insurerId == 0));

            match = match && ((member.CurrentEnrollment.ProgramId == programId) || (programId == 0));

            match = match && ((member.CurrentEnrollment.MostRecentCoverage.BenefitPlanId == benefitPlanId) || (benefitPlanId == 0));


            if (match)
            {
                if (!(gender == Mercury.Server.Core.Enumerations.Gender.Both))
                {
                    match = match && (((member.Gender == "M") && (gender == Mercury.Server.Core.Enumerations.Gender.Male)) || ((member.Gender == "F") && (gender == Mercury.Server.Core.Enumerations.Gender.Female)));
                }

                if (useAgeCriteria)
                {
                    if (!isAgeInMonths)
                    {
                        match = match && ((member.CurrentAge >= ageMinimum) && (member.CurrentAge <= ageMaximum));
                    }

                    else
                    {
                        match = match && ((member.CurrentAgeInMonths >= ageMinimum) && (member.CurrentAgeInMonths <= ageMaximum));
                    }
                }

                match = match && ((member.EthnicityId == ethnicityId) || (ethnicityId == 0));

                match &= ((member.LanguageId == languageId) || (languageId == 0)); /* MCM-1066 */
            }

            if (match)
            {
                match = match && ((member.Entity.CurrentPhysicalAddress.State == state) || (String.IsNullOrEmpty(state.Trim())));

                match = match && ((member.Entity.CurrentPhysicalAddress.City == city) || (String.IsNullOrEmpty(city.Trim())));

                match = match && ((member.Entity.CurrentPhysicalAddress.County == county) || (String.IsNullOrEmpty(county.Trim())));

                match = match && ((member.Entity.CurrentPhysicalAddress.ZipCode == zipCode) || (String.IsNullOrEmpty(zipCode.Trim())));
            }

            return(match);
        }