Beispiel #1
0
        public DataSet GetListFactura(ClsFactura factura, String pACCION)
        {
            DataSet DtsFactura = new DataSet();

            try
            {
                AbrirBaseDatos();
                DtsFactura.Clear();
                DtsFactura.EnforceConstraints = false;
                Cmd             = new OracleCommand();
                Cmd.Connection  = conexion;
                Cmd.CommandText = "package_supermercados.stp_mantenimiento_factura";
                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.Parameters.Add(new OracleParameter("p_empresa", OracleDbType.Varchar2)).Value        = factura.aEMPRESA;
                Cmd.Parameters.Add(new OracleParameter("p_sucursal", OracleDbType.Varchar2)).Value       = factura.aSUCURSAL;
                Cmd.Parameters.Add(new OracleParameter("p_factura", OracleDbType.Int32)).Value           = factura.aFACTURA;
                Cmd.Parameters.Add(new OracleParameter("p_cliente", OracleDbType.Varchar2)).Value        = factura.aCLIENTE;
                Cmd.Parameters.Add(new OracleParameter("p_empleado", OracleDbType.Varchar2)).Value       = factura.aEMPLEADO;
                Cmd.Parameters.Add(new OracleParameter("p_fecha", OracleDbType.Date)).Value              = factura.aFECHA;
                Cmd.Parameters.Add(new OracleParameter("p_estado", OracleDbType.Varchar2)).Value         = factura.aESTADO;
                Cmd.Parameters.Add(new OracleParameter("p_accion", OracleDbType.Varchar2)).Value         = pACCION;
                Cmd.Parameters.Add(new OracleParameter("p_recordset", OracleDbType.RefCursor)).Direction = ParameterDirection.Output;
                OracleDataAdapter DataAdapter = new OracleDataAdapter(Cmd);
                DataAdapter.Fill(DtsFactura);
                cerrar_base();
            }
            catch (Exception Ex)
            {
                cerrar_base();
                throw new Exception(Ex.Message);
            }
            return(DtsFactura);
        }
Beispiel #2
0
        public String MaintenanceFactura(ClsFactura factura, String pACCION)
        {
            String Menssage = "";

            try
            {
                Cmd            = new OracleCommand();
                Cmd.Connection = conexion;
                AbrirBaseDatos();
                Cmd.CommandText = "package_supermercados.stp_mantenimiento_factura";
                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.Parameters.Add(new OracleParameter("p_empresa", OracleDbType.Varchar2)).Value        = factura.aEMPRESA;
                Cmd.Parameters.Add(new OracleParameter("p_sucursal", OracleDbType.Varchar2)).Value       = factura.aSUCURSAL;
                Cmd.Parameters.Add(new OracleParameter("p_factura", OracleDbType.Int32)).Value           = factura.aFACTURA;
                Cmd.Parameters.Add(new OracleParameter("p_cliente", OracleDbType.Varchar2)).Value        = factura.aCLIENTE;
                Cmd.Parameters.Add(new OracleParameter("p_empleado", OracleDbType.Varchar2)).Value       = factura.aEMPLEADO;
                Cmd.Parameters.Add(new OracleParameter("p_fecha", OracleDbType.Date)).Value              = factura.aFECHA;
                Cmd.Parameters.Add(new OracleParameter("p_estado", OracleDbType.Varchar2)).Value         = factura.aESTADO;
                Cmd.Parameters.Add(new OracleParameter("p_accion", OracleDbType.Varchar2)).Value         = pACCION;
                Cmd.Parameters.Add(new OracleParameter("p_recordset", OracleDbType.RefCursor)).Direction = ParameterDirection.Output;
                Cmd.ExecuteNonQuery();
                Menssage = "Ejecutado con exito";

                cerrar_base();
            }
            catch (Exception Ex)
            {
                Menssage = Ex.Message;
                cerrar_base();
                throw new Exception(Ex.Message);
            }
            return(Menssage);
        }