Example #1
0
        public BindingList <SolicitudColegio> listaSolicitudesColegios()
        {
            BindingList <SolicitudColegio> solicitudes = new BindingList <SolicitudColegio>();

            con = new MySqlConnection(DBManager.cadena);
            con.Open();
            comando             = new MySqlCommand();
            sql                 = "SELECT * FROM SolicitudColegio;";
            comando.CommandText = sql;
            comando.Connection  = con;
            MySqlDataReader lector = comando.ExecuteReader();

            while (lector.Read())
            {
                //Lectura de datos del cargo
                int    idSol = lector.GetInt32("IdSolicitudColegio");
                string nom   = lector.GetString("nombre");
                string telf  = lector.GetString("telefono");
                string obs   = lector.GetString("observacion");
                string pais  = lector.GetString("pais");
                string dep   = lector.GetString("departamento");
                string prov  = lector.GetString("provincia");
                //Creacion del cargo
                SolicitudColegio s = new SolicitudColegio(nom, telf, obs, pais, dep, prov);
                s.IdSolicitud = idSol;
                //Agregamos el cargo a la lista
                solicitudes.Add(s);
            }
            con.Close();
            return(solicitudes);
        }
Example #2
0
 private void btnEnviar_Click(object sender, EventArgs e)
 {
     try
     {
         long nRUC = long.Parse(txtRUC.Text);
         if (nRUC < 10000000000 || nRUC > 99999999999)
         {
             MessageBox.Show("El RUC debe ser de 11 dígitos");
             return;
         }
         if (!solicitudYaRegistrada(nRUC))
         {
             SolicitudColegio sol = new SolicitudColegio(nRUC, txtNombre.Text, txtTelefono.Text, txtObservacion.Text);
             solicitudes.Add(sol);
             MessageBox.Show("Solicitud enviada con éxito");
         }
         else
         {
             MessageBox.Show("No puede registrar el mismo RUC más de una vez cada 12 horas");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("El RUC ingresado no es valido");
     }
 }
Example #3
0
        private void btnEnviar_Click(object sender, EventArgs e)
        {
            if (txtNombre.Text == "")
            {
                MessageBox.Show("Debe ingresar el nombre del colegio", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (((cboDep.Text == "") || (txtPais.Text == "")))
            {
                MessageBox.Show("Debe ingresar un pais y un departamento", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            SolicitudColegio sol = new SolicitudColegio(txtNombre.Text, txtTelefono.Text, txtObservacion.Text, txtPais.Text, cboDep.Text, cbProvincia.Text);

            solicitudColegioDA.registrarSolicitudColegio(sol);
        }
Example #4
0
 public bool registrarSolicitudColegio(SolicitudColegio s)
 {
     try
     {
         con = new MySqlConnection(DBManager.cadena);
         con.Open();
         comando = new MySqlCommand();
         sql     = "INSERT INTO SolicitudColegio " +
                   "(nombre, telefono, observacion, pais, departamento, provincia) VALUES " +
                   "('" + s.Nombre + "', '" + s.Telefono + "', '" + s.Observacion + "', '" + s.Pais + "', '" + s.Departamento + "', '" + s.Provincia + "');";
         comando.CommandText = sql;
         comando.Connection  = con;
         comando.ExecuteNonQuery();
         con.Close();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #5
0
 public bool registrarSolicitudColegio(SolicitudColegio S)
 {
     return(solicitudColegioDA.registrarSolicitudColegio(S));
 }