Example #1
0
        private void nuevoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ProveedorDialog dialog = new ProveedorDialog();

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                dialog.Save();
                Data.Proveedor record = dialog.Record;
                record.IdProveedor = Data.Default.Db.USPPROVEEDORINSERTAR <int>(Record.FromInstance(dialog.Record));
                source.Add(record);
                dgvProveedor.Update();
                dgvProveedor.Refresh();
            }
            dialog.Dispose();
        }
Example #2
0
 private void editarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (dgvProveedor.SelectedRows.Count > 0)
     {
         ProveedorDialog dialog = new ProveedorDialog(source[dgvProveedor.SelectedRows[0].Index]);
         if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             dialog.Save();
             dynamic record = dialog.Record;
             Data.Default.Db.USPPROVEEDORACTUALIZAR(Record.FromInstance(dialog.Record));
             dgvProveedor.Update();
             dgvProveedor.Refresh();
         }
         dialog.Dispose();
     }
 }