Ejemplo n.º 1
0
        protected void btn_yes_Click(object sender, EventArgs e)
        {
            int bookindb = int.Parse(Request.QueryString[QueryString.InDb] ?? "0");

            if (bookindb > 0)
            {
                bookid = int.Parse(hd_bookid.Text);
                if (bookindb < 2)
                {
                    BookManager book = new BookManager();
                    book.CourseInsert(Request.QueryString[QueryString.CourseCode], hd_bookid.Text.Trim());
                }
                Response.Redirect("~/selldetails" + "?" + QueryString.BookId + "=" + bookid + "&" + QueryString.Price + "=" + hd_bookprice.Text.Trim());
            }
            else
            {
                BookManager book = new BookManager();
                bookid = book.BookInsert(lt_aztitle.Text.Trim(), lt_azauthor.Text.Trim(), hd_bookisbn.Text.Trim(),
                                         img_book.ImageUrl.Trim(), hd_bookprice.Text.Trim(), lt_azbinding.Text.Trim(), lt_azmanufacturer.Text.Trim(),
                                         lt_azedition.Text.Trim(), hd_bookean.Text.Trim(), Request.QueryString[QueryString.CourseCode]);
                if (bookid != null)
                {
                    Response.Redirect("~/selldetails" + "?" + QueryString.BookId + "=" + bookid + "&" + QueryString.Price + "=" + hd_bookprice.Text.Trim());
                }
                else
                {
                    msg_internalerrortb.Text = GetGlobalResourceObject(StringResource.FileName, "msg_internalerrortb").ToString();
                }
            }
        }