private void btnAddNew_Click(object sender, EventArgs e) { if (currentTab.Text == Language.Resource.ManageEmails) { frmMailUpdate mails = new frmMailUpdate(); mails.Show(); } else if (currentTab.Text == Language.Resource.ManageConnections) { frmConnectionUpdate connections = new frmConnectionUpdate(); connections.Show(); } else if (currentTab.Text == Language.Resource.ManageAccounts) { frmAccountUpdate accounts = new frmAccountUpdate(); accounts.Show(); } else if (currentTab.Text == Language.Resource.ManageUsers) { frmMain main = (frmMain)Application.OpenForms["frmMain"]; main.Logout(); this.Close(); frmRegister register = new frmRegister(); register.Show(); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (currentTab != null) { string message = Language.Resource.Message; ListView lsView = (ListView)GetCurrentListView(); if (lsView != null) { if (lsView.SelectedItems.Count > 0) { if (currentTab.Name == "tabMails") { frmMailUpdate mail = new frmMailUpdate(lsView.SelectedItems[0].Text); mail.Show(); } else if (currentTab.Name == "tabConnections") { frmConnectionUpdate connection = new frmConnectionUpdate(lsView.SelectedItems[0].Text); connection.Show(); } else if (currentTab.Name == "tabAccounts") { frmAccountUpdate account = new frmAccountUpdate(lsView.SelectedItems[0].Text); account.Show(); } else if (currentTab.Name == "tabUsers") { frmUserAccount useraccount = new frmUserAccount(lsView.SelectedItems[0].Text); useraccount.Show(); } } else { MessageBox.Show(Language.Resource.RowNotSelectedForUpdate, message); } } } }