Esempio n. 1
0
        private void btnCerrar_Click(object sender, EventArgs e)
        {
            PrincipalInspeccion fInspeccion = new PrincipalInspeccion();

            this.Close();
            fInspeccion.Show();
        }
Esempio n. 2
0
        private void Ingresar()
        {
            
            if (txtUsuario.Text == "")
            {
                MessageBox.Show("Debe de registrar su código de usuario ", "AVISO!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                txtUsuario.Focus();
            }
            else
            {
                Global.Usuario = txtUsuario.Text.Trim();

                try
                {
                    DataRow drLogIn = Global.LogIn(Global.Usuario);

                    string error = drLogIn[0].ToString();
                    string mensaje = drLogIn[1].ToString();
                    
                    if ((error == "0") || (error == "2"))
                    {
                        
                        switch (Global.Aplicacion)
                        {
                            case "RECEPCION":
                                PrincipalRecepcion fRecepcion = new PrincipalRecepcion();
                                fRecepcion.Show();
                                this.Hide();
                                break;
                            case "INSPECCION":
                                PrincipalInspeccion fInspeccion = new PrincipalInspeccion();
                                fInspeccion.Show();
                                this.Hide();
                                break;
                            case "DISPONIBLE":
                                PrincipalDisponible fDisponible = new PrincipalDisponible();
                                fDisponible.Show();
                                this.Hide();
                                break;
                            case "ABASTO PKG":
                                PrincipalAbastoPkg fAbastoPkg = new PrincipalAbastoPkg();
                                fAbastoPkg.Show();
                                this.Hide();
                                break;
                            case "CONTEOS":
                                PrincipalConteos fConteo = new PrincipalConteos();
                                fConteo.Show();
                                this.Hide();
                                break;
                            case "RECEPCION_PLANTA":
                                PrincipalRecepcionPlanta fRcpPlanta = new PrincipalRecepcionPlanta();
                                fRcpPlanta.Show();
                                this.Hide();
                                break;
                            case "DISPONIBLE_PLANTA":
                                PrincipalDisponiblePlanta fDisponiblePlanta = new PrincipalDisponiblePlanta();
                                fDisponiblePlanta.Show();
                                this.Hide();
                                break;
                            default:
                                break;
                        }
                         
                    }
                    else
                    {
                        MessageBox.Show(mensaje, "AVISO!!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                        txtUsuario.Text = "";
                        txtUsuario.Focus();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

            }
        }