Exemplo n.º 1
0
        private bool UpdateMemberFee(List<string> memberCodeList, int activityId, List<double> serviceFeeList)
        {
            bool result = false;
            try
            {
            for (int i = 0; i < memberCodeList.Count; i++)
            {
                ICriteria criteria = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberBaseInfo));
                MemberBaseInfo member = new MemberBaseInfo();
                member = criteria.Add(Restrictions.Eq("MemberCode", memberCodeList[i])).List<MemberBaseInfo>().ToList<MemberBaseInfo>()[0];
                string feeMemberCode = member.MemberCode;
                ICriteria criteriaFee = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberActivityInfo));
                if (member.AddtionalCode != null && member.AddtionalCode.Trim() != "")
                {
                    member = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberBaseInfo)).Add(Restrictions.Eq("MemberCode", member.AddtionalCode)).List<MemberBaseInfo>().ToList<MemberBaseInfo>()[0];

                }
                criteriaFee.Add(Restrictions.Eq("ActivityId", activityId));
                criteriaFee.Add(Restrictions.Eq("MemberCode", feeMemberCode));
                MemberActivityInfo memberActivity = new MemberActivityInfo();
                List<MemberActivityInfo> memAcList = new List<MemberActivityInfo>();
                memAcList = criteriaFee.List<MemberActivityInfo>().ToList<MemberActivityInfo>();
                if ((memAcList != null) && (memAcList.Count > 0))
                {
                    memberActivity = memAcList[0];
                }
                member.FeeBalance = (member.FeeBalance + memberActivity.ServiceFee) - serviceFeeList[i];
                result = this.IActivityManage.UpdateTableInfo<MemberBaseInfo>(member);
                MemberFee memberFeeRecord = new MemberFee {
                    MemberId = member.MemberId,
                    ActivityCode = memberActivity.ActivityCode,
                    FeeStatus = 3,
                    FeeId = 0,
                    ClubCount = memberActivity.ServiceFee,
                    FeeDate = DateTime.Now,
                    LastUpdateBy = (HttpContext.Current.Session["ADMIN"] as AdminInfo).AdminName,
                    LastUpdateDate = DateTime.Now,
                    Remark = "取消参加" + memberActivity.ActivityCode + ",系统退费"
                };
                this.IActivityManage.UpdateTableInfo<MemberFee>(memberFeeRecord);
            }
            }
            catch (Exception)
            {
            result = false;
            }
            return result;
        }
Exemplo n.º 2
0
        public void UpdateFeeRecord(List<string> memberCodelist, int activityId)
        {
            try
            {
            for (int i = 0; i < memberCodelist.Count; i++)
            {
                ICriteria criteria = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberBaseInfo));
                MemberBaseInfo member = new MemberBaseInfo();
                member = criteria.Add(Restrictions.Eq("MemberCode", memberCodelist[i])).List<MemberBaseInfo>().ToList<MemberBaseInfo>()[0];
                string feeMemberCode = member.MemberCode;
                int feeMemberId = member.MemberId;
                if (member.AddtionalCode != null && member.AddtionalCode.Trim() != "")
                {
                    member = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberBaseInfo)).Add(Restrictions.Eq("MemberCode", member.AddtionalCode)).List<MemberBaseInfo>().ToList<MemberBaseInfo>()[0];

                }
                ICriteria criteriaFee = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberActivityInfo));
                criteriaFee.Add(Restrictions.Eq("ActivityId", activityId));
                criteriaFee.Add(Restrictions.Eq("MemberCode", feeMemberCode));
                MemberActivityInfo memberActivity = new MemberActivityInfo();
                List<MemberActivityInfo> memAcList = new List<MemberActivityInfo>();
                memAcList = criteriaFee.List<MemberActivityInfo>().ToList<MemberActivityInfo>();
                if ((memAcList != null) && (memAcList.Count > 0))
                {
                    memberActivity = memAcList[0];
                }
                this.IActivityManage.NativeHibernateSession.Delete(string.Concat(new object[] { "from MemberFee t where t.MemberId=", feeMemberId, " and t.ActivityCode='", memberActivity.ActivityCode, "'" }));
                this.IActivityManage.NativeHibernateSession.Flush();
                MemberFee newfeeRecord = new MemberFee {
                    MemberId =feeMemberId,
                    ActivityCode = memberActivity.ActivityCode,
                    ClubCount = memberActivity.ServiceFee,
                    FeeDate = DateTime.Now,
                    LastUpdateBy = (HttpContext.Current.Session["ADMIN"] as AdminInfo).AdminName,
                    LastUpdateDate = DateTime.Now,
                    FeeStatus = 1,
                    Remark = "参加" + memberActivity.ActivityCode + "扣费"
                };
                this.IActivityManage.NativeHibernateSession.Save(newfeeRecord);
            }
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 3
0
        private bool UpdateMemberAddFee(List<string> memberCodeList, int activityId, List<double> serviceFeeList)
        {
            bool result = false;
            try
            {
            for (int i = 0; i < memberCodeList.Count; i++)
            {
                ICriteria criteria = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberBaseInfo));
                ICriteria criteriaFee = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberActivityInfo));

                MemberBaseInfo member = new MemberBaseInfo();
                member = criteria.Add(Restrictions.Eq("MemberCode", memberCodeList[i])).List<MemberBaseInfo>().ToList<MemberBaseInfo>()[0];
                string feeMemberCode = member.MemberCode;
                if (member.AddtionalCode != null && member.AddtionalCode.Trim() != "") {
                    member = this.IActivityManage.NativeHibernateSession.CreateCriteria(typeof(MemberBaseInfo)).Add(Restrictions.Eq("MemberCode", member.AddtionalCode)).List<MemberBaseInfo>().ToList<MemberBaseInfo>()[0];

                }

                criteriaFee.Add(Restrictions.Eq("ActivityId", activityId));
                criteriaFee.Add(Restrictions.Eq("MemberCode", feeMemberCode));
                MemberActivityInfo memberActivity = new MemberActivityInfo();
                List<MemberActivityInfo> memAcList = new List<MemberActivityInfo>();
                memAcList = criteriaFee.List<MemberActivityInfo>().ToList<MemberActivityInfo>();
                if ((memAcList != null) && (memAcList.Count > 0))
                {
                    memberActivity = memAcList[0];
                }
                member.FeeBalance = (member.FeeBalance + memberActivity.ServiceFee) - serviceFeeList[i];
                result = this.IActivityManage.UpdateTableInfo<MemberBaseInfo>(member);
            }
            }
            catch (Exception)
            {
            result = false;
            }
            return result;
        }
Exemplo n.º 4
0
 public bool DeleteMemberActivity(int memberActivityId)
 {
     MemberActivityInfo activityInfo = new MemberActivityInfo();
     activityInfo = this.IActivityManage.GetById<MemberActivityInfo, int>(memberActivityId);
     List<string> memcodeList = new List<string>();
     List<double> memFeeList = new List<double> ();
     memcodeList.Add(activityInfo.MemberCode);
     memFeeList.Add(0.0);
     bool updateFeeResult = this.UpdateMemberFee(memcodeList, activityInfo.ActivityId, memFeeList);
     return (this.IActivityManage.DeleteTableInfo<MemberActivityInfo, int>(memberActivityId) && updateFeeResult);
 }