Пример #1
0
        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);
                    }
                }
            }
        }
Пример #2
0
        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);
                    }
                }
            }
        }