Beispiel #1
0
        // MRP_BD cnn = new MRP_BD("admin", "@umg2017", "SAD2017", "ZGHP");
        //MRP_BD cnn = new MRP_BD("sa", "ja", "SAD2017", @"LAPTOP-BN23V9UD\SQLEXPRESS");
        // Comentarios : Consultar Facturas con estado 1
        public DataTable dtFacturasPendientes(clsInventarios_Entity facturas)
        {
            DataTable dtFacturas;

            dtFacturas = cnn.getSQL("SELECT  [idfactura]  AS  ID ,[corrfactura] AS Correlativo ,[idserie] as Serie ,[total] as Total,[saldo] as Saldo,[fecha] as Fecha,[idproveedor] as Proveedor,[idbodega] as Bodega,[idmovimiento] as [ID MOVIMIENTO], idestadofactura as Estado FROM [dbo].[FACTURAPROVEEDORES] where idestadofactura = 1 and idbodega = " + facturas.strBodega + " and idproveedor = " + facturas.strIdProveedor);
            return(dtFacturas);
        }
Beispiel #2
0
        // Programador : Pamela Jacqueline Selman David
        // Analista : Pamela Jacqueline Selman David

        // Comentarios : Consulta Facturas
        public DataTable vConsultarFacturas(clsInventarios_Entity producto)
        {
            DataTable          dtProducto;
            clsInventarios_DAL consfacturas = new clsInventarios_DAL();

            dtProducto = consfacturas.dtFacturasPendientes(producto);
            return(dtProducto);
        }
Beispiel #3
0
        private void btnBuscarOC_Click(object sender, EventArgs e)
        {
            clsInventarios_BO     facturas = new clsInventarios_BO();
            clsInventarios_Entity fac      = new clsInventarios_Entity();
            string idproveedor;

            idproveedor           = cmbProveedor.SelectedValue.ToString();
            fac.strIdProveedor    = idproveedor;
            fac.strBodega         = cmbBodega.SelectedValue.ToString();
            grdFactura.DataSource = facturas.vConsultarFacturas(fac);
            Globales.Usuario.RegistrarBitácora(Globales.Conexion, "Bitacora", "Buscar Filtros.");
        }
Beispiel #4
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            string idfactura, /*corrfactura,idserie,total,*/ saldo /*,fecha,idproveedor,idbodega,idmovimiento*/;

            try
            {
                if (grdFactura.Rows.Count > 0)
                {
                    clsInventarios_Entity bod    = new clsInventarios_Entity();
                    clsInventarios_BO     bodega = new clsInventarios_BO();
                    bod.strBodega      = cmbBodega.SelectedValue.ToString();
                    bod.strIdProveedor = cmbProveedor.SelectedValue.ToString();
                    bodega.vInsertarEncabezadoContrasena(bod);

                    int id;
                    id = Convert.ToInt32(bodega.vConsultaUltimoID().Rows[0][0].ToString());
                    //    MessageBox.Show(id.ToString());

                    foreach (DataGridViewRow fila in grdFactura.Rows)
                    {
                        if (Convert.ToBoolean(fila.Cells[0].Value))
                        {
                            idfactura = fila.Cells[1].Value.ToString();
                            saldo     = fila.Cells[5].Value.ToString();

                            clsInventarios_Entity bo    = new clsInventarios_Entity();
                            clsInventarios_BO     bodeg = new clsInventarios_BO();
                            bo.strIdContrasena = id.ToString();
                            bo.strIdFactura    = idfactura;
                            bo.strmonto        = Convert.ToInt32(Convert.ToDecimal(saldo)).ToString();
                            bodeg.vInsertarDetalleContrasena(bo);

                            //  idproveedor = fila.Cells[7].Value.ToString();
                            //  idbodega = fila.Cells[8].Value.ToString();
                            //MessageBox.Show(idfactura + "__" + id.ToString() + "__" + saldo);
                        }
                    }
                    MessageBox.Show("CONTRASEÑA HA SIDO GUARDADA.");
                    Globales.Usuario.RegistrarBitácora(Globales.Conexion, "Bitacora", "Generar Contraseña.");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #5
0
 // Comentarios : insertar detalle contraseña
 public void vInsertaDetalleContrasena(clsInventarios_Entity contrasena)
 {
     cnn.insertSQL("INSERT INTO DETALLECONTRASENA (idfactura,idcontrasena,fecha,monto) values (" + contrasena.strIdFactura + "," + contrasena.strIdContrasena + ",(SELECT GETDATE())," + contrasena.strmonto + ")");
     cnn.updateSQL("UPDATE [dbo].[FACTURAPROVEEDORES] SET idestadofactura = 2  WHERE idfactura =" + contrasena.strIdFactura);
 }
Beispiel #6
0
 // Comentarios: insertar encabezado contraseña
 public void vInsertEncabezadoContrasena(clsInventarios_Entity contrasena)
 {
     cnn.insertSQL("INSERT INTO CONTRASENA (idproveedor,idsede,idestadocontrasena) values (" +
                   contrasena.strIdProveedor
                   + ",(SELECT s.idsede FROM BODEGA B INNER JOIN EMPRESA EM ON B.idempresa = em.idempresa INNER JOIN SEDE S  ON em.idsede = s.idsede where b.idbodega = " + contrasena.strBodega + "),1)");
 }
Beispiel #7
0
        // Comentarios : Función para insertar detalle de contraseña
        public void vInsertarDetalleContrasena(clsInventarios_Entity contrasena)
        {
            clsInventarios_DAL detallecontrainsert = new clsInventarios_DAL();

            detallecontrainsert.vInsertaDetalleContrasena(contrasena);
        }
Beispiel #8
0
        // Comentarios : Función para insertar Encabezado de Contraseña
        public void vInsertarEncabezadoContrasena(clsInventarios_Entity contrasena)
        {
            clsInventarios_DAL encabezadocontrainsert = new clsInventarios_DAL();

            encabezadocontrainsert.vInsertEncabezadoContrasena(contrasena);
        }