示例#1
0
 public void AgregarDetalle(TransaccionDetalle transaccion)
 {
     if (Detalle != null)
     {
         Detalle.Add(transaccion);
     }
 }
示例#2
0
 public void AgregarDetalle(int id, int transaccion, TipoTransaccion tipo, decimal Monto)
 {
     if (Detalle != null)
     {
         Detalle.Add(new TransaccionDetalle(id, transaccion, tipo, Monto));
     }
 }
示例#3
0
        //public void BuscarCliente(Entidades.Cliente clienteList)
        //{
        //    throw new NotImplementedException();
        //}

        //public IList<Entidades.Cliente> BuscarCliente()
        //{
        //    Conectividad aux = new Conectividad();
        //    SqlCommand cmd = new SqlCommand();
        //    {
        //        cmd.Connection = aux.conectar();
        //        cmd.CommandText = "spr_BuscarCliente";
        //        cmd.CommandType = CommandType.StoredProcedure;
        //    };

        //    SqlDataReader sqlDataReader = cmd.ExecuteReader();

        //    IList<Entidades.Cliente> clienteList = new List<Entidades.Cliente>();
        //    Entidades.Cliente cliente;
        //    while (sqlDataReader.Read())
        //    {
        //        cliente = new Entidades.Cliente
        //        {
        //            Documento = sqlDataReader["Documento"].ToString().Trim(),
        //            Ciudad = sqlDataReader["Ciudad"].ToString().Trim(),
        //            Nombre = sqlDataReader["Nombre"].ToString().Trim(),
        //            Correo = sqlDataReader["Correo"].ToString().Trim(),
        //            Apellido = sqlDataReader["Apellido"].ToString().Trim(),
        //            Activo = bool.Parse(sqlDataReader["activo"].ToString())
        //            //SegundoApellido = sqlDataReader[COLUMN_SEGUNDO_APELLIDO].ToString(),
        //            //FechaNacimiento = new DateTime(),
        //            //Direccion = sqlDataReader[COLUMN_TELEFONO].ToString(),
        //            //Telefono = sqlDataReader[COLUMN_DIRECCION].ToString()
        //        };

        //        clienteList.Add(cliente);
        //    }

        //    aux.conectar();

        //    return clienteList;

        //}



        public void EliminarDetalle(Entidades.Detalle detalle)
        {
            Conectividad aux = new Conectividad();
            SqlCommand   cmd = new SqlCommand();

            {
                cmd.Connection = aux.conectar();
                cmd.Parameters.Add(new SqlParameter("@idDetalle", detalle.IdDetalle));
                cmd.CommandText = "spr_EliminarDetalle";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.ExecuteNonQuery();
            };

            cmd.Connection = aux.conectar();

            //< a href = "javascript:__doPostBack('GridView','Delete$0')" > Delete </ a >
        }
示例#4
0
        public void InsertarDetalle(Entidades.Detalle detalle)
        {
            Conectividad aux = new Conectividad();
            SqlCommand   cmd = new SqlCommand();

            cmd.Connection = aux.conectar();
            SqlParameter parametroNombre = new SqlParameter();



            parametroNombre.ParameterName = "@idDetalle";
            parametroNombre.Value         = detalle.IdDetalle;
            cmd.Parameters.Add(parametroNombre);
            cmd.Parameters.Add(new SqlParameter("@precioUnitario", detalle.PrecioUnitario));
            cmd.Parameters.Add(new SqlParameter("@subtotal", detalle.Subtotal));
            cmd.Parameters.Add(new SqlParameter("@cantidad", detalle.Cantidad));
            cmd.Parameters.Add(new SqlParameter("@factura", detalle.IdFactura));
            //cmd.Parameters.Add(new SqlParameter("@fechaUsuario", cliente.FechaCliente));
            cmd.CommandText = "spr_InsertarDetalle";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.ExecuteNonQuery();
            aux.conectar();
        }
示例#5
0
        public bool Leer(string archivo, out Deuda deuda)
        {
            bool retorno = false;

            Header         header           = null;
            List <Detalle> miListaDeDetalle = new List <Detalle>();
            Footer         footer           = null;

            try
            {
                using (StreamReader sr = new StreamReader(archivo))
                {
                    string line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        string auxiliarLine = line;
                        string tipoLinea    = line.Substring(0, 1);

                        if (tipoLinea == "0")
                        {
                            string tipoDeHeader = line.Substring(0, 1);
                            string valorFijo    = line.Substring(1, 3);
                            string numComercio  = line.Substring(4, 4);
                            string fecha        = line.Substring(8, 8);
                            header = new Header(tipoDeHeader, valorFijo, numComercio, fecha);
                        }
                        if (tipoLinea == "5")
                        {
                            string tipoDeDetalle             = line.Substring(0, 1);    //1 Caracater
                            string numCliente                = line.Substring(1, 19);   //19 Caracater
                            string documento                 = line.Substring(20, 20);  //20 Caracater
                            string moneda                    = line.Substring(40, 1);   //1 Caracater
                            string primerVencimiento         = line.Substring(41, 8);   //8 Caracater
                            string importePrimerVencimiento  = line.Substring(49, 11);  //11 Caracater
                            string segundoVencimiento        = line.Substring(60, 8);   //8 Caracater
                            string importeSegundoVencimiento = line.Substring(68, 11);  //11 Caracater
                            string tercerVencimiento         = line.Substring(79, 8);   //8 Caracater
                            string importeTercerVencimiento  = line.Substring(87, 11);  //11 Caracater
                            string valorFijoSegundo          = line.Substring(98, 19);  //19 Caracater
                            string numReferencia             = line.Substring(117, 19); //19 Caracater
                            string mensajeTicket             = line.Substring(136, 55); //55 Caracater
                            string codBarras                 = line.Substring(191, 38); //38 Caracater

                            Detalle detalle = new Detalle(tipoDeDetalle, numCliente, documento,
                                                          moneda, primerVencimiento, importePrimerVencimiento,
                                                          segundoVencimiento, importeSegundoVencimiento, tercerVencimiento,
                                                          importeTercerVencimiento, valorFijoSegundo, numReferencia,
                                                          mensajeTicket, codBarras);

                            miListaDeDetalle.Add(detalle);
                        }
                        if (tipoLinea == "9")
                        {
                            string tipoDeFooter              = line.Substring(0, 1);  //1 Caracater
                            string valorFijoFooter           = line.Substring(1, 3);  //3 Caracater
                            string comercio                  = line.Substring(4, 4);  //4 Caracater
                            string fechaFotter               = line.Substring(8, 8);  //8 Caracater formato AAAAMMDD
                            string cantRegistros             = line.Substring(16, 7); //7 Caracater
                            string valorFijoSegundoDelFooter = line.Substring(23, 7); //7 Caracater
                            string importe = line.Substring(30, 11);                  //11 Caracater

                            footer = new Footer(tipoDeFooter, valorFijoFooter, comercio,
                                                fechaFotter, cantRegistros, valorFijoSegundoDelFooter, importe);
                        }
                    }

                    Deuda deudaArchivo = new Deuda(header, miListaDeDetalle, footer);
                    retorno = true;
                    deuda   = deudaArchivo;
                }
            }
            catch (Exception)
            {
                throw new Exception("Error Leer");
            }
            return(retorno);
        }
示例#6
0
 public void AgregarDetalle(int iD, int reciboId,int articuloId,string articulo, string descripcion, int cantidad, decimal monto)
 {
     Detalle.Add(new ReciboDetalles(iD,reciboId,articuloId,articulo, descripcion, cantidad, monto));
 }