private void deleteButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(bookTextBox.Text)) { MessageBox.Show("Enter Book Name", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (!string.IsNullOrEmpty(QuantityRemovedTxt.Text)) { MessageBox.Show("You Can Not Delete The Quantity You Can Delete The Book Details When Book Inventory Is zero", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { ob1 = cmd.GetBookName(ob.Id); if (ob1.Id == ob.Id) { MessageBox.Show("Book is in issue....", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (ob.BookInventory == 0) { cmd1.DeleteDetails(ob.Id); MessageBox.Show("Book Information Deleted Successfully", "Congratulation", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (ob.BookInventory > 0) { MessageBox.Show("There are book In your library you can not delete the information", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void returnButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(returnBookText.Text)) { MessageBox.Show("Please Enter Book Name", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { int issueid; ob1 = cmd.GetBookName(ob.Id); issueid = ob1.IssueId; if (ob.Id == ob1.Id) { sd.ReturnBook1(name, returnbook); sd.DeleteIssue(issueid); MessageBox.Show("Book Returned Successfullly", "Congratulation", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("Book Does Not Issue", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }