示例#1
0
 protected void Submit_Click(object sender, EventArgs e)
 {
     try
     {
         if (Page.IsValid)
         {
             int Bookid = objDb.BookCrud(txtAuthorName.Text, txtBookName.Text, txtpublisherName.Text,
                                         Convert.ToInt32(ddlcat.SelectedValue.ToString() == string.Empty ? 0 : Convert.ToInt32(ddlcat.SelectedValue.ToString())),
                                         ddlcat.SelectedItem.ToString(), 1, 0, hdnimg.Value);
             if (Bookid > 0)
             {
                 txtBookId.Text = Bookid.ToString();
                 ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('New Book Inserted Successfully');", true);
                 BindBookDetails();
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }