예제 #1
0
        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);
                HttpContext.Current.Items.Add("IsPay", true);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int logId = BasePage.RequestInt32("LogID");

            if (!this.Page.IsPostBack)
            {
                UserPointLogInfo pointLogById = UserPointLog.GetPointLogById(logId);
                if (!pointLogById.IsNull)
                {
                    this.LblLogTime.Text  = pointLogById.LogTime.ToString();
                    this.LblUserName.Text = pointLogById.UserName;
                    this.LblIP.Text       = pointLogById.IP;
                    if (pointLogById.IncomePayOut == 1)
                    {
                        this.LblIncomePayOut.Text = "收入 " + pointLogById.Point.ToString();
                    }
                    else
                    {
                        this.LblIncomePayOut.Text = "支出 " + pointLogById.Point.ToString();
                    }
                    this.LblTimes.Text   = pointLogById.Times.ToString();
                    this.LblInputer.Text = pointLogById.Inputer;
                    this.LblRemark.Text  = pointLogById.Remark;
                    this.LblMemo.Text    = pointLogById.Memo;
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>找不到对应记录!</li>");
                }
            }
        }
예제 #3
0
 protected void EgvUserPoint_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         UserPointLogInfo dataItem = (UserPointLogInfo)e.Row.DataItem;
         if (dataItem != null)
         {
             Label label = (Label)e.Row.FindControl("LblIncomePayOut");
             label.Text = this.GetIncomePayOut(dataItem.Point, dataItem.IncomePayOut);
         }
     }
 }
예제 #4
0
        private UserPointLogInfo AddPointLogInfo()
        {
            UserPointLogInfo info = new UserPointLogInfo();

            info.UserName     = this.m_UserInfo.UserName;
            info.InfoId       = this.m_CommonModelInfo.GeneralId;
            info.IncomePayOut = 2;
            info.ModuleType   = this.m_ModelInfo.ModelId;
            info.LogTime      = DateTime.Now;
            info.IP           = this.m_UserTrueIP;
            return(info);
        }
        private void SaveUserPointLog(int point, decimal balance, UserInfo userInfo)
        {
            UserPointLogInfo userPointLogInfo = new UserPointLogInfo();

            userPointLogInfo.UserName     = userInfo.UserName;
            userPointLogInfo.IncomePayOut = 1;
            userPointLogInfo.LogTime      = DateTime.Now;
            userPointLogInfo.IP           = PEContext.Current.UserHostAddress;
            userPointLogInfo.Inputer      = PEContext.Current.Admin.AdminName;
            userPointLogInfo.Point        = point;
            userPointLogInfo.Remark       = string.Concat(new object[] { "用于", this.m_PointName, "兑换,消费", balance, "资金,增加", this.m_PointName, point, SiteConfig.UserConfig.PointUnit });
            UserPointLog.Add(userPointLogInfo);
        }
예제 #6
0
        private void DividePoint(UserPointLogInfo userPointLogInfo)
        {
            int infoPoint = DataConverter.CLng((this.m_contentChargeInfo.InfoPoint * this.m_contentChargeInfo.DividePercent) / 100);

            if (Users.AddPoint(infoPoint, this.m_CommonModelInfo.Inputer))
            {
                userPointLogInfo.UserName     = this.m_CommonModelInfo.Inputer;
                userPointLogInfo.InfoId       = 0;
                userPointLogInfo.Point        = infoPoint;
                userPointLogInfo.IncomePayOut = 1;
                userPointLogInfo.Remark       = "从“" + this.m_CommonModelInfo.Title + "”的收费中分成";
                UserPointLog.Add(userPointLogInfo);
            }
        }
