예제 #1
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            GameCard g = new GameCard();

            g.cardid = Convert.ToInt32(this.GridView1.DataKeys[e.RowIndex].Value);
            bool flag = new CardinfoBLL().delMsg(g);

            if (flag)
            {
                Response.Write("<script>alert('删除成功')</script>");
                ShowGrid();
            }
            else
            {
                Response.Write("<script>alert('删除失败')</script>");
            }
        }
예제 #2
0
        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            GameCard g = new GameCard();

            g.gamename = this.TextBox1.Text;
            g.company  = this.TextBox2.Text;
            g.lastDay  = Convert.ToDateTime(this.TextBox3.Text);
            g.price    = Convert.ToInt32(this.TextBox4.Text);
            bool flag = new CardinfoBLL().AddCardBLL(g);

            if (flag)
            {
                Response.Write("<script>alert('添加成功')</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败')</script>");
            }
        }