Ejemplo n.º 1
0
        public void cargarDatosColeyTallerA()
        {
            DtoTallerAperturado tallape   = new DtoTallerAperturado();
            CtrTallerAperturado ctrTallap = new CtrTallerAperturado();

            tallape.codTallerAperturado = int.Parse(Session["t"].ToString());

            ctrTallap.consultarTallerAperturado3(tallape);

            txtNombTallerAperturado.Text = ctrTallap.consultarTallerAperturado2(tallape);
            //-------------------
            DtoColegio cole   = new DtoColegio();
            CtrColegio ctrcol = new CtrColegio();

            cole.codColegio = int.Parse(Session["r"].ToString());

            ctrcol.consultarColegio(cole);

            txtCole.Text      = cole.nombre;
            lblLat2.Text      = cole.latitud.ToString();
            lblLng2.Text      = cole.longitud.ToString();
            idTallerAper.Text = tallape.codTallerAperturado.ToString();
            lbldia.Text       = tallape.dia;
            lblalerta.Text    = tallape.codProfesor.ToString();

            caracteristicasGmap(cole.latitud.ToString(), cole.longitud.ToString());
        }
Ejemplo n.º 2
0
        public bool getTallerAperturado3(DtoTallerAperturado trab)
        {
            SqlCommand cmd = new SqlCommand("sp_getTallerAperturado", conexion);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@codTallerAperturado", trab.codTallerAperturado);

            conexion.Open();
            bool hayRegistros;

            SqlDataReader reader = cmd.ExecuteReader();

            hayRegistros = reader.Read();

            if (hayRegistros)
            {
                trab.dia         = reader[1].ToString();
                trab.horaInicio  = Convert.ToDateTime(reader[2].ToString());
                trab.Fin         = Convert.ToDateTime(reader[3].ToString());
                trab.estado      = reader[4].ToString();
                trab.codVenta    = int.Parse(reader[5].ToString());
                trab.codTaller   = int.Parse(reader[6].ToString());
                trab.codProfesor = int.Parse(reader[7].ToString());
            }

            conexion.Close();
            return(hayRegistros);
        }
 protected void gv_talleresaperturados_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Inscribirse")
     {
         DtoTallerAperturado daot = new DtoTallerAperturado();
         CtrTallerAperturado obj  = new CtrTallerAperturado();
         int         index        = Convert.ToInt32(e.CommandArgument);
         GridViewRow selectedRow  = gv_talleresaperturados.Rows[index];
         TableCell   t            = selectedRow.Cells[0];
         TableCell   tall         = selectedRow.Cells[1];
         try
         {
             daot.codPersona          = int.Parse(prueba.Text);
             daot.codTallerAperturado = int.Parse(t.Text);
             obj.registrarAlumnoxTA(daot);
             selectedRow.Enabled = false;
             //mensajito :v
             lblmensaje.Text      = "INSCRIPCIÓN EXITOSA";
             lblmensaje.ForeColor = Color.Blue;
         }
         catch
         {
             lblmensaje.Text      = "Ya estas inscrito en el taller [" + tall.Text + "] , sorry :c";
             lblmensaje.ForeColor = Color.Red;
         }
     }
 }
Ejemplo n.º 4
0
        public void insertAlumnoXtallerAperturado(DtoTallerAperturado prof)
        {
            SqlCommand cmd = new SqlCommand("insertAlumnoXtallerAperturado", conexion);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@codPersona", prof.codPersona);
            cmd.Parameters.AddWithValue("@codTallerAperturado", prof.codTallerAperturado);
            conexion.Open();
            cmd.ExecuteNonQuery();
            conexion.Close();
        }
Ejemplo n.º 5
0
        public String getTallerAperturado2(DtoTallerAperturado trab)
        {
            SqlCommand cmd = new SqlCommand("sp_getTallerxTallerAperturado", conexion);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@codTA", trab.codTallerAperturado);

            conexion.Open();
            bool hayRegistros;

            SqlDataReader reader = cmd.ExecuteReader();

            hayRegistros = reader.Read();

            if (hayRegistros)
            {
                return(reader[0].ToString());
            }

            conexion.Close();
            return("No existe :v");
        }
Ejemplo n.º 6
0
 public void registrarAlumnoxTA(DtoTallerAperturado prof)
 {
     daotallape.insertAlumnoXtallerAperturado(prof);
 }
Ejemplo n.º 7
0
 public bool consultarTallerAperturado3(DtoTallerAperturado prof)
 {
     return(daotallape.getTallerAperturado3(prof));
 }
Ejemplo n.º 8
0
 public string consultarTallerAperturado2(DtoTallerAperturado prof)
 {
     return(daotallape.getTallerAperturado2(prof));
 }