示例#1
0
        // Validar rut.
        public void ValidarRut(MetroTextBox RutTextBox)
        {
            if (string.IsNullOrEmpty(RutTextBox.Text))
            {
                return;
            }
            string rut = RutTextBox.Text.Replace(".", "").ToUpper();

            string[] rutTemp = rut.Split('-');
            if (!verificaFormatoRut(RutTextBox.Text))
            {
                this.FalloValidacion = true;
                MsgBox.Show(this.myForm, StringResources.MensajeValidacion_RutIncorrecto, StringResources.TituloMensajes_Atencion, MessageBoxButtons.OK, MessageBoxIcon.Error);
                RutTextBox.Focus();
                return;
            }
            string verificadorTemp = this.obtenerDigitoVerificador(int.Parse(rutTemp[0].ToString()));

            if (rutTemp[1].ToString() != verificadorTemp)
            {
                this.FalloValidacion = true;
                MsgBox.Show(this.myForm, StringResources.MensajeValidacion_RutIncorrecto, StringResources.TituloMensajes_Atencion, MessageBoxButtons.OK, MessageBoxIcon.Error);
                RutTextBox.Focus();
                return;
            }
            this.FalloValidacion = false;
        }
示例#2
0
        /// <summary>
        /// Prüft eine MetroTextBox auf ein gültiges Datumstrennzeichen und setzt dieses (gibt TRUE bei korrektem Zeichen zurück)
        /// </summary>
        public bool Set_DatTrenn(IWin32Window owner, ref MetroTextBox textBox)
        {
            bool correct = false;

            if (textBox.Text.Length == 1)
            {
                char dattrenn = Convert.ToChar(textBox.Text);
                if (dattrenn == '.' || dattrenn == '-' || dattrenn == '/')
                {
                    Datumstrennzeichen = dattrenn;
                    correct            = true;
                }
                else
                {
                    MetroMessageBox.Show(owner, "Das eingegebene Datumstrennzeichen ist ungülig! Gülige Zeichen sind ausschießlich '.', '-' und '/' !", "Error bei Datumstrennzeichen", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    correct = false;
                    textBox.Focus();
                    textBox.SelectAll();
                }
            }
            else
            {
                if (textBox.Text.Length != 0)
                {
                    textBox.Text = textBox.Text.Substring(0, 1);
                    Set_DatTrenn(owner, ref textBox);
                }
            }
            return(correct);
        }
示例#3
0
        /// <summary>
        /// Prüft eine MetroTextBox auf ein gültiges Dezimalsymbol und setzt dieses (gibt TRUE bei korrektem Zeichen zurück)
        /// </summary>
        public bool Set_DezSym(IWin32Window owner, ref MetroTextBox textBox)
        {
            bool correct = false;

            if (textBox.Text.Length == 1)
            {
                char dezsym = Convert.ToChar(textBox.Text);
                if (dezsym == ',' || dezsym == '.')
                {
                    Dezimaltrennzeichen = dezsym;
                    correct             = true;
                }
                else
                {
                    MetroMessageBox.Show(owner, "Das eingegebene Dezimalsymbol ist ungülig! Gülige Zeichen sind ausschießlich ',' und '.' !", "Error bei Dezimalsymbol", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    correct = false;
                    textBox.Focus();
                    textBox.SelectAll();
                }
            }
            else
            {
                if (textBox.Text.Length != 0)
                {
                    textBox.Text = textBox.Text.Substring(0, 1);
                    Set_DezSym(owner, ref textBox);
                }
            }
            return(correct);
        }
        private void AddressListBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (this.SelectedIndices.Count != 1)
            {
                return;
            }

            ListViewItem item = this.Items[this.SelectedIndices[0]];

            ListViewItem.ListViewSubItem subitem = item.GetSubItemAt(e.X, e.Y);

            if (subitem == null)
            {
                return;
            }

            _textBox.Size = subitem.Bounds.Size;
            if (subitem.Bounds.Width == item.Bounds.Width)
            {
                for (int x = 1; x < item.SubItems.Count; x++)
                {
                    _textBox.Width -= item.SubItems[x].Bounds.Width;
                }
            }

            _textBox.Text      = subitem.Text;
            _textBox.Location  = subitem.Bounds.Location;
            _textBox.TextAlign = HorizontalAlignment.Center;
            _textBox.Font      = Fonts.UbuntuMono.UbuntuMonoRegular;
            _textBox.Visible   = true;
            _textBox.BringToFront();
            _textBox.Focus();
        }
示例#5
0
        //validation for if it is a non negative int32
        public static bool IsNonNegativeInt32(MetroTextBox txtBox, string name, Label lblError)
        {
            bool isValid = true;
            int  value;

            if (!Int32.TryParse(txtBox.Text, out value))
            {
                isValid       = false;
                lblError.Text = name + " must be a number. Type: Int32";
                txtBox.SelectAll();
                txtBox.Focus();
            }
            else if (value < 0) // negetive
            {
                isValid       = false;
                lblError.Text = name + " must be positive or zero";
                txtBox.SelectAll();
                txtBox.Focus();
            }
            return(isValid);
        }
示例#6
0
        //validation for if there is an input present
        public static bool IsPresent(MetroTextBox txtBox, string name, Label lblError)
        {
            bool isValid = true;

            if (txtBox.Text == "")
            {
                isValid       = false;
                lblError.Text = name + " needs to be filled out";
                txtBox.Focus();
            }
            return(isValid);
        }
 public void registrar()
 {
     if (!txtCodigoProducto.Text.Equals(""))
     {
         listLabel[0].Text      = "Código del producto";
         listLabel[0].ForeColor = Color.Black;
         if (numInventario.Value > 0)
         {
             listLabel[5].Text      = "Cantidad";
             listLabel[5].ForeColor = Color.Black;
             var producto = _Producto.Where(obj => obj.codigo.Equals(txtCodigoProducto.Text)).ToList();
             if (producto.Count.Equals(1))
             {
                 listLabel[0].Text      = "Código del producto";
                 listLabel[0].ForeColor = Color.Black;
                 guardarRegistro();
             }
             else
             {
                 listLabel[0].Text      = "Código del producto existente requerido";
                 listLabel[0].ForeColor = Color.Red;
                 txtCodigoProducto.Focus();
             }
         }
         else
         {
             listLabel[5].Text      = "Cantidad mayor a 0 requerida";
             listLabel[5].ForeColor = Color.Red;
             listLabel[5].Location  = new Point(75, 214);
             numInventario.Focus();
         }
     }
     else
     {
         listLabel[0].Text      = "Código del producto requerido";
         listLabel[0].ForeColor = Color.Red;
         txtCodigoProducto.Focus();
     }
 }
示例#8
0
        // Validar campo vacio.
        public void ValidarVacio(MetroTextBox myTextBox, string campo)
        {
            string texto = myTextBox.Text.Trim().ToString();

            if (string.IsNullOrEmpty(texto))
            {
                this.FalloValidacion = true;
                MsgBox.Show(this.myForm, string.Format(StringResources.MensajeValidacion_CampoVacio, campo), StringResources.TituloMensajes_Atencion, MessageBoxButtons.OK, MessageBoxIcon.Error);
                myTextBox.Focus();
                return;
            }
            this.FalloValidacion = false;
        }
示例#9
0
        // Validar la antiguedad
        public void ValidarAntiguedad(MetroTextBox myTextBox, int valorMinimo, int valorMaximo)
        {
            int codigo = int.Parse(myTextBox.Text);

            if (codigo < valorMinimo || codigo > valorMaximo)
            {
                this.FalloValidacion = true;
                MsgBox.Show(this.myForm, string.Format(StringResources.MensajeValidacion_AntiguedadInvalida, valorMinimo, valorMaximo), StringResources.TituloMensajes_Atencion, MessageBoxButtons.OK, MessageBoxIcon.Error);
                myTextBox.Focus();
                return;
            }
            this.FalloValidacion = false;
        }
示例#10
0
        // Validar el codigo postal.
        public void ValidarCodigoPostal(MetroTextBox myTextBox)
        {
            int codigo = int.Parse(myTextBox.Text);

            if (codigo < 1000000 || codigo > 9999999)
            {
                this.FalloValidacion = true;
                MsgBox.Show(this.myForm, StringResources.MensajeValidacion_CodigoPostalInvalido, StringResources.TituloMensajes_Atencion, MessageBoxButtons.OK, MessageBoxIcon.Error);
                myTextBox.Focus();
                return;
            }
            this.FalloValidacion = false;
        }
示例#11
0
        //validation for if input is a decimal
        public static bool IsADecimal(MetroTextBox txtBox, string name, Label lblError)
        {
            bool    isValid = true;
            decimal dec;

            if (!Decimal.TryParse(txtBox.Text, out dec))
            {
                isValid       = false;
                lblError.Text = name + " must be a number. Type: Decimal";
                txtBox.SelectAll();
                txtBox.Focus();
            }
            return(isValid);
        }
示例#12
0
 private bool CheckStringTextBox(MetroTextBox stringTextBox)
 {
     if (stringTextBox.Text.Length < 2)
     {
         stringTextBox.Focus();
         stringTextBox.WithError = true;
         return(false);
     }
     else
     {
         stringTextBox.WithError = false;
     }
     return(true);
 }
示例#13
0
        // Validar valor base del seguro.
        public void ValidarValorSeguro(MetroTextBox textoValorBase)
        {
            double valor = 0;

            try
            {
                valor = double.Parse(textoValorBase.Text.ToString().Trim());
                if (valor <= 0)
                {
                    this.FalloValidacion = true;
                    MsgBox.Show(this.myForm, StringResources.MensajeValidacion_ValorBaseMenorQueCero, StringResources.TituloMensajes_Atencion, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    textoValorBase.Focus();
                    return;
                }
                this.FalloValidacion = false;
            }
            catch
            {
                this.FalloValidacion = true;
                MsgBox.Show(this.myForm, StringResources.MensajeValidacion_SoloNumeros, StringResources.TituloMensajes_Atencion, MessageBoxButtons.OK, MessageBoxIcon.Error);
                textoValorBase.Focus();
            }
        }
示例#14
0
        private bool TestNumeric(MetroTextBox numericTextBox)
        {
            double temp;

            if (!double.TryParse(numericTextBox.Text, out temp))
            {
                numericTextBox.Focus();
                numericTextBox.WithError = true;
                return(false);
            }
            else
            {
                numericTextBox.WithError = false;
                return(true);
            }
        }
示例#15
0
        // Validar la patente del vehiculo.
        public void ValidarPatente(MetroTextBox myTextBox)
        {
            string texto      = myTextBox.Text.Trim().ToString();
            Regex  expresion1 = new Regex(@"^[A-Z]{2}[0-9]{4}$");
            Regex  expresion2 = new Regex(@"^[A-Z]{3}[0-9]{3}$");
            Regex  expresion3 = new Regex(@"^[A-Z]{4}[0-9]{2}$");

            if (!expresion1.IsMatch(texto) && !expresion2.IsMatch(texto) && !expresion3.IsMatch(texto))
            {
                this.FalloValidacion = true;
                MsgBox.Show(this.myForm, StringResources.MensajeValidacion_FormatoPatenteInvalida, StringResources.TituloMensajes_Atencion, MessageBoxButtons.OK, MessageBoxIcon.Error);
                myTextBox.Focus();
                return;
            }
            this.FalloValidacion = false;
        }
示例#16
0
        //validation for if it is a non negative decimal
        public static bool NotNegativeDeciaml(MetroTextBox txtBox, string name, Label lblError)
        {
            bool    isValid = true;
            decimal value;
            decimal notNegative;

            notNegative = Convert.ToDecimal(txtBox.Text);

            if (!Decimal.TryParse(txtBox.Text, out value))
            {
                isValid = false;
                IsADecimal(txtBox, name, lblError);
            }
            else if (notNegative < 0) // if negative
            {
                isValid       = false;
                lblError.Text = name + " must be positive or zero";
                txtBox.SelectAll();
                txtBox.Focus();
            }
            return(isValid);
        }
示例#17
0
        private void TextBoxInput_Leave(object sender, EventArgs e)
        {
            MetroTextBox txt = (MetroTextBox)sender;

            if (!string.IsNullOrEmpty(txt.Text))
            {
                if (Convert.ToDecimal(txt.Text) <= 0)
                {
                    Form frm = txt.FindForm();
                    MessageBox.Show("จำนวนต้องไม่ว่าง และ มากกว่า 0", "จำนวนตัวเลข", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txt.Text = "1";
                    txt.Focus();
                }
                else
                {
                    //MessageBox.Show("จำนวนสินค้าต้องมากกว่า 0", "จำนวนสินค้า", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                MessageBox.Show("จำนวนต้องไม่ว่าง", "จำนวนตัวเลข", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
示例#18
0
        private void CalcularDescuentoRecargo(InputCalculo input)
        {
            decimal mto = 0, impuesto = 0;

            if (txtSubtotal.Text.Trim() != "" && decimal.TryParse(txtSubtotal.Text.Trim(), out decimal subtotal))
            {
                mto = subtotal;
                if (txtImpuesto.Text.Trim() != "" && decimal.TryParse(txtImpuesto.Text.Trim(), out impuesto))
                {
                    mto += impuesto;
                }

                #region Definiendo los txt's y el caso

                bool         isPorcentaje = false;
                string       estampa = "";
                MetroTextBox txtPorc = new MetroTextBox(), txtMto = new MetroTextBox();
                try
                {
                    switch (input)
                    {
                    case InputCalculo.PorcDescuento:
                    {
                        txtPorc      = txtPorcDescuento;
                        txtMto       = txtDescuento;
                        isPorcentaje = true;
                        estampa      = "descuento";
                    }
                    break;

                    case InputCalculo.PorcRecargo:
                    {
                        txtPorc      = txtPorcRecargo;
                        txtMto       = txtRecargo;
                        isPorcentaje = true;
                        estampa      = "recargo";
                    }
                    break;

                    case InputCalculo.MtoDescuento:
                    {
                        txtPorc = txtPorcDescuento;
                        txtMto  = txtDescuento;
                        estampa = "descuento";
                    }
                    break;

                    case InputCalculo.MtoRecargo:
                    {
                        txtPorc = txtPorcRecargo;
                        txtMto  = txtRecargo;
                        estampa = "recargo";
                    }
                    break;
                    }
                    #endregion

                    //CÁLCULO POR PORCENTAJE
                    if (isPorcentaje)
                    {
                        decimal porc = 0;
                        if (txtPorc.Text.Trim() == "")
                        {
                            txtMto.Clear();
                        }
                        else if (decimal.TryParse(txtPorc.Text.Trim(), out porc))
                        {
                            if (porc < 0)
                            {
                                MessageBox.Show($"Ingrese un valor positivo al porcentaje del {estampa}.", "Mensaje Eagle", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                txtMto.Clear();
                                txtPorc.SelectAll();
                            }
                            else
                            {
                                decimal mtoCalculado = 0;
                                mtoCalculado = mto * (porc / 100.0m);
                                if (input == InputCalculo.PorcDescuento && mtoCalculado >= mto)
                                {
                                    MessageBox.Show($"El descuento ({mtoCalculado}) no puede ser mayor o igual al monto del subtotal más el impuesto ({mto}).", "Mensaje Eagle", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                    txtMto.Clear();
                                    txtPorc.SelectAll();
                                }
                                else
                                {
                                    txtMto.Text = mtoCalculado.RoundOut(numDec);
                                    CalcularMontos();
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show($"Ingrese un valor numérico en el porcentaje del {estampa}.", "Mensaje Eagle", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            txtMto.Clear();
                            txtPorc.SelectAll();
                        }
                    }
                    else//CÁLCULO POR MONTO
                    {
                        decimal mtoPropuesto = 0;
                        if (txtMto.Text.Trim() == "")
                        {
                            txtPorc.Clear();
                        }
                        else if ((decimal.TryParse(txtMto.Text.Trim(), out mtoPropuesto)))
                        {
                            if (mtoPropuesto < 0)
                            {
                                MessageBox.Show($"Ingrese un valor positivo al monto del {estampa}.", "Mensaje Eagle", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                txtPorc.Clear();
                                txtMto.SelectAll();
                            }
                            else
                            {
                                decimal porcCalculado = (mtoPropuesto / mto) * 100.0m;
                                if (input == InputCalculo.MtoDescuento && mtoPropuesto >= mto)
                                {
                                    MessageBox.Show($"El descuento ({mtoPropuesto}) no puede ser mayor o igual al monto del subtotal más el impuesto ({mto}).", "Mensaje Eagle", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                    txtPorc.Clear();
                                    txtMto.Clear();
                                    txtMto.Focus();
                                }
                                else
                                {
                                    txtPorc.Text = porcCalculado.RoundOut(numDec);
                                    CalcularMontos();
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show($"Ingrese un valor numérico en el monto del {estampa}.", "Mensaje Eagle", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            txtPorc.Clear();
                            txtMto.SelectAll();
                        }
                    }
                }
                catch (Exception e)
                {
                    if (isPorcentaje)
                    {
                        txtMto.Clear();
                    }
                    else
                    {
                        txtPorc.Clear();
                    }
                    MessageBox.Show($"No se pudo calcular el {estampa}. Excepción: " + e.Message, "Mensaje Eagle", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
示例#19
0
 private void JumpToTheEndOfTextBox(MetroTextBox textBox)
 {
     textBox.Focus();
     textBox.Select(textBox.Text.Length, 0);
 }
示例#20
0
        private void BtnNuovaSessione_Click(object sender, EventArgs e)
        {
            #region FormSessione

            formSessione     = new MetroForm();
            txtNomeSessione  = new MetroTextBox();
            btnCrea          = new MetroButton();
            btnAnnulla       = new MetroButton();
            radioStandard    = new MetroRadioButton();
            radioCustom      = new MetroRadioButton();
            checkPubblicaDB  = new MetroCheckBox();
            lstBoxSessioni   = new ListBox();
            lstvBoxSessioni  = new ListView();
            txtCercaSessione = new MetroTextBox();
            lblCercaSessione = new MetroLabel();
            txtCercaUtente   = new MetroTextBox();
            lblCercaUtente   = new MetroLabel();
            txtCercaPubblica = new MetroTextBox();
            lblCercaPubblica = new MetroLabel();
            lblEmail         = new MetroLabel();
            txtEmail         = new TextBox();
            txtCercaMail     = new MetroTextBox();
            lblCercaMail     = new MetroLabel();

            checkPubblicaDB.CheckedChanged += CheckPubblicaDB_CheckedChanged;

            formSessione.StartPosition = FormStartPosition.CenterScreen;

            formSessione.Size        = new Size(500, 400);
            formSessione.MaximizeBox = false;

            formSessione.MinimizeBox = false;
            formSessione.Resizable   = false;

            formSessione.Text      = "Nuova Sessione";
            radioStandard.Text     = "Sessione Standard";
            radioCustom.Text       = "Sessione da Database";
            radioStandard.AutoSize = true;
            radioCustom.AutoSize   = true;
            radioStandard.Checked  = true;

            radioCustom.Top    = 70;
            radioStandard.Top  = 70;
            radioCustom.Left   = 270;
            radioStandard.Left = 90;

            radioStandard.CheckedChanged += RadioStandard_CheckedChanged;
            radioCustom.CheckedChanged   += RadioCustom_CheckedChanged;

            formSessione.Controls.Add(radioStandard);
            formSessione.Controls.Add(radioCustom);
            formSessione.Controls.Add(txtNomeSessione);
            formSessione.Controls.Add(btnCrea);
            formSessione.Controls.Add(btnAnnulla);
            formSessione.Controls.Add(checkPubblicaDB);
            formSessione.Controls.Add(lstvBoxSessioni);
            formSessione.Controls.Add(txtCercaSessione);
            formSessione.Controls.Add(lblCercaSessione);
            formSessione.Controls.Add(txtCercaUtente);
            formSessione.Controls.Add(lblCercaUtente);
            formSessione.Controls.Add(txtCercaPubblica);
            formSessione.Controls.Add(lblCercaPubblica);
            formSessione.Controls.Add(lblEmail);
            formSessione.Controls.Add(txtEmail);
            formSessione.Controls.Add(lblCercaMail);
            formSessione.Controls.Add(txtCercaMail);

            txtNomeSessione.Focus();
            txtNomeSessione.Size = new Size(200, txtNomeSessione.Height);
            txtNomeSessione.Top  = 150;
            txtNomeSessione.Left = 150;
            txtNomeSessione.Text = "Inserire nome sessione";

            lstvBoxSessioni.Visible    = false;
            lstvBoxSessioni.Scrollable = true;
            lstvBoxSessioni.Alignment  = ListViewAlignment.Left;

            ColumnHeader colHead = new ColumnHeader();

            colHead       = new ColumnHeader();
            colHead.Text  = "Nome Sessione";
            colHead.Width = -2;
            lstvBoxSessioni.Columns.Add(colHead);

            colHead       = new ColumnHeader();
            colHead.Text  = "Utente";
            colHead.Width = 60;
            lstvBoxSessioni.Columns.Add(colHead);

            colHead       = new ColumnHeader();
            colHead.Text  = "Chiave Pubblica (E, N)";
            colHead.Width = 120;
            lstvBoxSessioni.Columns.Add(colHead);

            colHead       = new ColumnHeader();
            colHead.Text  = "e-mail";
            colHead.Width = 120;

            lstvBoxSessioni.Columns.Add(colHead);
            lstvBoxSessioni.FullRowSelect = true;

            for (int i = 0; i < sProvider.GetEntityList().Count; i++)
            {
                ListViewItem lstItem = new ListViewItem(sProvider.GetEntityList()[i].NomeSessione);
                lstItem.SubItems.Add(sProvider.GetEntityList()[i].Utente);
                string keyPubb = sProvider.GetEntityList()[i].EString + "," + sProvider.GetEntityList()[i].NString;
                lstItem.SubItems.Add(keyPubb);
                lstItem.SubItems.Add(sProvider.GetEntityList()[i].Email);

                lstvBoxSessioni.Items.Add(lstItem);
            }

            lblCercaSessione.Visible = false;
            txtCercaSessione.Visible = false;
            lblCercaUtente.Visible   = false;
            txtCercaUtente.Visible   = false;
            lblCercaPubblica.Visible = false;
            txtCercaPubblica.Visible = false;
            lblCercaMail.Visible     = false;
            txtCercaMail.Visible     = false;

            lstvBoxSessioni.Size = new Size(285, 240);
            lstvBoxSessioni.Top  = 100;
            lstvBoxSessioni.Left = 20;
            lstvBoxSessioni.View = View.Details;

            lblCercaSessione.Text     = "Ricerca Nome Sessione";
            lblCercaSessione.Top      = 115;
            lblCercaSessione.Left     = 316;
            lblCercaSessione.AutoSize = true;

            txtCercaSessione.Text         = "Cerca...";
            txtCercaSessione.Top          = 135;
            txtCercaSessione.Left         = 320;
            txtCercaSessione.Width        = 130;
            txtCercaSessione.TextChanged += CercaSessione_TextChanged;

            lblCercaUtente.Text     = "Ricerca Utente";
            lblCercaUtente.Top      = 165;
            lblCercaUtente.Left     = 316;
            lblCercaUtente.AutoSize = true;

            txtCercaUtente.Text         = "Cerca...";
            txtCercaUtente.Top          = 185;
            txtCercaUtente.Left         = 320;
            txtCercaUtente.Width        = 130;
            txtCercaUtente.TextChanged += TxtCercaUtente_TextChanged;

            lblCercaPubblica.Text     = "Ricerca Chiave N";
            lblCercaPubblica.Top      = 215;
            lblCercaPubblica.Left     = 316;
            lblCercaPubblica.AutoSize = true;

            txtCercaPubblica.Text         = "Cerca...";
            txtCercaPubblica.Top          = 235;
            txtCercaPubblica.Left         = 320;
            txtCercaPubblica.Width        = 130;
            txtCercaPubblica.TextChanged += TxtCercaPubblica_TextChanged;

            lblCercaMail.Text     = "Ricerca e-mail";
            lblCercaMail.Top      = 265;
            lblCercaMail.Left     = 316;
            lblCercaMail.AutoSize = true;

            txtCercaMail.Text         = "Cerca...";
            txtCercaMail.Top          = 285;
            txtCercaMail.Left         = 320;
            txtCercaMail.Width        = 130;
            txtCercaMail.TextChanged += TxtCercaMail_TextChanged;

            checkPubblicaDB.Checked  = false;
            checkPubblicaDB.Top      = 180;
            checkPubblicaDB.Left     = 150;
            checkPubblicaDB.Text     = "Pubblica nel Database";
            checkPubblicaDB.AutoSize = true;

            lblEmail.Visible  = false;
            lblEmail.AutoSize = true;
            lblEmail.Text     = "e-mail:";
            txtEmail.Visible  = false;
            lblEmail.Top      = 230;
            lblEmail.Left     = 80;
            txtEmail.Top      = 230;
            txtEmail.Left     = 130;
            txtEmail.Width    = 250;
            txtEmail.Text     = "*****@*****.**";

            btnCrea.Top     = 360;
            btnCrea.Left    = 90;
            btnAnnulla.Top  = 360;
            btnAnnulla.Left = 330;
            btnCrea.Text    = "Crea";
            btnAnnulla.Text = "Annulla";

            formSessione.Show();

            if (checkDBConnection.Text == "Connessione al Database: Assente")
            {
                radioCustom.Enabled     = false;
                checkPubblicaDB.Checked = false;
                checkPubblicaDB.Enabled = false;


                MessageBox.Show("La connessione al database è assente o è stata persa. Controllare lo stato della propria rete.",
                                "Connessione al database fallita", MessageBoxButtons.OK, MessageBoxIcon.Warning);


                connessioneDB          = "Assente";
                checkDBConnection.Text = String.Format("Connessione al Database: " + connessioneDB);
            }
            else if (checkDBConnection.Text == "Connessione al Database: Connesso")
            {
                if (sProvider.TryConnection() == "Assente")
                {
                    MessageBox.Show("La connessione al database è assente o è stata persa. Controllare lo stato della propria rete.",
                                    "Connessione al database fallita", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    checkDBConnection.Text = String.Format("Connessione al Database: " + "Assente");
                    reConnect.Enabled      = true;
                }

                else
                {
                    radioCustom.Enabled     = true;
                    checkPubblicaDB.Checked = false;
                    checkPubblicaDB.Enabled = true;
                }
            }

            btnCrea.Click    += _crea_Click;
            btnAnnulla.Click += _annulla_Click;

            #endregion
        }