protected void btnDelete_Click(object sender, EventArgs e) { DBABookDAL dal = new DBABookDAL(); CatalogClass ba = new CatalogClass(); ba.bookId = int.Parse(txtBookIdToDel.Text); dal.DeleteBookByDBA(ba); }
protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e) { Label l = (Label)e.Item.FindControl("Label1"); DBABookDAL dal = new DBABookDAL(); BookDAL d = new BookDAL(); CatalogClass ba = new CatalogClass(); ba.bookId = int.Parse(l.Text); dal.DeleteBookByDBA(ba); List <BookCatalogJoin> bklst1 = d.GetBooksByTitle(str); DataList1.DataSource = bklst1; DataList1.DataBind(); ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript:deleteMsgDisplay(); ", true); }
protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e) { BookClass bk = new BookClass(); Label l = (Label)e.Item.FindControl("lblisbn"); bk.ISBN = l.Text; TextBox tb1 = (TextBox)e.Item.FindControl("txtbookTitle"); bk.bookTitle = tb1.Text; TextBox tb2 = (TextBox)e.Item.FindControl("txtAuthorName"); bk.authorName = tb2.Text; TextBox tb3 = (TextBox)e.Item.FindControl("txtPublication"); bk.publication = tb3.Text; TextBox tb4 = (TextBox)e.Item.FindControl("txtEdition"); bk.edition = int.Parse(tb4.Text); TextBox tb5 = (TextBox)e.Item.FindControl("txtCategory"); bk.category = tb5.Text; TextBox tb6 = (TextBox)e.Item.FindControl("txtbookURL"); bk.bookURL = tb6.Text; TextBox tb7 = (TextBox)e.Item.FindControl("txtPrice"); bk.price = int.Parse(tb7.Text); TextBox tb8 = (TextBox)e.Item.FindControl("txtquantity"); bk.quantity = int.Parse(tb8.Text); TextBox tb9 = (TextBox)e.Item.FindControl("txtPages"); bk.pages = int.Parse(tb9.Text); TextBox tb10 = (TextBox)e.Item.FindControl("txtKeywords"); bk.keywords = tb10.Text; TextBox tb12 = (TextBox)e.Item.FindControl("txtDescription"); bk.description = tb12.Text; DBABookDAL c = new DBABookDAL(); c.UpdateBook(bk); DataList1.EditItemIndex = -1; DataList1.DataBind(); }
protected void Button1_Click1(object sender, EventArgs e) { DBABookDAL dal = new DBABookDAL(); LoginClass log = new LoginClass(); log.UserId = txtUserId.Text; log.password = txtPassword.Text; if (dal.Login(log)) { Session["status"] = true; Response.Redirect("Main.aspx"); } else { lblError.Text = "<font color=yellow>Invalid Userid or Password</font>"; } }
protected void btnSubmit_Click(object sender, EventArgs e) { DBABookDAL ba = new DBABookDAL(); BookClass bk = new BookClass(); bk.ISBN = txtISBN.Text.ToString(); bk.bookTitle = txtBookTitle.Text.ToString(); bk.authorName = txtAuthorFirst.Text.ToString(); bk.description = txtDescription.Text.ToString(); bk.publication = txtPub.Text.ToString(); bk.edition = int.Parse(txtEdition.Text); bk.category = txtCategory.Text.ToString(); bk.bookURL = txtBookUrl.Text.ToString(); bk.price = int.Parse(txtPrice.Text); bk.pages = int.Parse(txtPages.Text); bk.keywords = txtKeywords.Text.ToString(); ba.Insert(bk); }