예제 #1
0
        protected void Insert(object sender, EventArgs e)
        {
            try
            {
                BookBL bookBL = new BookBL();
                BookBO book   = new BookBO();

                book = GetBookObject(book);


                bookTable = (List <BookBO>)Session[Common.sessionBookList];
                if (bookTable == null)
                {
                    bookTable = new List <BookBO>();
                }

                bookTable = bookBL.Add(book, bookTable);

                Session[Common.sessionBookList] = bookTable;

                Session["bookId"] = book.Id + 1;

                gvBookList.EditIndex = -1;
                FillGrid();

                lblSuccessMessage.Text = Common.msgAddSuccess;
            }
            catch (Exception ex)
            {
                lblErrorMessage.Text = Common.msgAddFailure;
            }
        }