private void onUpdateTechniqueState() { if (controller.UpdateEntry()) { this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBoxHelper.ShowUpdateStateDialog(false); } }
private void btn_sure_Click(object sender, EventArgs e) { Validator validator = onValidateInputValue(); if (validator.IsValidate == false) { MessageBoxHelper.ShowInputErrorDialog(validator.ErrorMessage); return; } onExtractInputValue(); if (string.IsNullOrEmpty(controller.CurrentObjectID)) { if (controller.InsertEntry()) { onInitialUI(); controller.ReleaseEntry(); } else { MessageBoxHelper.ShowCreateStateDialog(false, controller.ErrorMessage); } } else { if (controller.UpdateEntry()) { onInitialUI(); controller.ReleaseEntry(); } else { MessageBoxHelper.ShowUpdateStateDialog(false); } } }