Example #1
0
        public List <VentaVO> GetVentaList(BaseGridVO filtro)
        {
            List <VentaVO>  lista = new List <VentaVO>();
            MySqlDataReader dr    = null;

            try
            {
                string       query   = "sp_Ventas_select_lista";
                MySqlCommand comando = this.Conexion.CreateCommand();
                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = query;
                comando.Parameters.Add("p_campobusqueda", MySqlDbType.VarChar).Value = filtro.campobusqueda ?? string.Empty;
                comando.Parameters.Add("p_valorbusqueda", MySqlDbType.VarChar).Value = filtro.valorbusqueda ?? string.Empty;
                comando.Parameters.Add("p_numeropagina", MySqlDbType.Int32).Value    = filtro.pagina;
                comando.Parameters.Add("p_porpagina", MySqlDbType.Int32).Value       = filtro.porpagina;
                comando.Parameters.Add("p_orderby", MySqlDbType.VarChar).Value       = filtro.orderby;
                comando.Parameters.Add("p_ordertype", MySqlDbType.VarChar).Value     = filtro.ordertype;
                // Se toma el valor devuelto
                dr = comando.ExecuteReader();

                if (dr.HasRows)
                {
                    VentaVO vo;
                    while (dr.Read())
                    {
                        vo = new VentaVO();

                        vo.Clave = dr.GetInt32(dr.GetOrdinal("Clave"));

                        vo.Cliente       = dr.GetInt32(dr.GetOrdinal("Cliente"));
                        vo.ClienteNombre = dr["ClienteNombre"].ToString();
                        vo.Folio         = dr["Folio"].ToString();
                        vo.TotalT        = dr.GetDecimal(dr.GetOrdinal("TotalT"));
                        var Fecha = Convert.ToDateTime(dr["Fecha"]);
                        vo.Fecha = Fecha.ToString("yyyy-MM-dd");
                        //vo.RFC = dr["RFC"].ToString();
                        vo.total = Convert.ToInt32(dr["total"]);
                        lista.Add(vo);
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            finally
            {
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }

                dr = null;
            }

            return(lista);
        }
Example #2
0
        public List <ArticuloVO> GetArticuloList(BaseGridVO filtro)
        {
            List <ArticuloVO> lista = new List <ArticuloVO>();
            MySqlDataReader   dr    = null;

            try
            {
                string       query   = "sp_Articulos_select_lista";
                MySqlCommand comando = this.Conexion.CreateCommand();
                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = query;
                comando.Parameters.Add("p_campobusqueda", MySqlDbType.VarChar).Value = filtro.campobusqueda ?? string.Empty;
                comando.Parameters.Add("p_valorbusqueda", MySqlDbType.VarChar).Value = filtro.valorbusqueda ?? string.Empty;
                comando.Parameters.Add("p_numeropagina", MySqlDbType.Int32).Value    = filtro.pagina;
                comando.Parameters.Add("p_porpagina", MySqlDbType.Int32).Value       = filtro.porpagina;
                comando.Parameters.Add("p_orderby", MySqlDbType.VarChar).Value       = filtro.orderby;
                comando.Parameters.Add("p_ordertype", MySqlDbType.VarChar).Value     = filtro.ordertype;
                // Se toma el valor devuelto
                dr = comando.ExecuteReader();

                if (dr.HasRows)
                {
                    ArticuloVO vo;
                    while (dr.Read())
                    {
                        vo = new ArticuloVO();

                        vo.Clave = dr.GetInt32(dr.GetOrdinal("Clave"));

                        vo.Descripcion = dr["Descripcion"].ToString();
                        vo.Modelo      = dr["Modelo"].ToString();
                        vo.Precio      = dr.GetDecimal(dr.GetOrdinal("Precio"));
                        vo.Existencia  = dr.GetInt32(dr.GetOrdinal("Existencia"));
                        vo.total       = Convert.ToInt32(dr["total"]);
                        lista.Add(vo);
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            finally
            {
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }

                dr = null;
            }

            return(lista);
        }
Example #3
0
 public List <ArticuloVO> GetArticuloList(BaseGridVO filtro)
 {
     try
     {
         return(this.Con.GetArticuloList(filtro));
     }
     catch (CCExcepcion)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new CCExcepcion(ex);
     }
 }
Example #4
0
 public List <ClienteVO> GetClienteList(BaseGridVO filtro)
 {
     try
     {
         return(this.Con.GetClienteList(filtro));
     }
     catch (CCExcepcion)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new CCExcepcion(ex);
     }
 }
Example #5
0
        public ActionResult GetVentaGrid(BaseGridVO filtro)
        {
            try
            {
                if (filtro.orderby == null || filtro.orderby == string.Empty)
                {
                    filtro.orderby = "clave";
                }

                if (filtro.ordertype == null || filtro.ordertype == string.Empty)
                {
                    filtro.ordertype = "asc";
                }

                filtro.porpagina = 10;
                filtro.realPath  = Server.MapPath("~/XmlGrids/" + filtro.xmlgrid + ".xml");


                VentasBS       BS         = new VentasBS();
                List <VentaVO> dataSource = BS.GetVentaList(filtro);

                int total = 0;
                if (dataSource.Count > 0)
                {
                    total = dataSource[0].total;
                }

                List <object> listaGrid = dataSource.ToList <object>();
                listaGrid.Add(total);

                LazyLoadDatagrid lazyGrid = new LazyLoadDatagrid();
                lazyGrid.regresaLazyLoadDatagrid(filtro.realPath, filtro.objJavascript, listaGrid);

                return(Content(lazyGrid.stbHtml.ToString()));
            }
            catch (Exception ex)
            {
                return(Json(ParseException(new CCExcepcion(ex))));
            }
        }
 public LazyLoadDatagrid(BaseGridVO f)
 {
     this.show = f.porpagina;
 }