Exemple #1
0
        public JsonResult GenerarReporte(Reporte_EL R)
        {
            string postdata = JsonConvert.SerializeObject(R);

            var Lis = JsonConvert.DeserializeObject <List <Reporte_EL> >(Utilitario.Accion.Conect_WEBAPI("Reporte/ListarReporte", "POST", postdata));

            return(Json(new { listrm = Lis, }, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public List <Reporte_EL> GetReporteGeneral(Reporte_EL r)
        {
            using (SqlConnection con = new SqlConnection(ConexionUtil.Cadena))
            {
                con.Open();
                using (SqlCommand com = new SqlCommand("ReporteGeneral", con))
                {
                    com.CommandType = CommandType.StoredProcedure;
                    com.Parameters.AddWithValue("@fechainicial", SqlDbType.Date).Value = r.fechainicial;
                    com.Parameters.AddWithValue("@fechafinal", SqlDbType.Date).Value   = r.fechafinal;

                    List <Reporte_EL> list = new List <Reporte_EL>();
                    using (IDataReader dataReader = com.ExecuteReader())
                    {
                        while (dataReader.Read())
                        {
                            Reporte_EL obj = new Reporte_EL();

                            if (dataReader["indice"] != DBNull.Value)
                            {
                                obj.indice = (decimal)dataReader["indice"];
                            }
                            if (dataReader["estado"] != DBNull.Value)
                            {
                                obj.estado = Convert.ToInt16(dataReader["estado"]);
                            }
                            if (dataReader["descripcion"] != DBNull.Value)
                            {
                                obj.descripcion = (string)dataReader["descripcion"];
                            }
                            if (dataReader["fecha"] != DBNull.Value)
                            {
                                obj.fecha = (DateTime)dataReader["fecha"];
                            }
                            list.Add(obj);
                        }
                    }
                    return(list);
                }
            }
        }
Exemple #3
0
 public IEnumerable <Reporte_EL> ListarReporte(Reporte_EL value)
 {
     return(Reporte_DA.Accion.GetReporteGeneral(value));
 }