Esempio n. 1
0
        private List <Ecom_Producto> ReadDatReader(string Statement)
        {
            List <Ecom_Producto> List = null;
            MySqlDataReader      Data = null;

            try
            {
                Ecom_Tools.ValidDBobject(Data_DBConnection_);
                Data = Data_DBConnection_.DoQuery(Statement);
                List = new List <Ecom_Producto>();
                if (Data.HasRows)
                {
                    while (Data.Read())
                    {
                        List.Add(new Ecom_Producto
                        {
                            Id               = Data.IsDBNull(0) ? 0 : (int)Data.GetUInt32(0),
                            Clave            = Data.IsDBNull(1) ? "" : Data.GetString(1),
                            Descripcion      = Data.IsDBNull(2) ? "" : Data.GetString(2),
                            PrecioCotizacion = Data.IsDBNull(3) ? 0 : Data.GetDouble(3),
                            PrecioCompra     = Data.IsDBNull(4) ? 0 : Data.GetDouble(4),
                            PrecioVenta      = Data.IsDBNull(5) ? 0 : Data.GetDouble(5),
                            FechaCotizacion  = Data.IsDBNull(6) ? DateTime.Now : Data.GetDateTime(6),
                            FechaCompra      = Data.IsDBNull(7) ? DateTime.Now : Data.GetDateTime(7),
                            FechaVenta       = Data.IsDBNull(8) ? DateTime.Now : Data.GetDateTime(8),
                            Estatus          = Data.IsDBNull(9) ? 0 : Data.GetInt32(9),
                            Pedido           = Data.IsDBNull(10) ? 0 : Data.GetInt32(10),
                            TipoProducto     = Data.IsDBNull(11) ? 0 : Data.GetInt32(11),
                            Cliente          = Data.IsDBNull(12) ? 0 : Data.GetInt32(12),
                        });
                    }
                    Data.Close();
                    List.ForEach(item => {
                        item.Ecom_ProductoTipo_ = new Ecom_ProductoTipo(Data_DBConnection_);
                        item.Ecom_ProductoTipo_.Get(item.TipoProducto);
                    });
                }
                else
                {
                    Data_DBConnection_.Message = "Sin registros";
                }
                return(List);
            }
            catch (Ecom_Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Data != null)
                {
                    Data.Close();
                }
            }
        }
Esempio n. 2
0
 public void Connect()
 {
     try
     {
         Ecom_Tools.ValidStringParameter(StringConnection, "StringConnection");
         Data_DBConnection_ = new Data_DBConnection(StringConnection);
         Data_DBConnection_.OpenConnection();
     }
     catch (Ecom_Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 3
0
        private List <Ecom_Inversiones> ReadDatReader(string Statement)
        {
            List <Ecom_Inversiones> List = null;
            MySqlDataReader         Data = null;

            try
            {
                Ecom_Tools.ValidDBobject(Data_DBConnection_);
                Data = Data_DBConnection_.DoQuery(Statement);
                List = new List <Ecom_Inversiones>();
                if (Data.HasRows)
                {
                    while (Data.Read())
                    {
                        List.Add(new Ecom_Inversiones
                        {
                            Id              = Data.IsDBNull(0) ? 0 : (int)Data.GetUInt32(0),
                            TotalInversion  = Data.IsDBNull(1) ? 0 : Data.GetDouble(1),
                            Descripcion     = Data.IsDBNull(2) ? "" : Data.GetString(2),
                            FechaInversion  = Data.IsDBNull(3) ? DateTime.Now : Data.GetDateTime(3),
                            Inversionista   = Data.IsDBNull(4) ? 0 : Data.GetInt32(4),
                            Pedido          = Data.IsDBNull(5) ? 0 : Data.GetInt32(5),
                            TotalRecuperado = Data.IsDBNull(6) ? 0 : Data.GetDouble(6),
                            FechaRecuperado = Data.IsDBNull(7) ? DateTime.Now : Data.GetDateTime(7),
                            Estatus         = Data.IsDBNull(8) ? 0: Data.GetInt32(8),
                        });
                    }
                    Data.Close();
                    List.ForEach(item => {
                        item.Ecom_Inversionista_ = new Ecom_Inversionista(Data_DBConnection_);
                        item.Ecom_Inversionista_.Get(item.Inversionista);
                    });
                }
                else
                {
                    Data_DBConnection_.Message = "Sin registros";
                }
                return(List);
            }
            catch (Ecom_Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Data != null)
                {
                    Data.Close();
                }
            }
        }
Esempio n. 4
0
        private List <Ecom_Pedido> ReadDatReader(string Statement)
        {
            List <Ecom_Pedido> List = null;
            MySqlDataReader    Data = null;

            try
            {
                Ecom_Tools.ValidDBobject(Data_DBConnection_);
                Data = Data_DBConnection_.DoQuery(Statement);
                List = new List <Ecom_Pedido>();
                if (Data.HasRows)
                {
                    while (Data.Read())
                    {
                        List.Add(new Ecom_Pedido
                        {
                            Id          = Data.IsDBNull(0) ? 0 : (int)Data.GetUInt32(0),
                            Total       = Data.IsDBNull(1) ? 0 : Data.GetDouble(1),
                            FechaCompra = Data.IsDBNull(2) ? DateTime.Now : Data.GetDateTime(2),
                            Estatus     = Data.IsDBNull(3) ? 0 : Data.GetInt32(3),
                            Proveedor   = Data.IsDBNull(4) ? 0 : Data.GetInt32(4),
                        });
                    }
                    Data.Close();
                    List.ForEach(item => {
                        item.Ecom_Proveedor_ = new Ecom_Proveedor(Data_DBConnection_);
                        item.Ecom_Proveedor_.Get(item.Proveedor);
                    });
                }
                else
                {
                    Data_DBConnection_.Message = "Sin registros";
                }
                return(List);
            }
            catch (Ecom_Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Data != null)
                {
                    Data.Close();
                }
            }
        }
