private void btnUpdate_Click(object sender, EventArgs e) { var en = new ReceptionistEntity(); var re = new ReceptionistRepo(); if (ValidateToSave() == true) { en.Id = txtRid.Text; en.Name = txtRname.Text; en.Age = txtRage.Text; en.Sex = txtRsex.Text; en.Reference = txtRreference.Text; en.Address = txtRaddress.Text; en.Phone = txtRphone.Text; en.Username = txtRusername.Text; en.Password = txtRpassword.Text; if (MessageBox.Show("Are you sure ?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.No) { return; } else { re.Update(en); } UserName = en.Username; lblUser.Text = en.Username; } else { MessageBox.Show("Invalid Input"); } }