private async void btnSave_Click(object sender, EventArgs e) { var request = new StreetUpsertRequest() { StreetName = txtStreetName.Text }; await streetService.Update <MStreet>(_Id, request); MessageBox.Show("Street has been updated successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); }
private async void btnSave_Click(object sender, EventArgs e) { if (ValidateChildren()) { var request = new StreetUpsertRequest { CityId = _Id, StreetName = txtStreetName.Text }; await streetService.Insert <MStreet>(request); MessageBox.Show("Street added Successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("All fields are required.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } }