示例#1
0
        private void bttNuovo_Click(object sender, EventArgs e)
        {
            frmModDocViaggi newForm = new frmModDocViaggi();

            newForm.MdiParent = this.MdiParent;
            this.Hide();
            newForm.frmParent = this;
            newForm.Show();
        }
示例#2
0
 private void bttModifica_Click(object sender, EventArgs e)
 {
     if (dgvResult.CurrentRow != null)
     {
         if (dgvResult.CurrentRow.Cells["Fatturato"].Value.ToString() == "SI")
         {
             MessageBox.Show("Il viaggio è fatturato.\n\nImpossibile procedere ", "Attenzione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             frmModDocViaggi newForm = new frmModDocViaggi();
             newForm.MdiParent = this.MdiParent;
             this.Hide();
             newForm.frmParent = this;
             newForm.IdSel     = Convert.ToInt32(dgvResult.CurrentRow.Cells["ID"].Value);
             newForm.Show();
             NumberAllRow();
         }
     }
 }
        private void bttNuovaVoce_Click(object sender, EventArgs e)
        {
            if (IdSel > 0)
            {
                if (MessageBox.Show("Inserire una nuova voce di dettaglio ?", "Attenzione", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) != System.Windows.Forms.DialogResult.Yes)
                {
                    return;
                }
            }

            //Procedo con la modifca
            frmModDocViaggi frmNew = new frmModDocViaggi();

            frmNew.ShowDialog();
            if (frmNew.IsChange)
            {
                InsertDettViaggio(frmNew.IdSel);
                CalcolaRiepilogo();
            }
        }