public AddNewContact(ContactManagerrr c, int index) { this.indextoedit = index; this.instan = c; isEdit = true; InitializeComponent(); }
private void EmailDetilsVievwer() { if (MessagesListBoc.SelectedIndex >= 0) { int index = MessagesListBoc.SelectedIndex; ContactManagerrr a = messages[index]; EmailSending email = new EmailSending(a.getName(), a.getEmail(), a.getSubject(), a.getMessage()); email.ShowDialog(); } }
private void sendEmailToolStripMenuItem_Click(object sender, EventArgs e) { if (ListBox.SelectedIndex >= 0) { int ag = ListBox.SelectedIndex; ContactManagerrr m = instances[ag]; EmailSending emailsending = new EmailSending(m.getName(), m.getEmail()); emailsending.ShowDialog(); ReloadMessaging(); ReloadRoster(); } }
private void ListBox_DoubleClick(object sender, EventArgs e) { if (ListBox.SelectedIndex >= 0) { int ag = ListBox.SelectedIndex; ContactManagerrr c = instances[ag]; AddNewContact ance = new AddNewContact(c, ag); ance.isEdit = true; ance.ShowDialog(); ReloadRoster(); } }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (ListBox.SelectedIndex >= 0) { int IndexofSelected = ListBox.SelectedIndex; ContactManagerrr c = instances[IndexofSelected]; if (MessageBox.Show("Are you Sure to want to delete " + c.getName(), "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { instances.RemoveAt(IndexofSelected); ReloadRoster(); } } }
private void SaveButton_Click(object sender, EventArgs e) { if (isValidated()) { ContactManagerrr cm = new ContactManagerrr(); cm.setName(NametextBox.Text.Trim()); cm.setEmail(EmailtextBox.Text.Trim()); cm.setSubject(SubjecttextBox.Text.Trim()); cm.SetMessage(MessagetextBox.Text.Trim()); ContactManagerUi.messages.Add(cm); MessageBox.Show("Email Sent", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); ResetForm(); this.Close(); } }
private void Savebutton_Click(object sender, EventArgs e) { if (isValidated()) { ContactManagerrr cm = new ContactManagerrr(); cm.setName(NametextBox.Text.Trim()); cm.setEmail(EmailtextBox.Text.Trim()); if (!isEdit) { ContactManagerUi.instances.Add(cm); MessageBox.Show("All Data Saved", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (isEdit) { ContactManagerUi.instances[indextoedit] = cm; } ResetForm(); this.Close(); } }