private void btnSave_Click(object sender, EventArgs e) { int er = 0; ep.Clear(); if (txtName.Text == "") { er++; ep.SetError(txtName, "Required"); } if (txtAddress.Text == "") { er++; ep.SetError(txtAddress, "Required"); } if (txtPhoneNumber.Text == "") { er++; ep.SetError(txtPhoneNumber, "Required"); } if (txtBalance.Text == "") { er++; ep.SetError(txtBalance, "Required"); } if (er > 0) { return; } DAL.User user = new DAL.User(); user.Id = Id; user.Name = txtName.Text; user.PhoneNumber = txtPhoneNumber.Text; user.Address = txtAddress.Text; user.Balance = Convert.ToDouble(txtBalance.Text); if (user.Update_Admin()) { RefreshGrid(); MessageBox.Show("Information Updated!"); } else { MessageBox.Show(user.Error); } }