Example #1
0
 public int Editar(clsDetalleVenta obj, SentenciaSQL sql)
 {
     int resultado = 0;
     EjecutorBaseDatos.limpiarParametros();
     string sentenciaSQL = construirUpdate(obj) + CondicionSQL(sql);
     resultado = EjecutorBaseDatos.ejecutarSentencia(sentenciaSQL);
     return resultado;
 }
Example #2
0
        public clsDetalleVenta CrearObjeto(System.Data.DataTable tabla)
        {
            if (tabla.Rows.Count == 0) return null;
            clsDetalleVenta obj = new clsDetalleVenta();
            System.Data.DataRow fila =  tabla.Rows[0];
            {
                obj.Id = Convert.ToInt32(fila["Id"]);
            obj.idElemento = Convert.ToInt16(fila["idElemento"]);
            obj.idVenta = Convert.ToInt32(fila["idVenta"]);
            obj.Cantidad = Convert.ToInt32(fila["Cantidad"]);

            }
            return obj;
        }
Example #3
0
        public List<clsDetalleVenta> CrearObjetos(System.Data.DataTable tabla)
        {
            if (tabla.Rows.Count == 0) return null;
            var lista = new List<clsDetalleVenta>();
            foreach (System.Data.DataRow fila in tabla.Rows)
            {
                var obj = new clsDetalleVenta();
                obj.Id = Convert.ToInt32(fila["Id"]);
            obj.idElemento = Convert.ToInt16(fila["idElemento"]);
            obj.idVenta = Convert.ToInt32(fila["idVenta"]);
            obj.Cantidad = Convert.ToInt32(fila["Cantidad"]);

                lista.Add(obj);
            }
            return lista;
        }
Example #4
0
 public int insertarDetalleVenta(clsDetalleVenta obj)
 {
     m_clsDetalleVentaDALC = new clsDetalleVentaDALC(m_EjecutorBaseDatos);
     return m_clsDetalleVentaDALC.Insertar(obj);
 }
Example #5
0
 public int eliminarDetalleVenta(clsDetalleVenta obj, SentenciaSQL sql)
 {
     m_clsDetalleVentaDALC = new clsDetalleVentaDALC(m_EjecutorBaseDatos);
     return m_clsDetalleVentaDALC.Eliminar(obj, sql);
 }
Example #6
0
 public int Insertar(clsDetalleVenta obj)
 {
     int resultado = 0;
     EjecutorBaseDatos.limpiarParametros();
     string sentenciaSQL = construirInsert(obj);
     resultado = EjecutorBaseDatos.ejecutarSentenciaInsert(sentenciaSQL);
     return resultado;
 }