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

            }
            return obj;
        }
예제 #3
0
        protected void eliminarDatos(OrderedDictionary keys)
        {
            clsDetalleDocumento DetalleDocumento = new clsDetalleDocumento();
            DetalleDocumento.Id = keys["Id"] as int?;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;

            SentenciaSQL sql = new SentenciaSQL();
            sql.FiltroBD.Add(new FiltroBD(clsDetalleDocumento.Campos.Id, DetalleDocumento.Id, FiltroBD.OperadorLogico.igual));
            resultado = fachadaCore.eliminarDetalleDocumento(DetalleDocumento, sql);

            Session["Datos" + nombreForm] = null;
            gvDatos.DataBind();
        }
예제 #4
0
        public List<clsDetalleDocumento> CrearObjetos(System.Data.DataTable tabla)
        {
            if (tabla.Rows.Count == 0) return null;
            var lista = new List<clsDetalleDocumento>();
            foreach (System.Data.DataRow fila in tabla.Rows)
            {
                var obj = new clsDetalleDocumento();
                obj.Id = Convert.ToInt32(fila["Id"]);
            obj.idElemento = Convert.ToInt16(fila["idElemento"]);
            obj.idDocumento = Convert.ToInt32(fila["idDocumento"]);
            obj.idBodegaDestino = Convert.ToByte(fila["idBodegaDestino"]);
            obj.idBodegaOrigen = Convert.ToByte(fila["idBodegaOrigen"]);
            obj.Cantidad = Convert.ToInt32(fila["Cantidad"]);

                lista.Add(obj);
            }
            return lista;
        }
예제 #5
0
        protected void actualizarDatos(OrderedDictionary keys, OrderedDictionary newValues)
        {
            clsDetalleDocumento DetalleDocumento = new clsDetalleDocumento();
            DetalleDocumento.Id = keys["Id"] as int?;
            DetalleDocumento.idElemento = newValues["idElemento"] as short?;
            DetalleDocumento.idDocumento = (int)IdDocumento;
            DetalleDocumento.idBodegaOrigen = newValues["idBodegaOrigen"] as byte?;
            DetalleDocumento.idBodegaDestino = newValues["idBodegaDestino"] as byte?;
            Int32 valorCantidad = 0;
            Int32.TryParse(newValues["Cantidad"].ToString(), out valorCantidad);
            DetalleDocumento.Cantidad = valorCantidad;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;

            SentenciaSQL sql = new SentenciaSQL();
            sql.FiltroBD.Add(new FiltroBD(clsDetalleDocumento.Campos.Id, DetalleDocumento.Id, FiltroBD.OperadorLogico.igual));
            resultado = fachadaCore.editarDetalleDocumento(DetalleDocumento, sql);

            Session["Datos" + nombreForm] = null;
            gvDatos.DataBind();
        }
예제 #6
0
        protected void insertarDatos(OrderedDictionary newValues)
        {
            clsDetalleDocumento DetalleDocumento = new clsDetalleDocumento();
            DetalleDocumento.idDocumento = (int)IdDocumento;
            DetalleDocumento.idElemento = newValues["idElemento"] as short?;
            DetalleDocumento.idBodegaOrigen = newValues["idBodegaOrigen"] as byte?;
            DetalleDocumento.idBodegaDestino = newValues["idBodegaDestino"] as byte?;
            Int32 valorCantidad = 0;
            Int32.TryParse(newValues["Cantidad"].ToString(), out valorCantidad);
            DetalleDocumento.Cantidad = valorCantidad;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;
            resultado = fachadaCore.insertarDetalleDocumento(DetalleDocumento);

            Session["Datos" + nombreForm] = null;
            gvDatos.DataBind();
        }
예제 #7
0
 public int Insertar(clsDetalleDocumento obj)
 {
     int resultado = 0;
     EjecutorBaseDatos.limpiarParametros();
     string sentenciaSQL = construirInsert(obj);
     resultado = EjecutorBaseDatos.ejecutarSentenciaInsert(sentenciaSQL);
     return resultado;
 }
예제 #8
0
 public int insertarDetalleDocumento(clsDetalleDocumento obj)
 {
     m_clsDetalleDocumentoDALC = new clsDetalleDocumentoDALC(m_EjecutorBaseDatos);
     return m_clsDetalleDocumentoDALC.Insertar(obj);
 }
예제 #9
0
 public int eliminarDetalleDocumento(clsDetalleDocumento obj, SentenciaSQL sql)
 {
     m_clsDetalleDocumentoDALC = new clsDetalleDocumentoDALC(m_EjecutorBaseDatos);
     return m_clsDetalleDocumentoDALC.Eliminar(obj, sql);
 }