public void LoadFormGestTab(clsGlobal.ETypeTable TypeTable)
        {
            string sTextCaption = clsGlobal.GetCaptionTabForm(TypeTable);

            int count = 0;

            foreach (Form childForm in MdiChildren)
            {
                if (childForm.GetType().ToString() == "Trucks.frmGestTab")
                {
                    if (childForm.Text == sTextCaption)
                    {
                        childForm.Focus();
                        count++;
                    }
                }
            }
            if (count == 0)
            {
                Form childForm = new frmGestTab();
                childForm.MdiParent = this;
                ((frmGestTab)childForm).TypeTable = TypeTable;
                //childFormNumber++;

                childForm.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);
        }