Exemplo n.º 1
0
        protected override void AttachChildControls()
        {
            this.litAmount        = (FormatedMoneyLabel)this.FindControl("litAmount");
            this.litUsername      = (System.Web.UI.WebControls.Literal) this.FindControl("litUsername");
            this.litTrueName      = (System.Web.UI.WebControls.Literal) this.FindControl("litTrueName");
            this.litOrderCount    = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderCount");
            this.litTelphone      = (System.Web.UI.WebControls.Literal) this.FindControl("litTelphone");
            this.litAuditTime     = (System.Web.UI.WebControls.Literal) this.FindControl("litAuditTime");
            this.litLastOrderTime = (System.Web.UI.WebControls.Literal) this.FindControl("litLastOrderTime");
            PageTitle.AddSiteNameTitle("下级推广员详情");
            int userId = 0;

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["UserID"]))
            {
                int.TryParse(this.Page.Request.QueryString["UserID"], out userId);
            }
            SubReferralUser myReferralSubUser = MemberProcessor.GetMyReferralSubUser(userId);

            if (myReferralSubUser == null)
            {
                this.ShowMessage("错误的推广员ID", false);
            }
            this.litAmount.Money       = myReferralSubUser.SubReferralSplittin;
            this.litUsername.Text      = myReferralSubUser.UserName;
            this.litTrueName.Text      = myReferralSubUser.RealName;
            this.litOrderCount.Text    = myReferralSubUser.ReferralOrderNumber.ToString();
            this.litTelphone.Text      = myReferralSubUser.CellPhone;
            this.litAuditTime.Text     = (myReferralSubUser.ReferralAuditDate.HasValue ? myReferralSubUser.ReferralAuditDate.Value.ToString("yyyy-MM-dd hh:mm:ss") : "");
            this.litLastOrderTime.Text = (myReferralSubUser.LastReferralDate.HasValue ? myReferralSubUser.LastReferralDate.Value.ToString("yyyy-MM-dd hh:mm:ss") : "");
        }
Exemplo n.º 2
0
        protected override void AttachChildControls()
        {
            this.litAmount        = (FormatedMoneyLabel)this.FindControl("litAmount");
            this.litUsername      = (Literal)this.FindControl("litUsername");
            this.litTrueName      = (Literal)this.FindControl("litTrueName");
            this.litOrderCount    = (Literal)this.FindControl("litOrderCount");
            this.litTelphone      = (Literal)this.FindControl("litTelphone");
            this.litAuditTime     = (Literal)this.FindControl("litAuditTime");
            this.litLastOrderTime = (Literal)this.FindControl("litLastOrderTime");
            PageTitle.AddSiteNameTitle("下级分销员详情");
            int userId = 0;

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["UserID"]))
            {
                int.TryParse(this.Page.Request.QueryString["UserID"], out userId);
            }
            SubReferralUser myReferralSubUser = MemberProcessor.GetMyReferralSubUser(userId);

            if (myReferralSubUser == null)
            {
                this.ShowMessage("错误的分销员ID", false, "", 1);
            }
            this.litAmount.Money    = myReferralSubUser.SubReferralSplittin;
            this.litUsername.Text   = myReferralSubUser.UserName;
            this.litTrueName.Text   = myReferralSubUser.RealName;
            this.litOrderCount.Text = myReferralSubUser.ReferralOrderNumber.ToString();
            this.litTelphone.Text   = myReferralSubUser.CellPhone;
            Literal  literal = this.litAuditTime;
            object   text;
            DateTime value;

            if (!myReferralSubUser.ReferralAuditDate.HasValue)
            {
                text = "";
            }
            else
            {
                value = myReferralSubUser.ReferralAuditDate.Value;
                text  = value.ToString("yyyy-MM-dd HH:mm:ss");
            }
            literal.Text = (string)text;
            Literal literal2 = this.litLastOrderTime;
            object  text2;

            if (!myReferralSubUser.LastReferralDate.HasValue)
            {
                text2 = "";
            }
            else
            {
                value = myReferralSubUser.LastReferralDate.Value;
                text2 = value.ToString("yyyy-MM-dd HH:mm:ss");
            }
            literal2.Text = (string)text2;
        }
Exemplo n.º 3
0
        public SubReferralUser GetMyReferralSubUser(int UserId)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendFormat("SELECT * , (SELECT SUM(Income) FROM Ecshop_SplittinDetails WHERE TradeType = 2 AND SubUserId = m.UserId) AS SubMemberSplittin, (SELECT SUM(Income) FROM Ecshop_SplittinDetails WHERE TradeType = 3 AND SubUserId = m.UserId) AS SubReferralSplittin, (SELECT COUNT(*) FROM Ecshop_SplittinDetails WHERE TradeType = 1 AND UserId = m.UserId) AS ReferralOrderNumber, (SELECT Top 1 TradeDate FROM Ecshop_SplittinDetails WHERE TradeType = 1 AND UserId = m.UserId ORDER BY JournalNumber DESC) AS LastReferralDate from vw_aspnet_Members m where UserId=" + UserId, new object[0]);
            SubReferralUser subReferralUser  = null;
            DbCommand       sqlStringCommand = this.database.GetSqlStringCommand(stringBuilder.ToString());

            using (IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                if (dataReader.Read())
                {
                    subReferralUser          = new SubReferralUser();
                    subReferralUser.UserID   = (int)dataReader["UserId"];
                    subReferralUser.UserName = (string)dataReader["UserName"];
                    subReferralUser.RealName = "";
                    if (dataReader["RealName"] != DBNull.Value)
                    {
                        subReferralUser.RealName = (string)dataReader["RealName"];
                    }
                    if (dataReader["ReferralAuditDate"] != DBNull.Value)
                    {
                        subReferralUser.ReferralAuditDate = new DateTime?((DateTime)dataReader["ReferralAuditDate"]);
                    }
                    if (dataReader["LastReferralDate"] != DBNull.Value)
                    {
                        subReferralUser.LastReferralDate = new DateTime?((DateTime)dataReader["LastReferralDate"]);
                    }
                    if (dataReader["CreateDate"] != DBNull.Value)
                    {
                        subReferralUser.CreateDate = (DateTime)dataReader["CreateDate"];
                    }
                    if (dataReader["CellPhone"] != DBNull.Value)
                    {
                        subReferralUser.CellPhone = (string)dataReader["CellPhone"];
                    }
                    if (dataReader["ReferralOrderNumber"] != DBNull.Value)
                    {
                        subReferralUser.ReferralOrderNumber = (int)dataReader["ReferralOrderNumber"];
                    }
                    if (dataReader["SubReferralSplittin"] != DBNull.Value)
                    {
                        subReferralUser.SubReferralSplittin = (decimal)dataReader["SubReferralSplittin"];
                    }
                }
            }
            return(subReferralUser);
        }