Beispiel #1
0
 protected void GridViewCopy_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "DeleteRow")
     {
         int copyID = int.Parse(e.CommandArgument.ToString());
         CopyDAO.DeleteCopy(copyID);
         GridViewCopy.DataBind();
     }
 }
Beispiel #2
0
        protected void ButtonAddCopy_Click(object sender, EventArgs e)
        {
            int    bookCode = int.Parse(TextBoxBookCode.Text.Trim());
            int    copyNum, sequenceNum, price;
            string type = TextBoxType.Text.Trim();

            if (!int.TryParse(TextBoxCopyNumber.Text.Trim(), out copyNum))
            {
                return;
            }
            else if (!int.TryParse(TextBoxSequenceNumber.Text.Trim(), out sequenceNum))
            {
                return;
            }
            else if (!int.TryParse(TextBoxPrice.Text.Trim(), out price))
            {
                return;
            }
            CopyDAO.InsertCopy(bookCode, copyNum, sequenceNum, type, price);
            GridViewCopy.DataBind();
        }