예제 #7
0
 private static void UpdateUserInfo(OrderInfo orderinfo, int TotalPresentExp, int TotalPresentPoint, int TotalPresentMoney)
 {
     if ((((orderinfo.PresentExp != 0) || (orderinfo.PresentMoney != 0M)) || ((orderinfo.PresentPoint != 0) || (TotalPresentExp != 0))) || ((TotalPresentMoney != 0) || (TotalPresentPoint != 0)))
     {
         UserInfo usersByUserName = Users.GetUsersByUserName(orderinfo.UserName);
         if ((orderinfo.PresentMoney > 0M) || (TotalPresentMoney > 0))
         {
             usersByUserName.Balance = (usersByUserName.Balance + orderinfo.PresentMoney) + TotalPresentMoney;
             BankrollItemInfo bankrollItemInfo = new BankrollItemInfo();
             bankrollItemInfo.Inputer      = "";
             bankrollItemInfo.UserName     = orderinfo.UserName;
             bankrollItemInfo.ClientId     = orderinfo.ClientId;
             bankrollItemInfo.Money        = orderinfo.PresentMoney + TotalPresentMoney;
             bankrollItemInfo.MoneyType    = 4;
             bankrollItemInfo.Bank         = "";
             bankrollItemInfo.EBankId      = 0;
             bankrollItemInfo.OrderId      = orderinfo.OrderId;
             bankrollItemInfo.PaymentId    = 0;
             bankrollItemInfo.Remark       = "购物返还现金券";
             bankrollItemInfo.LogTime      = new DateTime?(DateTime.Now);
             bankrollItemInfo.DateAndTime  = new DateTime?(DateTime.Now);
             bankrollItemInfo.CurrencyType = 1;
             BankrollItem.Add(bankrollItemInfo);
         }
         if ((orderinfo.PresentExp > 0) || (TotalPresentExp > 0))
         {
             usersByUserName.UserExp = (usersByUserName.UserExp + orderinfo.PresentExp) + TotalPresentExp;
         }
         if ((orderinfo.PresentPoint > 0) || (TotalPresentPoint > 0))
         {
             usersByUserName.UserPoint = (usersByUserName.UserPoint + orderinfo.PresentPoint) + TotalPresentPoint;
             UserPointLogInfo userPointLogInfo = new UserPointLogInfo();
             userPointLogInfo.UserName     = usersByUserName.UserName;
             userPointLogInfo.IncomePayOut = 1;
             userPointLogInfo.LogTime      = DateTime.Now;
             userPointLogInfo.Point        = orderinfo.PresentPoint + TotalPresentPoint;
             userPointLogInfo.Remark       = "购物返还" + SiteConfig.UserConfig.PointName;
             UserPointLog.Add(userPointLogInfo);
         }
         Users.Update(usersByUserName);
     }
 }
예제 #8
0
 protected void EgvUserPoint_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         UserPointLogInfo dataItem = (UserPointLogInfo)e.Row.DataItem;
         if (dataItem != null)
         {
             HyperLink link = (HyperLink)e.Row.FindControl("HypUserName");
             if (this.m_ShowType == 1)
             {
                 link.NavigateUrl = "~/User/Default.aspx?UserName="******"~/Admin/User/UserShow.aspx?UserName="******"LblIncomePayOut");
             label.Text = this.GetIncomePayOut(dataItem.Point, dataItem.IncomePayOut);
         }
     }
 }
예제 #9
0
 private void AddPointLog(int point, IList <UserInfo> userList, string reason, string memo)
 {
     foreach (UserInfo info in userList)
     {
         UserPointLogInfo userPointLogInfo = new UserPointLogInfo();
         userPointLogInfo.Inputer  = string.IsNullOrEmpty(this.m_FromUser) ? "System" : this.m_FromUser;
         userPointLogInfo.IP       = this.m_FromUserIp;
         userPointLogInfo.UserName = info.UserName;
         userPointLogInfo.LogTime  = DateTime.Now;
         userPointLogInfo.Remark   = reason;
         userPointLogInfo.Memo     = memo;
         if (point > 0)
         {
             userPointLogInfo.IncomePayOut = 1;
         }
         else
         {
             userPointLogInfo.IncomePayOut = 2;
         }
         userPointLogInfo.Point = Math.Abs(point);
         UserPointLog.Add(userPointLogInfo);
     }
 }
예제 #10
0
 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);
             HttpContext.Current.Items.Add("IsPay", true);
         }
     }
 }
