示例#1
0
        private void ribbonButton7_Click(object sender, EventArgs e)    // добавить ПО
        {
            SoftForm form = new SoftForm();

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string cmd = string.Format("INSERT INTO 'soft' ('name','key','license','installdate','workplace') VALUES ('{0}','{1}','{2}','{3}','{4}');", form.nameSoft, form.key, form.license, form.date, tree.SelectedNode.Tag.ToString());
                SQL.ExecSQL(cmd);
                LoadSoft();
            }
        }
示例#2
0
 private void ribbonButton10_Click(object sender, EventArgs e)   // редактировать ПО
 {
     if (grid3.CurrentRow != null)
     {
         SoftForm form = new SoftForm();
         form.nameSoft = grid3.CurrentRow.Cells[1].Value.ToString();
         form.key      = grid3.CurrentRow.Cells[2].Value.ToString();
         form.license  = grid3.CurrentRow.Cells[3].Value.ToString();
         form.date     = grid3.CurrentRow.Cells[4].Value.ToString();
         if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             string cmd = string.Format("DELETE FROM 'soft' WHERE id={5}; INSERT INTO 'soft' ('name','key','license','installdate','workplace','id') VALUES ('{0}','{1}','{2}','{3}','{4}','{5}');", form.nameSoft, form.key, form.license, form.date, tree.SelectedNode.Tag.ToString(), grid3.CurrentRow.Cells[5].Value.ToString());
             SQL.ExecSQL(cmd);
             LoadSoft();
         }
     }
 }