Esempio n. 1
0
        private void BindWeiXinMoney(int moneyID)
        {
            Chain.BLL.WeiXinMoney   bllWeiXinMoney   = new Chain.BLL.WeiXinMoney();
            Chain.Model.WeiXinMoney modelWeiXinMoney = bllWeiXinMoney.GetModel(moneyID);
            this.spEndTime.InnerHtml   = modelWeiXinMoney.EndTime.ToString("yyyy.MM.dd HH:mm");
            this.spStartTime.InnerHtml = modelWeiXinMoney.StartTime.ToString("yyyy.MM.dd HH:mm");
            int count = new Chain.BLL.WeiXinMoneyMem().GetRecordCount("MoneyID=" + modelWeiXinMoney.MoneyID);

            this.MemtotalCount.Value = count.ToString();
            DataTable dt;

            if (modelWeiXinMoney.QuerySql != null)
            {
                dt = new Chain.BLL.Mem().GetList(modelWeiXinMoney.QuerySql).Tables[0];
            }
            else
            {
                dt = new Chain.BLL.Mem().GetList("").Tables[0];
            }
            this.IsOwn.Value = "0";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (this.txtMemID.Value == dt.Rows[i]["MemID"].ToString())
                {
                    this.IsOwn.Value = "1";
                    break;
                }
            }
            int maxcount = modelWeiXinMoney.MaxCount;
            int memcount = new Chain.BLL.WeiXinGiveMoney().GetRecordCount(string.Concat(new object[]
            {
                " MemID=",
                int.Parse(this.txtMemID.Value),
                " and MoneyID=",
                modelWeiXinMoney.MoneyID
            }));

            this.MemCount.Value         = (maxcount - memcount).ToString();
            this.spNoUseCount.InnerHtml = this.MemCount.Value;
            this.MaxCount.Value         = modelWeiXinMoney.MaxCount.ToString();
            this.MoneyRate.Value        = modelWeiXinMoney.MoneyRate.ToString();
            this.TotalMoney.Value       = modelWeiXinMoney.TotalMoney.ToString();
            this.StartMoney.Value       = modelWeiXinMoney.StartMoney.ToString();
            this.EndMoney.Value         = modelWeiXinMoney.EndMoney.ToString();
            this.MoneyType.Value        = modelWeiXinMoney.MoneyType.ToString();
            this.FixedMoney.Value       = modelWeiXinMoney.FixedMoney.ToString();
            this.txtImageUrl.Value      = modelWeiXinMoney.ImageUrl.ToString();
            this.spDesc.InnerHtml       = modelWeiXinMoney.MoneyDesc.ToString();
            decimal money = new Chain.BLL.WeiXinGiveMoney().GetMoneySum(" MoneyID=" + modelWeiXinMoney.MoneyID);

            this.GiveMoney.Value = money.ToString();
        }
Esempio n. 2
0
        private void BindWeiXinMoney(int MoneyID)
        {
            Chain.Model.WeiXinMoney modelWeiXinMoney = new Chain.BLL.WeiXinMoney().GetModel(MoneyID);
            int maxcount = modelWeiXinMoney.MaxCount;
            int memcount = new Chain.BLL.WeiXinGiveMoney().GetRecordCount(string.Concat(new object[]
            {
                " MemID=",
                int.Parse(this.txtMemID.Value),
                " and MoneyID=",
                modelWeiXinMoney.MoneyID
            }));

            this.MemCount.Value   = (maxcount - memcount).ToString();
            this.txtMoneyID.Value = modelWeiXinMoney.MoneyID.ToString();
            this.MaxCount.Value   = modelWeiXinMoney.MaxCount.ToString();
            this.MoneyRate.Value  = modelWeiXinMoney.MoneyRate.ToString();
            this.TotalMoney.Value = modelWeiXinMoney.TotalMoney.ToString();
            this.StartMoney.Value = modelWeiXinMoney.StartMoney.ToString();
            this.EndMoney.Value   = modelWeiXinMoney.EndMoney.ToString();
            this.MoneyType.Value  = modelWeiXinMoney.MoneyType.ToString();
            this.FixedMoney.Value = modelWeiXinMoney.FixedMoney.ToString();
            int count     = new Chain.BLL.WeiXinMoneyMem().GetRecordCount("MoneyID=" + modelWeiXinMoney.MoneyID);
            int giveCount = new Chain.BLL.WeiXinGiveMoney().GetRecordCount("MoneyID=" + modelWeiXinMoney.MoneyID);

            this.MemtotalCount.Value  = count.ToString();
            this.txtRemainMoney.Value = (modelWeiXinMoney.TotalMoney - modelWeiXinMoney.GiveMoney).ToString();
            this.txtRemainCount.Value = Math.Floor(double.Parse(((count - giveCount) * modelWeiXinMoney.MoneyRate / 100m).ToString())).ToString();
            double min        = double.Parse(modelWeiXinMoney.StartMoney.ToString());
            double max        = double.Parse(modelWeiXinMoney.EndMoney.ToString());
            double fixedmoney = double.Parse(modelWeiXinMoney.FixedMoney.ToString());
            double getmoney;

            if (modelWeiXinMoney.MoneyType == 1)
            {
                getmoney = this.GetRandomMoney(max, min);
            }
            else
            {
                getmoney = this.GetFixedMoney(fixedmoney);
            }
            this.txtgetmoney.Value = getmoney.ToString();
        }