void BindList()
 {
     this.dgvRechargeList.Rows.Clear();
     DataTable dt = new VipSoft.BLL.RechargeLog().GetReportList(QueryCondition()).Tables[0];
     foreach (DataRow dr in dt.Rows)
     {
         VipSoft.Model.CardLevel LevelModel=new VipSoft.BLL.CardLevel().GetModel(int.Parse(dr["LevelID"].ToString()));
         this.dgvRechargeList.Rows.Add(dr["CardID"].ToString(), dr["MemName"].ToString(), LevelModel.LevelName, dr["Type"].ToString() == "0" ? "卡片付费初始化" : dr["Type"].ToString() == "1" ? "储值卡现金充值" : dr["Type"].ToString() == "2" ? "记次卡现金充次" : dr["Type"].ToString() == "3" ? "储值卡扣款" : dr["Type"].ToString() == "5" ? "卡片余额初始化" : dr["Type"].ToString() == "6" ? "储值卡银联充值" : dr["Type"].ToString() == "7" ? "计次卡银联充次" : "积分返余额", dr["Money"].ToString(), dr["CreateTime"].ToString(), dr["GiveMoney"].ToString(), dr["Remark"].ToString());
     }
 }
示例#2
0
 private void BindRechageHistoryThread()
 {
     Thread.Sleep(50);
     VipSoft.BLL.RechargeLog re = new VipSoft.BLL.RechargeLog();
     DataTable dt = re.GetList(" memid=" + memInfo.ID + "").Tables[0];
     if (dt.Rows.Count == 0)
     {
         this.label_Loading_History1.Text = "暂无充值记录!";
         this.label_Loading_History1.Visible = true;
         this.dataGridView_Recharge.Visible = false;
         return;
     }
     this.label_Loading_History1.Visible = false;
     this.dataGridView_Recharge.Visible = true;
     foreach (DataRow dr in dt.Rows)
     {
         this.dataGridView_Recharge.Rows.Add(dr["CardID"], dr["MemName"], dr["Type"].ToString() == "0" ? "初始化" : dr["Type"].ToString() == "1" ? "充值" : "充次", dr["Money"], dr["CreateTime"], dr["GiveMoney"], dr["remark"]);
     }
 }
        private void myTabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.id.Text != "" && this.id.Text != null)
            {
                //假如界面的会员ID不为空,查询该会员的历史充值记录
                String conditionStr = "memid = " + this.id.Text;
                VipSoft.BLL.RechargeLog chargeBll = new VipSoft.BLL.RechargeLog();
                DataSet ds = chargeBll.GetList(conditionStr);
                this.dataGridView1.DataSource = ds.Tables[0];

                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    dataGridView1.Rows[i].Cells[0].Value = false;
                }

            }
        }
        private void recharge_Click(object sender, EventArgs e)
        {
            if (this.v_cardid.Text == null || this.v_cardid.Text == "")
            {
                MessageBox.Show("请先选择需要充值的会员!");
                this.search_box.Focus();
                return;
            }

            if (this.total.Text == "" || this.total.Text == null || decimal.Parse(this.total.Text) <= 0)
            {
                MessageBox.Show("请输入充值金额!");
                return;
            }

            int id = int.Parse(this.id.Text);
            decimal rechargeMoney = decimal.Parse(this.total.Text);
            VipSoft.BLL.MemCard mCard = new VipSoft.BLL.MemCard();
            VipSoft.Model.MemCard memModel = mCard.GetModel(id);

            //更新会员表的卡余额
            memModel.Money += rechargeMoney;
            mCard.Update(memModel);

            //往充值记录表插入充值记录
            VipSoft.BLL.RechargeLog chargeBll = new VipSoft.BLL.RechargeLog();
            VipSoft.Model.RechargeLog charge = new Model.RechargeLog();
            charge.MemID = id;
            charge.MemName = memModel.Name;
            charge.Money = decimal.Parse(this.rechargeAmount.Text);
            charge.CardID = memModel.CardID;
            charge.GiveMoney = decimal.Parse(this.giftAmount.Text);
            charge.MasterID = PublicState.Master.ID;
            charge.MasterName = PublicState.Master.Name;
            charge.ShopID = PublicState.Master.ShopID;
            charge.ShopName = PublicState.Master.ShopName;
            charge.Type = 0;
            if (chargeBll.Add(charge) > 0)
            {
                MessageBox.Show("充值成功!");
                this.Close();
            }
            else
            {
                MessageBox.Show("充值失败!");
            }
        }