private void bttNuovo_Click(object sender, EventArgs e) { frmModAutomezzi newForm = new frmModAutomezzi(); newForm.MdiParent = this.MdiParent; this.Hide(); newForm.frmParent = this; newForm.Show(); }
private void bttModifica_Click(object sender, EventArgs e) { if (dgvResult.CurrentRow != null) { frmModAutomezzi newForm = new frmModAutomezzi(); newForm.MdiParent = this.MdiParent; this.Hide(); newForm.frmParent = this; newForm.IdSel = Convert.ToInt32(dgvResult.CurrentRow.Cells["ID"].Value); newForm.Show(); } }
public static int ShowModal_GestTab_ForSelect(clsGlobal.ETypeTable Type, ComboBox objCombo = null) { int RetValue = 0; switch (Type) { case ETypeTable.TT_IVA: case ETypeTable.TT_IVA_DESCR: case ETypeTable.TT_UNIT_MISURA: case ETypeTable.TT_CATEGORIA: case ETypeTable.TT_LOCALITA: case ETypeTable.TT_MOD_PAGAMENTO: case ETypeTable.TT_ESENZIONI: frmGestTab frmTab = new frmGestTab(); if (Type == ETypeTable.TT_IVA_DESCR) { frmTab.TypeTable = ETypeTable.TT_IVA; } else { frmTab.TypeTable = Type; } frmTab.IsInsertOnly = true; frmTab.ShowDialog(); RetValue = frmTab.IdSel; break; case ETypeTable.TT_ASSICURAZIONI: break; case ETypeTable.TT_TIP_PAGAMENTO: frmTipoPag frmTabTipoPag = new frmTipoPag(); frmTabTipoPag.IsInsertOnly = true; frmTabTipoPag.ShowDialog(); RetValue = frmTabTipoPag.IdSel; break; case ETypeTable.TT_BANCHE_AZ: frmBanche frmTabBanche = new frmBanche(); frmTabBanche.IsInsertOnly = true; frmTabBanche.ShowDialog(); RetValue = frmTabBanche.IdSel; break; case ETypeTable.TT_DISTANZE: frmDistanze frmTabDist = new frmDistanze(); frmTabDist.ShowDialog(); RetValue = frmTabDist.IdSel; break; case ETypeTable.TT_AUTOMEZZI: frmModAutomezzi frmTabTruck = new frmModAutomezzi(); frmTabTruck.ShowDialog(); RetValue = frmTabTruck.IdSel; break; case ETypeTable.TT_ARTICOLI: case ETypeTable.TT_ARTICOLI_DESC_COD: frmModArticoli frmTabArt = new frmModArticoli(); frmTabArt.ShowDialog(); RetValue = frmTabArt.IdSel; break; case ETypeTable.TT_CLIENTI: frmModCliente frmTabCli = new frmModCliente(); frmTabCli.ShowDialog(); RetValue = frmTabCli.IdSel; break; default: break; } if (objCombo != null) { if (RetValue > 0) { objCombo.Tag = RetValue; } clsDataBase.PopolaCombo(objCombo, Type); } return(RetValue); }