private void btnAddNewIncome_Click(object sender, EventArgs e) { IncomeDetailManager income = new IncomeDetailManager(); income.LocationID = Convert.ToInt32(drpLocationList.SelectedValue); income.Name = txtName.Text; income.Date = Convert.ToDateTime(dateTime.Text); income.Amount = Convert.ToInt32(txtAmount.Text); income.Note = txtNote.Text; bool res = income.AddIncome(income); if (res) { MessageBox.Show("Record Inserted Succesfully.!"); bindIncomeGrid(); pnlAddIncomeForm.Visible = false; PnlIncomeGrid.Visible = true; } else { MessageBox.Show("Error.!"); } }