private void btn_Sure_Click(object sender, EventArgs e) { if (controller.Entry == null) { controller.LoadEntry(); onExtractInputValue(); if (controller.InsertEntry()) { onInitialUI(); controller.ReleaseEntry(); } else { MessageBoxHelper.ShowCreateStateDialog(false); } } else { onExtractInputValue(); if (controller.UpdateEntryByID()) { onInitialUI(); controller.ReleaseEntry(); } else { MessageBoxHelper.ShowUpdateStateDialog(false); } } }
private void simpleButton1_Click(object sender, EventArgs e) { Validator validator = onValidateInputValue(); if (validator.IsValidate == false) { MessageBoxHelper.ShowInputErrorDialog(validator.ErrorMessage); return; } onExtractInputValue(); if (controller.UpdateEntryByID()) { onInitialUI(); controller.ReleaseEntry(); } else { MessageBoxHelper.ShowUpdateStateDialog(false); } }