Esempio n. 5
0
        private List <Ecom_PedidoAjuste> ReadDatReader(string Statement)
        {
            List <Ecom_PedidoAjuste> List = null;
            MySqlDataReader          Data = null;

            try
            {
                Ecom_Tools.ValidDBobject(Data_DBConnection_);
                Data = Data_DBConnection_.DoQuery(Statement);
                List = new List <Ecom_PedidoAjuste>();
                if (Data.HasRows)
                {
                    while (Data.Read())
                    {
                        List.Add(new Ecom_PedidoAjuste
                        {
                            Id          = Data.IsDBNull(0) ? 0 : (int)Data.GetUInt32(0),
                            Total       = Data.IsDBNull(1) ? 0 : Data.GetDouble(1),
                            Tipo        = Data.IsDBNull(2) ? 0 : Data.GetInt32(2),
                            Pedido      = Data.IsDBNull(3) ? 0 : Data.GetInt32(3),
                            Descripcion = Data.IsDBNull(4) ? "" : Data.GetString(4)
                        });
                    }
                    Data.Close();
                }
                else
                {
                    Data_DBConnection_.Message = "Sin registros";
                }
                return(List);
            }
            catch (Ecom_Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Data != null)
                {
                    Data.Close();
                }
            }
        }
Esempio n. 6
0
        private List <Ecom_Proveedor> ReadDatReader(string Statement)
        {
            List <Ecom_Proveedor> List = null;
            MySqlDataReader       Data = null;

            try
            {
                Ecom_Tools.ValidDBobject(Data_DBConnection_);
                Data = Data_DBConnection_.DoQuery(Statement);
                List = new List <Ecom_Proveedor>();
                if (Data.HasRows)
                {
                    while (Data.Read())
                    {
                        List.Add(new Ecom_Proveedor
                        {
                            Id        = Data.IsDBNull(0) ? 0 : (int)Data.GetUInt32(0),
                            Nombre    = Data.IsDBNull(1) ? "" : Data.GetString(1),
                            Telefono  = Data.IsDBNull(2) ? "" : Data.GetString(2),
                            Direccion = Data.IsDBNull(3) ? "" : Data.GetString(3),
                        });
                    }
                    Data.Close();
                }
                else
                {
                    Data_DBConnection_.Message = "Sin registros";
                }
                return(List);
            }
            catch (Ecom_Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Data != null)
                {
                    Data.Close();
                }
            }
        }
Esempio n. 7
0
        private List <Ecom_Abono> ReadDatReader(string Statement)
        {
            List <Ecom_Abono> List = null;
            MySqlDataReader   Data = null;

            try
            {
                Ecom_Tools.ValidDBobject(Data_DBConnection_);
                Data = Data_DBConnection_.DoQuery(Statement);
                List = new List <Ecom_Abono>();
                if (Data.HasRows)
                {
                    while (Data.Read())
                    {
                        List.Add(new Ecom_Abono
                        {
                            Id      = Data.IsDBNull(0) ? 0 : (int)Data.GetUInt32(0),
                            Total   = Data.IsDBNull(1) ? 0 : Data.GetDouble(1),
                            Fecha   = Data.IsDBNull(2) ? DateTime.Now : Data.GetDateTime(2),
                            Cliente = Data.IsDBNull(3) ?0 : Data.GetInt32(3),
                        });
                    }
                    Data.Close();
                }
                else
                {
                    Data_DBConnection_.Message = "Sin registros";
                }
                return(List);
            }
            catch (Ecom_Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (Data != null)
                {
                    Data.Close();
                }
            }
        }