예제 #11
0
 private void SaveSurveyRecord(int surveyId)
 {
     if (surveyId == 0)
     {
         DynamicPage.WriteErrMsg("问卷调查ID错误!");
     }
     else
     {
         SurveyInfo surveyById = SurveyManager.GetSurveyById(surveyId);
         if (surveyById.IsOpen != 1)
         {
             DynamicPage.WriteErrMsg("问卷调查尚未启用!!!");
         }
         if (surveyById.EndTime != null)//.HasValue)
         {
             DateTime?endTime = surveyById.EndTime;
             DateTime now     = DateTime.Now;
             if (endTime.HasValue ? (endTime.GetValueOrDefault() < now) : false)
             {
                 DynamicPage.WriteErrMsg("问卷调查已经结束!!!");
             }
         }
         if (!SurveyManager.CheckLockUrl(base.Request.ServerVariables["HTTP_REFERER"], surveyById))
         {
             DynamicPage.WriteErrMsg("不允许从外部链接地址提交!!!");
         }
         if (SurveyManager.CheckRepeatIP(PEContext.Current.UserHostAddress, surveyId, surveyById))
         {
             DynamicPage.WriteErrMsg("同一用户不允许填写问卷调查超过" + surveyById.IPRepeat.ToString() + "次!!!");
         }
         if (!string.IsNullOrEmpty(surveyById.SetPassword) && (surveyById.SetPassword != base.Request.Form["SurveyPassword"].ToString()))
         {
             DynamicPage.WriteErrMsg("问卷密码错误!!!");
         }
         if (SurveyManager.CheckIPLock(PEContext.Current.UserHostAddress, surveyById))
         {
             DynamicPage.WriteErrMsg("对不起!您的IP(" + PEContext.Current.UserHostAddress + ")被系统限定,您可以和站长联系。");
         }
         if (surveyById.NeedLogin == 1)
         {
             if (PEContext.Current.User.Identity.IsAuthenticated)
             {
                 if (surveyById.PresentPoint != 0)
                 {
                     int userId = PEContext.Current.User.UserInfo.UserId;
                     Users.Update(userId, "UserPoint", (PEContext.Current.User.UserInfo.UserPoint + surveyById.PresentPoint).ToString());
                     UserPointLogInfo userPointLogInfo = new UserPointLogInfo();
                     userPointLogInfo.IncomePayOut = 1;
                     userPointLogInfo.InfoId       = 0;
                     userPointLogInfo.Inputer      = "System";
                     userPointLogInfo.IP           = PEContext.Current.UserHostAddress;
                     userPointLogInfo.LogId        = UserPointLog.GetTotalInComeAndPayOutAll().Count;
                     userPointLogInfo.LogTime      = DateTime.Now;
                     userPointLogInfo.Memo         = "";
                     userPointLogInfo.ModuleType   = 9;
                     userPointLogInfo.Point        = surveyById.PresentPoint;
                     userPointLogInfo.Remark       = "参与“" + surveyById.SurveyName + "”--问卷调查获得奖励点数";
                     userPointLogInfo.Times        = 1;
                     userPointLogInfo.UserName     = PEContext.Current.User.UserInfo.UserName;
                     UserPointLog.Add(userPointLogInfo);
                 }
             }
             else
             {
                 string absoluteUri = HttpContext.Current.Request.Url.AbsoluteUri;
                 BasePage.ResponseRedirect("../User/Login.aspx?ReturnUrl=" + HttpUtility.UrlEncode(absoluteUri));
             }
         }
         IList <SurveyFieldInfo> fieldList        = SurveyField.GetFieldList(surveyId);
         SurveyRecordInfo        surveyrecordinfo = new SurveyRecordInfo();
         DataTable table = new DataTable();
         table.Columns.Add("Option", typeof(string));
         table.Columns.Add("Input", typeof(string));
         table.Columns.Add("QuestionType", typeof(int));
         table.Columns.Add("InputType", typeof(int));
         table.Columns.Add("QuestionId", typeof(int));
         foreach (SurveyFieldInfo info4 in fieldList)
         {
             string answer = DataSecurity.FilterBadChar(base.Request.Form["Q" + info4.QuestionId]);
             this.CheckForm(info4, answer);
             DataRow row = table.NewRow();
             row["Option"]       = answer;
             row["QuestionType"] = info4.QuestionType;
             row["InputType"]    = info4.InputType;
             row["QuestionId"]   = info4.QuestionId;
             if (info4.InputType > 0)
             {
                 string str3 = DataSecurity.FilterBadChar(base.Request.Form["Q" + info4.QuestionId + "Input"]);
                 row["Input"] = str3;
             }
             if (((info4.QuestionType == 2) || (info4.QuestionType == 4)) || (info4.QuestionType == 7))
             {
                 SurveyVote.Vote(surveyId, info4.QuestionId, DataConverter.CLng(answer));
             }
             if ((info4.QuestionType == 3) || (info4.QuestionType == 5))
             {
                 foreach (string str4 in answer.Split(new char[] { ',' }))
                 {
                     SurveyVote.Vote(surveyId, info4.QuestionId, DataConverter.CLng(str4));
                 }
             }
             table.Rows.Add(row);
         }
         surveyrecordinfo.Answer     = table;
         surveyrecordinfo.UserName   = PEContext.Current.User.UserInfo.UserName;
         surveyrecordinfo.IP         = PEContext.Current.UserHostAddress;
         surveyrecordinfo.SubmitTime = DateTime.Now;
         surveyrecordinfo.SurveyId   = surveyId;
         if (!SurveyRecord.SaveSurveyRecord(surveyrecordinfo))
         {
             DynamicPage.WriteErrMsg("提交问卷失败!");
         }
         else
         {
             DynamicPage.WriteSuccessMsg("提交问卷成功!", "");
         }
     }
 }
