Ejemplo n.º 1
0
 protected void btnget_Click(object sender, EventArgs e)
 {
     try
     {
         if (Session["Loginuid"] != null && Session["Loginuid"].ToString() != string.Empty)
         {
             GridViewRow row         = ((GridViewRow)((LinkButton)sender).NamingContainer);
             int         index       = row.RowIndex;
             string      LendStatus  = gvBook.DataKeys[row.RowIndex].Values[1].ToString();
             string      strBookCode = gvBook.DataKeys[row.RowIndex].Values[0].ToString();
             if (LendStatus == "1")
             {
                 //Response.Redirect("/Modules/NewBook.aspx?BookId=" + HttpUtility.UrlEncode((strBookCode.Trim())) + "", false);
                 objDb.LendBook(Convert.ToInt16(strBookCode), Convert.ToInt16(Session["Loginuid"].ToString()));
                 ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alertMessage('Selected Book Added');", true);
                 BindBooks();
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Selected Book Not Available');", true);
             }
         }
     }
     catch (Exception)
     {
     }
 }