⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chargemanage.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
            if ((this.m_UserInfo.Status & UserStatus.WaitValidateByEmail) == UserStatus.WaitValidateByEmail)
            {
                this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_NoMail;
                return false;
            }
            if ((this.m_UserInfo.Status & UserStatus.WaitValidateByAdmin) == UserStatus.WaitValidateByAdmin)
            {
                this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_NoCheck;
                return false;
            }
            UserPurviewInfo purviewInfo = PEContext.Current.User.PurviewInfo;
            if (purviewInfo.ChargeByPoint)
            {
                this.Pointfirst();
            }
            else
            {
                int num = 0;
                if (this.m_UserInfo.EndTime.HasValue)
                {
                    TimeSpan span = (TimeSpan) (Convert.ToDateTime(this.m_UserInfo.EndTime) - DateTime.Now.Date);
                    num = Convert.ToInt32(Convert.ToDecimal(span.TotalDays));
                }
                if (num <= 0)
                {
                    this.OverdueDisposal(purviewInfo);
                }
                else
                {
                    this.InValidate(purviewInfo);
                }
            }
            return string.IsNullOrEmpty(this.m_ErrMsg);
        }

        public static string GetGlobalString(string resourceKey)
        {
            string str = (string) HttpContext.GetGlobalResourceObject("ChargeResources", resourceKey, CultureInfo.CurrentCulture);
            if (str == null)
            {
                str = string.Empty;
            }
            return str;
        }

        private void InValidate(UserPurviewInfo userPurviewInfo)
        {
            if (!userPurviewInfo.NotMinusPointNotWriteToLog)
            {
                int logId = UserPointLog.GetValidPointLogId(this.m_UserInfo.UserName, this.m_ModelInfo.ModelId, this.m_CommonModelInfo.GeneralId, this.m_contentChargeInfo.ChargeType, this.m_contentChargeInfo.PitchTime, this.m_contentChargeInfo.ReadTimes);
                if (logId == 0)
                {
                    if ((userPurviewInfo.TotalViewInfoNumber > 0) && (UserPointLog.ViewTotalInfos(this.m_UserInfo.UserName) >= userPurviewInfo.TotalViewInfoNumber))
                    {
                        this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_Overflow_Total;
                    }
                    else if ((userPurviewInfo.ViewInfoNumberOneDay > 0) && (UserPointLog.ViewInfosOneDay(this.m_UserInfo.UserName) >= userPurviewInfo.ViewInfoNumberOneDay))
                    {
                        this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_Overflow_Today;
                    }
                    else if (string.IsNullOrEmpty(this.m_ErrMsg))
                    {
                        if (userPurviewInfo.WriteToLog)
                        {
                            UserPointLogInfo userPointLogInfo = this.AddPointLogInfo();
                            userPointLogInfo.Point = 0;
                            userPointLogInfo.Remark = string.Concat(new object[] { "有效期内查看收费", this.m_ModelInfo.ItemName, "应扣点数:", this.m_ModelInfo.ItemName, this.m_CommonModelInfo.Title, ",应扣点数:", this.m_contentChargeInfo.InfoPoint });
                            UserPointLog.Add(userPointLogInfo);
                        }
                        else if (this.m_UserInfo.UserPoint <= this.m_contentChargeInfo.InfoPoint)
                        {
                            if (userPurviewInfo.ChargeByPointOrValidDate)
                            {
                                this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_NeedPoint;
                            }
                            else
                            {
                                UserPointLogInfo info3 = this.AddPointLogInfo();
                                info3.Point = 0;
                                info3.Remark = string.Concat(new object[] { "有效期内查看收费", this.m_ModelInfo.ItemName, "应扣点数:", this.m_ModelInfo.ItemName, this.m_CommonModelInfo.Title, ",应扣点数:", this.m_contentChargeInfo.InfoPoint });
                                UserPointLog.Add(info3);
                            }
                        }
                        else if (this.m_Pay != "yes")
                        {
                            this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_UsePoint;
                        }
                        else if (Users.MinusPoint(this.m_contentChargeInfo.InfoPoint, this.m_UserInfo.UserName))
                        {
                            UserPointLogInfo info2 = this.AddPointLogInfo();
                            info2.Point = this.m_contentChargeInfo.InfoPoint;
                            info2.Remark = "有效期内查看收费" + this.m_ModelInfo.ItemName + this.m_CommonModelInfo.Title;
                            UserPointLog.Add(info2);
                            if ((this.m_contentChargeInfo.DividePercent > 0) && (this.m_contentChargeInfo.DividePercent < 100))
                            {
                                this.DividePoint(info2);
                            }
                            HttpContext.Current.Items.Add("IsPay", true);
                        }
                    }
                }
                else
                {
                    UserPointLog.UpdateTimes(this.m_UserTrueIP, logId);
                }
            }
        }

        private void OverdueDisposal(UserPurviewInfo userPurviewInfo)
        {
            if (userPurviewInfo.ChargeByValidDate || userPurviewInfo.ChargeByPointOrValidDate)
            {
                this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_OutTime;
            }
            else
            {
                int logId = UserPointLog.GetValidPointLogId(this.m_UserInfo.UserName, this.m_ModelInfo.ModelId, this.m_CommonModelInfo.GeneralId, this.m_contentChargeInfo.ChargeType, this.m_contentChargeInfo.PitchTime, this.m_contentChargeInfo.ReadTimes);
                if (logId == 0)
                {
                    if (this.m_UserInfo.UserPoint < this.m_contentChargeInfo.InfoPoint)
                    {
                        this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_NeedPoint;
                    }
                    else if (this.m_Pay != "yes")
                    {
                        this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_UsePoint;
                    }
                    else if (Users.MinusPoint(this.m_contentChargeInfo.InfoPoint, this.m_UserInfo.UserName))
                    {
                        UserPointLogInfo userPointLogInfo = this.AddPointLogInfo();
                        userPointLogInfo.Point = this.m_contentChargeInfo.InfoPoint;
                        userPointLogInfo.Remark = "用于查看收费" + this.m_ModelInfo.ItemName + this.m_CommonModelInfo.Title;
                        UserPointLog.Add(userPointLogInfo);
                        if ((this.m_contentChargeInfo.DividePercent > 0) && (this.m_contentChargeInfo.DividePercent < 100))
                        {
                            this.DividePoint(userPointLogInfo);
                        }
                        HttpContext.Current.Items.Add("IsPay", true);
                    }
                }
                else
                {
                    UserPointLog.UpdateTimes(this.m_UserTrueIP, logId);
                }
            }
        }

        private void Pointfirst()
        {
            int logId = UserPointLog.GetValidPointLogId(this.m_UserInfo.UserName, this.m_ModelInfo.ModelId, this.m_CommonModelInfo.GeneralId, this.m_contentChargeInfo.ChargeType, this.m_contentChargeInfo.PitchTime, this.m_contentChargeInfo.ReadTimes);
            if (logId == 0)
            {
                if (this.m_UserInfo.UserPoint < this.m_contentChargeInfo.InfoPoint)
                {
                    this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_NeedPoint;
                }
                else if (this.m_Pay != "yes")
                {
                    this.m_ErrMsg = this.m_ErrMsg + this.m_errMsg_UsePoint;
                }
                else if (Users.MinusPoint(this.m_contentChargeInfo.InfoPoint, this.m_UserInfo.UserName))
                {
                    UserPointLogInfo userPointLogInfo = this.AddPointLogInfo();
                    userPointLogInfo.Point = this.m_contentChargeInfo.InfoPoint;
                    userPointLogInfo.Remark = "用于查看收费" + this.m_ModelInfo.ItemName + this.m_CommonModelInfo.Title;
                    UserPointLog.Add(userPointLogInfo);
                    if ((this.m_contentChargeInfo.DividePercent > 0) && (this.m_contentChargeInfo.DividePercent < 100))
                    {
                        this.DividePoint(userPointLogInfo);
                    }
                    HttpContext.Current.Items.Add("IsPay", true);
                }
            }
            else
            {
                UserPointLog.UpdateTimes(this.m_UserTrueIP, logId);
            }
        }

        public string ErrMsg
        {
            get
            {
                return this.m_ErrMsg;
            }
            set
            {
                this.m_ErrMsg = value;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -