Example #1
0
        //Consultar Asistencia para Modificar
        public ClassResultV Consultar_Jugadores_Asistencia(string codigo)
        {
            ClassResultV cr = new ClassResultV();

            try
            {
                SqlParameter[] parameters = new SqlParameter[]
                {
                    new SqlParameter("@codHorario", codigo)
                };
                SqlDataReader reader = SqlHelper.ExecuteReader(objCn, CommandType.StoredProcedure, "sp_Consultar_Jugadores_Asistencia", parameters);
                cr.List = new List <DtoB>();
                while (reader.Read())
                {
                    DtoAsistencia dtoP = new DtoAsistencia();
                    dtoP.codJugador = getValue("codJugador", reader).Value_String;
                    dtoP.nombresyap = getValue("nombresyap", reader).Value_String;
                    dtoP.asistencia = getValue("asistencia", reader).Value_String;
                    cr.List.Add(dtoP);
                }
            }
            catch (Exception ex)
            {
                cr.DT         = null;
                cr.LugarError = ex.StackTrace;
                cr.ErrorEx    = ex.Message;
                cr.ErrorMsj   = "Error al consultar Asistencia";
            }
            objCn.Close();
            return(cr);
        }
        public static string GetCurrentTime(string dni, string estado)
        {
            DtoAsistencia objdtoAsis = new DtoAsistencia();
            CtrAsistencia objctrasis = new CtrAsistencia();
            Log           _log       = new Log();

            objdtoAsis.VA_EstadoAsistencia = estado;
            objdtoAsis.DTA_Fecha           = DateTime.Now;
            objdtoAsis.FK_VU_Dni           = dni;
            _log.CustomWriteOnLog("registrar asistencia", "dni:" + dni + ", estado es :" + estado + ", la fecha de hoy es:" + DateTime.Now);
            try
            {
                //Session["dni"] = dni;
                //_log.CustomWriteOnLog("registrar asistencia", "El valor de la sesion dni:"+ Session["dni"] as string);
                objctrasis.RegistrarAsistencia(objdtoAsis);
                _log.CustomWriteOnLog("registrar asistencia", "todo bien");
            }
            catch (Exception e)
            {
                _log.CustomWriteOnLog("registrar asistencia", "todo mal" + e.Message);
            }



            return("Hello " + dni + "1" + Environment.NewLine + "The Current Time is: "
                   + DateTime.Now.ToString());
        }
Example #3
0
        //Modificar
        public DtoAsistencia Modificar_Asistencia(DtoAsistencia dtoBase)
        {
            var cr  = new ClassResultV();
            var dto = (DtoAsistencia)dtoBase;
            var pr  = new SqlParameter[3];

            try
            {
                pr[0]       = new SqlParameter("@codJugador", SqlDbType.VarChar, 50);
                pr[0].Value = dto.codJugador;
                pr[1]       = new SqlParameter("@codHorarioEntrenamiento", SqlDbType.Int);
                pr[1].Value = dto.codHorarioEntrenamiento;
                pr[2]       = new SqlParameter("@asistencia", SqlDbType.Char, 1);
                pr[2].Value = dto.asistencia;

                SqlDataReader reader = SqlHelper.ExecuteReader(objCn, CommandType.StoredProcedure, "sp_Modificar_Asistencia", pr);
            }
            catch (Exception ex)
            {
                cr.LugarError = ex.StackTrace;
                cr.ErrorEx    = ex.Message;
                cr.ErrorMsj   = "Error al registrar persona";
            }
            objCn.Close();
            return(dto);
        }
        private void Consultar_Asistencia()
        {
            try
            {
                _AsistJug.Clear();
                DtoAsistencia dto = new DtoAsistencia();
                ClassResultV  cr  = new CTR.CtrAsistencia().Consultar_Jugadores_Asistencia(LabelCodigoHorario.Text);
                if (!cr.HuboError)
                {
                    foreach (DtoB dtoB in cr.List)
                    {
                        _AsistJug.Add((DtoAsistencia)dtoB);
                    }
                    GridView1.DataSource = _AsistJug;
                    GridView1.DataBind();

                    foreach (GridViewRow item in GridView1.Rows)
                    {
                        CheckBox rd1 = (item.Cells[3].FindControl("RadioButton1") as CheckBox);
                        CheckBox rd2 = (item.Cells[4].FindControl("RadioButton2") as CheckBox);
                        CheckBox rd3 = (item.Cells[5].FindControl("RadioButton3") as CheckBox);
                        CheckBox rd4 = (item.Cells[6].FindControl("RadioButton4") as CheckBox);
                        if (item.Cells[2].Text == "P")
                        {
                            rd1.Checked = true;
                        }
                        if (item.Cells[2].Text == "T")
                        {
                            rd2.Checked = true;
                        }
                        if (item.Cells[2].Text == "F")
                        {
                            rd3.Checked = true;
                        }
                        if (item.Cells[2].Text == "J")
                        {
                            rd4.Checked = true;
                        }
                    }
                }
                else
                {
                    GridView1.DataBind();
                }
            }
            catch { }
        }
Example #5
0
        public void RegistrarAsistencia(DtoAsistencia objdtoAsis)
        {
            try
            {
                SqlCommand command = new SqlCommand("SP_RegistrarAsistencia", conexion);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@estado", objdtoAsis.VA_EstadoAsistencia);
                command.Parameters.AddWithValue("@fecha", objdtoAsis.DTA_Fecha);
                command.Parameters.AddWithValue("@dni", objdtoAsis.FK_VU_Dni);

                conexion.Open();
                command.ExecuteNonQuery();
                conexion.Close();
            }
            catch (Exception)
            {
                throw;
            }
        }
        protected void BotonModificarAsistencia_Click(object sender, EventArgs e)
        {
            try
            {
                DtoAsistencia dt = new DtoAsistencia();
                foreach (GridViewRow item in GridView1.Rows)
                {
                    dt.codJugador = item.Cells[0].Text;
                    dt.codHorarioEntrenamiento = Convert.ToInt32(LabelCodigoHorario.Text);
                    CheckBox rd1 = (item.Cells[3].FindControl("RadioButton1") as CheckBox);
                    CheckBox rd2 = (item.Cells[4].FindControl("RadioButton2") as CheckBox);
                    CheckBox rd3 = (item.Cells[5].FindControl("RadioButton3") as CheckBox);
                    CheckBox rd4 = (item.Cells[6].FindControl("RadioButton4") as CheckBox);
                    if (rd1.Checked)
                    {
                        dt.asistencia = "P";
                    }
                    else if (rd2.Checked)
                    {
                        dt.asistencia = "T";
                    }
                    else if (rd3.Checked)
                    {
                        dt.asistencia = "F";
                    }
                    else if (rd4.Checked)
                    {
                        dt.asistencia = "J";
                    }

                    ClassResultV cr1 = new CTR.CtrAsistencia().Modificar_Asistencia(dt);
                }
                Limpiar();
            }
            catch (Exception ex) { }
        }
Example #7
0
 public DtoAsistencia Modificar_Asistencia(DtoAsistencia dto)
 {
     return(new DaoAsistencia().Modificar_Asistencia(dto));
 }
Example #8
0
 public DtoAsistencia Insertar_Asistencia(DtoAsistencia dto)
 {
     return(new DaoAsistencia().Insertar_Asistencia(dto));
 }
Example #9
0
 public void RegistrarAsistencia(DtoAsistencia objAsis)
 {
     objDaoAsistencia.RegistrarAsistencia(objAsis);
 }