private void BtnNew_Click(object sender, EventArgs e) { try { string phoneNumber = txbPhoneNumber.Text; string firstName = txbFirstName.Text; string lastName = txbLastName.Text; string address = txbAddress.Text; if (PhoneAddress.checkPhoneNumber(phoneNumber) == false) { MessageBox.Show("Wrong format at PhoneNumber field", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (PhoneAddress.checkName(firstName) == false || PhoneAddress.checkName(lastName) == false) { MessageBox.Show("Your name must contain alphabet characters only", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { string formedPhoneNumber = phoneNumber.Replace(" ", ""); //moi sua if (DataAccess.Insert(formedPhoneNumber, firstName, lastName, address) == 1) { DialogResult dr = MessageBox.Show("Success", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); //can them event dong form khi click OK if (dr == DialogResult.OK) { ParentMainForm.refreshDataGridView(PhoneAddress.SearchPhoneAddress(SearchDetails[0], SearchDetails[1], SearchDetails[2], SearchDetails[3])); this.Close(); } } } } catch (Exception ex) { MessageBox.Show("This number are already existed", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
/// <summary> /// event is fired when the 'DeleteNoteButton' is clicked. /// </summary> private void DeleteNoteButton_Click(object sender, EventArgs e) { // if the value for HasParentMainForm is true if (HasParentMainForm) { // Click the Delete button ParentMainForm.ClickDeleteButton(); } }
/// <summary> /// event is fired when Note Control _ Double Click /// </summary> private void NoteControl_DoubleClick(object sender, EventArgs e) { // if the value for HasParentMainForm is true if (HasParentMainForm) { // Click the Edit Button ParentMainForm.ClickEditButton(); } }
/// <summary> /// event is fired when the 'EditNoteButton' is clicked. /// </summary> private void EditNoteButton_Click(object sender, EventArgs e) { // if the value for HasParentMainForm is true if (HasParentMainForm) { // click the edit button ParentMainForm.ClickEditButton(); } }
//called from async method private void StartUpObservatory_wrapper() { Logging.AddLog("StartUp routine initiatied", LogLevel.Activity); ParseXMLScenario("scenarioMain"); Logging.AddLog("StartUp routine finished", LogLevel.Activity); //Change user interface buttons ParentMainForm.Invoke(new Action(() => ParentMainForm.endRunAction())); }
/// <summary> /// event is fired when Button _ Leave /// </summary> private void Button_Leave(object sender, EventArgs e) { // Change the cursor back to the default pointer Cursor = Cursors.Default; // if the note exists annd the ParentMainForm exists if (HasParentMainForm) { // Show the Hover Control ParentMainForm.HideHoverControl(); } }
/// <summary> /// event is fired when Button _ Enter /// </summary> private void Button_Enter(object sender, EventArgs e) { // Change the cursor to a hand Cursor = Cursors.Hand; // if the note exists annd the ParentMainForm exists if ((HasNote) && (HasParentMainForm)) { // Show the Hover Control ParentMainForm.ShowHoverControl(this); } }
public string startIQP() { ParentMainForm.IQPStart(); return("IQP started"); }