private void btnUpdate_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtYear.Text) || string.IsNullOrEmpty(txtSemester.Text)) { MessageBox.Show("Please select Year and Semester first!", "Update Message", MessageBoxButtons.OK, MessageBoxIcon.Error); initForm(); } else { ActionResult updateResult = formCtrl._updateFormData(new ASYModel() { ASYID = ASYIdForTrack, Year = txtYear.Text.Trim(), Semester = txtSemester.Text.Trim(), YS = txtYear.Text.Trim() + "." + txtSemester.Text.Trim() }); if (updateResult.State) { ASYModel updateObj = updateResult.Data; MessageBox.Show("Academic Year And Semester " + updateObj.YS + " Sucessfully Updated!", "Update Message", MessageBoxButtons.OK, MessageBoxIcon.Information); initForm(); } else { MessageBox.Show(updateResult.Data, "Update Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnInsert_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtYear.Text)) { MessageBox.Show("Please Enter Acedemic Year!", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (string.IsNullOrEmpty(txtSemester.Text)) { MessageBox.Show("Please Enter Acedemic Semester!", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { ActionResult saveResult = formCtrl._saveFormData(new ASYModel() { Year = txtYear.Text.Trim(), Semester = txtSemester.Text.Trim(), YS = txtYear.Text.Trim() + "." + txtSemester.Text.Trim() }); if (saveResult.State) { ASYModel saveObj = saveResult.Data; MessageBox.Show("Academic Year And Semester " + saveObj.YS + " Sucessfully Saved!", "Save Message", MessageBoxButtons.OK, MessageBoxIcon.Information); initForm(); } else { MessageBox.Show(saveResult.Data, "Save Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnDelete_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtYear.Text) || string.IsNullOrEmpty(txtSemester.Text)) { MessageBox.Show("Please select Year and Semester first!", "Delete Message", MessageBoxButtons.OK, MessageBoxIcon.Error); initForm(); } else { ActionResult deleteResult = formCtrl._deleteFormData(new ASYModel() { ASYID = ASYIdForTrack }); if (deleteResult.State) { ASYModel deleteObj = deleteResult.Data; MessageBox.Show("Year And Semester Sucessfully Deleted!", "Delete Message", MessageBoxButtons.OK, MessageBoxIcon.Information); initForm(); } else { MessageBox.Show(deleteResult.Data, "Delete Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }