コード例 #1
0
        protected void btn_confirm_Click(object sender, EventArgs e)
        {
            BookManager book    = new BookManager();
            string      na      = "N/A";
            string      author  = txt_author.Text.Trim();
            string      edition = txt_edition.Text.Trim();

            if (String.IsNullOrEmpty(author))
            {
                author = na;
            }
            if (String.IsNullOrEmpty(edition))
            {
                edition = na;
            }
            bookid = book.BookInsert(txt_title.Text.Trim(), author, txt_isbn.Text.Trim(),
                                     na, na, na, na, edition, na, txt_coursecode.Text.Trim());
            string      ubookid  = bookid.ToString();
            string      area     = Request.Form[ddl_clocation.UniqueID];
            string      location = txt_clocation.Text.Trim();
            ListManager list     = new ListManager();
            Dictionary <string, string> accountInfo = (Dictionary <string, string>)Session[USession.AccountInfo];

            if (area == "UBC")
            {
                location = String.Empty;
            }
            list.ListInsert(accountInfo[UAccount.UserId], ubookid, Request.Form[ddl_ccondition.UniqueID], txt_cprice.Text.Trim(),
                            area, location, txt_cnotes.Text.Trim());
            Response.Redirect("~/mylisting");
        }
コード例 #2
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();
                }
            }
        }