Пример #1
0
        private void cmdNew_Click(object sender, EventArgs e)
        {
            frmAskText frm = new frmAskText("New User", "Specify an username for the new user", "");

            if (frm.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            if (Program.net.AddUser(frm.RetText) == false)
            {
                MessageBox.Show(this, "Create new user failed: " + Program.net.GetLastError(), Program.Title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            LoadList();
        }
Пример #2
0
 private void setcommentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (LstOnly == true)
     {
         return;
     }
     if (lstComputers.SelectedItems.Count != 1)
     {
         return;
     }
     foreach (ListViewItem l in lstComputers.SelectedItems)
     {
         ComputerData cd  = (ComputerData)l.Tag;
         frmAskText   txt = new frmAskText("Change comment", "Change comment on computer " + cd.Computername, cd.Comments);
         if (txt.ShowDialog(this) != DialogResult.OK)
         {
             return;
         }
         Program.net.ChangeComputerComment(cd.MachineID, txt.RetText);
     }
     LoadList();
 }