예제 #12
0
 public static bool Add(UserPointLogInfo userPointLogInfo)
 {
     return(dal.Add(userPointLogInfo));
 }
예제 #13
0
 protected void EBtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         decimal  num      = DataConverter.CDecimal(this.TxtMoney.Text);
         UserInfo userInfo = this.ShowUserInfo.UserInfo;
         if (userInfo == null)
         {
             AdminPage.WriteErrMsg("<li>找不到指定的会员!</li>");
         }
         else
         {
             if (string.IsNullOrEmpty(this.DropBankShortName.SelectedValue))
             {
                 AdminPage.WriteErrMsg("<li>请选择汇入银行!如果没有请到系统设置下的银行账户管理中添加银行账户 !</li>", "UserShow.aspx?UserID=" + userInfo.UserId);
             }
             userInfo.Balance += num;
             if (Users.Update(userInfo))
             {
                 BankrollItemInfo bankrollItemInfo = new BankrollItemInfo();
                 bankrollItemInfo.UserName     = userInfo.UserName;
                 bankrollItemInfo.ClientId     = userInfo.ClientId;
                 bankrollItemInfo.DateAndTime  = new DateTime?(this.DpkReceipt.Date);
                 bankrollItemInfo.Money        = num;
                 bankrollItemInfo.MoneyType    = 2;
                 bankrollItemInfo.CurrencyType = 1;
                 bankrollItemInfo.Bank         = this.DropBankShortName.SelectedItem.Text;
                 bankrollItemInfo.EBankId      = 0;
                 bankrollItemInfo.PaymentId    = 0;
                 bankrollItemInfo.OrderId      = 0;
                 bankrollItemInfo.Remark       = this.TxtRemark.Text.Trim();
                 bankrollItemInfo.LogTime      = new DateTime?(DateTime.Now);
                 bankrollItemInfo.Inputer      = PEContext.Current.Admin.AdminName;
                 bankrollItemInfo.IP           = PEContext.Current.UserHostAddress;
                 bankrollItemInfo.Memo         = this.TxtMemo.Text;
                 if (this.ChkPoint.Checked && !string.IsNullOrEmpty(userInfo.UserName))
                 {
                     int infoPoint = DataConverter.CLng(this.TxtPoint.Text);
                     if (Users.AddPoint(infoPoint, userInfo.UserName))
                     {
                         UserPointLogInfo userPointLogInfo = new UserPointLogInfo();
                         userPointLogInfo.Inputer      = PEContext.Current.Admin.AdminName;
                         userPointLogInfo.IP           = PEContext.Current.UserHostAddress;
                         userPointLogInfo.UserName     = userInfo.UserName;
                         userPointLogInfo.LogTime      = DateTime.Now;
                         userPointLogInfo.Remark       = "银行汇款赠送" + SiteConfig.UserConfig.PointName;
                         userPointLogInfo.Memo         = "";
                         userPointLogInfo.IncomePayOut = 1;
                         userPointLogInfo.Point        = infoPoint;
                         UserPointLog.Add(userPointLogInfo);
                     }
                 }
                 if (BankrollItem.Add(bankrollItemInfo))
                 {
                     StringBuilder builder = new StringBuilder();
                     builder.Append("<li>给会员添加银行汇款记录成功!</li>");
                     if (this.ChkIsSendMessage.Checked)
                     {
                         string sendContent = SiteConfig.SmsConfig.BankLogMessage.Replace("{$Money}", Math.Abs(bankrollItemInfo.Money).ToString()).Replace("{$BankName}", bankrollItemInfo.Bank).Replace("{$ReceiptDate}", this.DpkReceipt.Date.ToString());
                         builder.Append(Users.SendMessageToUser(userInfo, sendContent));
                     }
                     AdminPage.WriteSuccessMsg(builder.ToString(), "UserShow.aspx?UserID=" + userInfo.UserId);
                 }
                 else
                 {
                     AdminPage.WriteErrMsg("<li>向资金明细表中添加收入记录失败!</li>", "UserShow.aspx?UserID=" + userInfo.UserId);
                 }
             }
             else
             {
                 AdminPage.WriteErrMsg("<li>给会员添加银行汇款记录失败!</li>");
             }
         }
     }
 }