Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckLogin();
            DataTable dt = CobcYouthDAL.GetMember();

            GridViewMember.DataSource = dt;
            GridViewMember.DataBind();
        }
Пример #2
0
 protected void GridViewMember_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "DeleteRow")
     {
         int memberID = int.Parse(e.CommandArgument.ToString());
         MemberDAO.DeleteMember(memberID);
         GridViewMember.DataBind();
     }
 }
Пример #3
0
        protected void ButtonAdd_Click(object sender, EventArgs e)
        {
            string name    = TextBoxName.Text.Trim();
            string sex     = TextBoxSex.Text.Trim();
            string address = TextBoxAddress.Text.Trim();
            string phone   = TextBoxPhone.Text.Trim();
            string email   = TextBoxEmail.Text.Trim();

            MemberDAO.InsertMember(name, sex, address, phone, email);
            GridViewMember.DataBind();
        }