Esempio n. 1
0
 protected void btn_MyCart_Click(object sender, EventArgs e)
 {
     if (Session["type"].ToString() == "Student")
     {
         int        bid    = Convert.ToInt32(txt_Bookid.Text);
         int        sid    = Convert.ToInt32(Session["loginid"]);
         LibraryDAL dal    = new LibraryDAL();
         int        CartID = dal.AddCart(bid, sid);
         if (CartID == 0)
         {
             lbl_msg.Text = "Book is already in cart";
         }
         else
         {
             lbl_msg.Text = "Book added in Cart :" + CartID;
         }
     }
     else
     {
         lbl_msg.Text = "Admin Cannot Add to Cart";
     }
 }