Пример #1
0
        private DataTable GetCriteriQuery(int IdSchema)
        {
            OracleDataLayer      _OraDl = new OracleDataLayer(s_ConnStr);
            S_ControlsCollection param  = new S_ControlsCollection();

            S_Object pIdSchema;

            pIdSchema = new S_Object();
            pIdSchema.ParameterName = "pIdSchema";
            pIdSchema.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pIdSchema.Direction     = ParameterDirection.Input;
            pIdSchema.Value         = IdSchema;
            pIdSchema.Size          = 1000;
            pIdSchema.Index         = 0;
            param.Add(pIdSchema);

            S_Object io_cursor = new S_Object();

            io_cursor.ParameterName = "io_cursor";
            io_cursor.Direction     = ParameterDirection.Output;
            io_cursor.DbType        = ApplicationDataLayer.DBType.CustomDBType.Cursor;
            io_cursor.Index         = 1;
            param.Add(io_cursor);

            DataSet ds = _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.IL_SpCriteriQuery");

            return(ds.Tables[0]);
        }
Пример #2
0
        private DataTable DataGlossario(int IdVista)
        {
            OracleDataLayer      _OraDl = new OracleDataLayer(s_ConnStr);
            S_ControlsCollection param  = new S_ControlsCollection();

            S_Object pIdVista = new S_Object();

            pIdVista.ParameterName = "pIdVista";
            pIdVista.Direction     = ParameterDirection.Input;
            pIdVista.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pIdVista.Size          = 32;
            pIdVista.Index         = 0;
            pIdVista.Value         = IdVista;
            param.Add(pIdVista);

            S_Object io_cursor = new S_Object();

            io_cursor.ParameterName = "io_cursor";
            io_cursor.Direction     = ParameterDirection.Output;
            io_cursor.DbType        = ApplicationDataLayer.DBType.CustomDBType.Cursor;
            io_cursor.Index         = 1;
            param.Add(io_cursor);

            DataSet ds = _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.GetDettaglioGlossario");

            return(ds.Tables[0]);
        }
Пример #3
0
        private DataTable GetCampiOrderBy(int IdSchema)
        {
            OracleDataLayer      _OraDl = new OracleDataLayer(s_ConnStr);
            S_ControlsCollection param  = new S_ControlsCollection();

            S_Object pIdQuery = new S_Object();

            pIdQuery.ParameterName = "pIdSchema";
            pIdQuery.Direction     = ParameterDirection.Input;
            pIdQuery.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pIdQuery.Value         = IdSchema;
            pIdQuery.Size          = 32;
            pIdQuery.Index         = 0;
            param.Add(pIdQuery);

            S_Object io_cursor = new S_Object();

            io_cursor.ParameterName = "io_cursor";
            io_cursor.Direction     = ParameterDirection.Output;
            io_cursor.DbType        = ApplicationDataLayer.DBType.CustomDBType.Cursor;
            io_cursor.Index         = 1;
            param.Add(io_cursor);


            string CurrentProcedure = "IL_PACK_INTERROGAZIONI.IL_OrderBy";

            DataSet ds = _OraDl.ExecuteProcedure(param, CurrentProcedure);

            return(ds.Tables[0]);
        }
Пример #4
0
        private void DeleteCriteri()
        {
            ApplicationDataLayer.OracleDataLayer _OraDl;
            _OraDl = new OracleDataLayer(s_ConnStr);

            S_ControlsCollection param = new S_ControlsCollection();

            S_Object pIdSchema;

            pIdSchema = new S_Object();
            pIdSchema.ParameterName = "pIdSchema";
            pIdSchema.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pIdSchema.Direction     = ParameterDirection.Input;
            pIdSchema.Value         = IdQuery;
            pIdSchema.Size          = 32;
            pIdSchema.Index         = 5;
            param.Add(pIdSchema);

            S_Object DirParam;

            DirParam = new S_Object();
            DirParam.ParameterName = "pId";
            DirParam.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            DirParam.Direction     = ParameterDirection.Output;
            DirParam.Value         = DBNull.Value;
            DirParam.Size          = 32;
            DirParam.Index         = 1;
            param.Add(DirParam);

            _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.IL_SpDeleteFiltri");
        }
Пример #5
0
        private DataTable DataViste()
        {
            OracleDataLayer      _OraDl = new OracleDataLayer(s_ConnStr);
            S_ControlsCollection param  = new S_ControlsCollection();

            S_Object io_cursor = new S_Object();

            io_cursor.ParameterName = "io_cursor";
            io_cursor.Direction     = ParameterDirection.Output;
            io_cursor.DbType        = ApplicationDataLayer.DBType.CustomDBType.Cursor;
            io_cursor.Index         = 1;
            param.Add(io_cursor);

            DataSet ds = _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.GetSchemaViste");

            return(ds.Tables[0]);
        }
Пример #6
0
        private DataTable GetSchemaVista(string NomeVista)
        {
            string               UserId = ConfigurationSettings.AppSettings["UserId"];
            OracleDataLayer      _OraDl = new OracleDataLayer(s_ConnStr);
            S_ControlsCollection param  = new S_ControlsCollection();

            S_Object Ppropprietario = new S_Object();

            Ppropprietario.ParameterName = "pOwner";
            Ppropprietario.Direction     = ParameterDirection.Input;
            Ppropprietario.DbType        = CustomDBType.VarChar;
            Ppropprietario.Size          = 32;
            Ppropprietario.Index         = 0;
            Ppropprietario.Value         = UserId;
            param.Add(Ppropprietario);

            S_Object PNomeVista = new S_Object();

            PNomeVista.ParameterName = "pTabella";
            PNomeVista.Direction     = ParameterDirection.Input;
            PNomeVista.DbType        = CustomDBType.VarChar;
            PNomeVista.Size          = 32;
            PNomeVista.Index         = 1;
            PNomeVista.Value         = NomeVista.Trim();
            param.Add(PNomeVista);

            S_Object io_cursor = new S_Object();

            io_cursor.ParameterName = "io_cursor";
            io_cursor.Direction     = ParameterDirection.Output;
            io_cursor.DbType        = CustomDBType.Cursor;
            io_cursor.Index         = 2;
            param.Add(io_cursor);
            DataSet ds = _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.GetSchema");

            return(ds.Tables[0]);
        }
Пример #7
0
        public DataSet GetData(int IdQuery)
        {
            string SSql = String.Empty;

            SSql = GetQuery(IdQuery);
            OracleDataLayer      _OraDl = new OracleDataLayer(s_ConnStr);
            S_ControlsCollection param  = new S_ControlsCollection();

            S_Object pSqlStatement;

            pSqlStatement = new S_Object();
            pSqlStatement.ParameterName = "pSqlStatement";
            pSqlStatement.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pSqlStatement.Direction     = ParameterDirection.Input;
            pSqlStatement.Value         = SSql;
            pSqlStatement.Size          = 1000;
            pSqlStatement.Index         = 0;
            param.Add(pSqlStatement);

            S_Object io_cursor = new S_Object();

            io_cursor.ParameterName = "io_cursor";
            io_cursor.Direction     = ParameterDirection.Output;
            io_cursor.DbType        = ApplicationDataLayer.DBType.CustomDBType.Cursor;
            io_cursor.Index         = 1;
            param.Add(io_cursor);

            try
            {
                DataSet ds = _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.IL_SpGetDatiDn");
                return(ds);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message + "<br>" + SSql);
            }
        }
Пример #8
0
        public void ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e, string[] ControlParamName, string ControlForIdName, string StoredProcedure, string command, App_Code.Businnes.DataManager dataManager)
        {
            switch (e.CommandName)
            {
            case "Delete":
                int IdQuery = int.Parse(Dt.DataKeys[(int)e.Item.ItemIndex].ToString());
                ApplicationDataLayer.OracleDataLayer _OraDl;
                _OraDl = new OracleDataLayer(s_ConnStr);

                S_ControlsCollection param = new S_ControlsCollection();

                S_Object IdSchema;
                IdSchema = new S_Object();
                IdSchema.ParameterName = "pIdSchema";
                IdSchema.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
                IdSchema.Direction     = ParameterDirection.Input;
                IdSchema.Value         = IdQuery;
                IdSchema.Index         = 0;
                param.Add(IdSchema);

                S_Object DirParam;
                DirParam = new S_Object();
                DirParam.ParameterName = "pId";
                DirParam.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
                DirParam.Direction     = ParameterDirection.Output;
                DirParam.Value         = DBNull.Value;
                DirParam.Index         = 1;
                param.Add(DirParam);

                _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.IL_SpDeleteSchema");
                break;

            default:
                // Do nothing.
                break;
            }
        }
Пример #9
0
        private string GetTipoDato(string Tabella, string Origine)
        {
            string               UserId = ConfigurationSettings.AppSettings["UserId"];
            OracleDataLayer      _OraDl = new OracleDataLayer(s_ConnStr);
            S_ControlsCollection param  = new S_ControlsCollection();

            S_Object Ppropprietario = new S_Object();

            Ppropprietario.ParameterName = "pOwner";
            Ppropprietario.Direction     = ParameterDirection.Input;
            Ppropprietario.DbType        = CustomDBType.VarChar;
            Ppropprietario.Size          = 32;
            Ppropprietario.Index         = 0;
            Ppropprietario.Value         = UserId;
            param.Add(Ppropprietario);

            S_Object pCampo = new S_Object();

            pCampo.ParameterName = "pCampo";
            pCampo.Direction     = ParameterDirection.Input;
            pCampo.DbType        = CustomDBType.VarChar;
            pCampo.Size          = 32;
            pCampo.Index         = 1;
            pCampo.Value         = Origine;
            param.Add(pCampo);

            S_Object pTabella = new S_Object();

            pTabella.ParameterName = "pTabella";
            pTabella.Direction     = ParameterDirection.Input;
            pTabella.DbType        = CustomDBType.VarChar;
            pTabella.Size          = 32;
            pTabella.Index         = 2;
            pTabella.Value         = Tabella;
            param.Add(pTabella);

            S_Object io_cursor = new S_Object();

            io_cursor.ParameterName = "io_cursor";
            io_cursor.Direction     = ParameterDirection.Output;
            io_cursor.DbType        = CustomDBType.Cursor;
            io_cursor.Index         = 3;
            param.Add(io_cursor);
            DataSet ds         = _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.GetTipoDato");
            string  TipoOracle = Convert.ToString(ds.Tables[0].Rows[0][0]);
            string  ret;

            switch (TipoOracle)
            {
            case  "VARCHAR2":
                ret = "T";
                break;

            case "CHAR":
                ret = "T";
                break;

            case "DATE":
                ret = "D";
                break;

            case "FLOAT":
                ret = "N";
                break;

            case "LONG":
                ret = "N";
                break;

            case "NUMBER":
                ret = "N";
                break;

            default:
                ret = "T";
                break;
            }
            return(ret);
        }
Пример #10
0
        private DataTable GetCampiQuery(int IdSchema)
        {
            int                  cntPar = 0;
            OracleDataLayer      _OraDl = new OracleDataLayer(s_ConnStr);
            S_ControlsCollection param  = new S_ControlsCollection();

            S_Object pIdQuery = new S_Object();

            pIdQuery.ParameterName = "pIdQuery";
            pIdQuery.Direction     = ParameterDirection.Input;
            pIdQuery.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pIdQuery.Value         = IdSchema;
            pIdQuery.Size          = 32;
            pIdQuery.Index         = cntPar++;
            param.Add(pIdQuery);

            S_Object pSelect = new S_Object();

            pSelect.ParameterName = "pSelected";
            pSelect.Direction     = ParameterDirection.Input;
            pSelect.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pSelect.Value         = 1;
            pSelect.Size          = 32;
            pSelect.Index         = cntPar++;
            param.Add(pSelect);

            S_Object pSortExpression = new S_Object();

            pSortExpression.ParameterName = "pSortExpression";
            pSortExpression.Direction     = ParameterDirection.Input;
            pSortExpression.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pSortExpression.Size          = 100;
            pSortExpression.Index         = cntPar++;
            pSortExpression.Value         = DBNull.Value;
            param.Add(pSortExpression);


            S_Object pIdVista = new S_Object();

            pIdVista.ParameterName = "pIdVista";
            pIdVista.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pIdVista.Direction     = ParameterDirection.Input;
            pIdVista.Size          = 32;
            pIdVista.Value         = _IdVista;
            pIdVista.Index         = cntPar++;
            param.Add(pIdVista);

            S_Object io_cursor = new S_Object();

            io_cursor.ParameterName = "io_cursor";
            io_cursor.Direction     = ParameterDirection.Output;
            io_cursor.DbType        = ApplicationDataLayer.DBType.CustomDBType.Cursor;
            io_cursor.Index         = cntPar++;
            param.Add(io_cursor);


            string CurrentProcedure = "IL_PACK_INTERROGAZIONI.IL_SpSelectGlossario";

            DataSet ds = _OraDl.ExecuteProcedure(param, CurrentProcedure);

            return(ds.Tables[0]);
        }
Пример #11
0
        private void InsertCriteri(int idGlossario, string operatore, string val1, string val2)
        {
            ApplicationDataLayer.OracleDataLayer _OraDl;
            _OraDl = new OracleDataLayer(s_ConnStr);


            S_ControlsCollection param = new S_ControlsCollection();

            S_Object pIdSchema;

            pIdSchema = new S_Object();
            pIdSchema.ParameterName = "pIdSchema";
            pIdSchema.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pIdSchema.Direction     = ParameterDirection.Input;
            pIdSchema.Value         = IdQuery == 0?NewIdQuery:IdQuery;
            pIdSchema.Index         = 0;
            pIdSchema.Size          = 32;
            param.Add(pIdSchema);

            S_Object pIdGlossario;

            pIdGlossario = new S_Object();
            pIdGlossario.ParameterName = "pIdGlossario";
            pIdGlossario.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pIdGlossario.Direction     = ParameterDirection.Input;
            pIdGlossario.Value         = idGlossario;
            pIdGlossario.Index         = 1;
            pIdGlossario.Size          = 32;
            param.Add(pIdGlossario);

            S_Object pOperatore;

            pOperatore = new S_Object();
            pOperatore.ParameterName = "pOperatore";
            pOperatore.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pOperatore.Direction     = ParameterDirection.Input;
            pOperatore.Value         = operatore;
            pOperatore.Index         = 2;
            pOperatore.Size          = 32;
            param.Add(pOperatore);

            S_Object pValore1;

            pValore1 = new S_Object();
            pValore1.ParameterName = "pValore1";
            pValore1.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pValore1.Direction     = ParameterDirection.Input;
            pValore1.Value         = val1;
            pValore1.Index         = 3;
            pValore1.Size          = 32;
            param.Add(pValore1);

            S_Object pValore2;

            pValore2 = new S_Object();
            pValore2.ParameterName = "pValore2";
            pValore2.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pValore2.Direction     = ParameterDirection.Input;
            pValore2.Value         = val2;
            pValore2.Index         = 4;
            pValore2.Size          = 32;
            param.Add(pValore2);

            S_Object DirParam;

            DirParam = new S_Object();
            DirParam.ParameterName = "pId";
            DirParam.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            DirParam.Direction     = ParameterDirection.Output;
            DirParam.Value         = DBNull.Value;
            DirParam.Index         = 5;
            DirParam.Size          = 32;
            param.Add(DirParam);

            _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.IL_SpInsertFiltro");
        }
Пример #12
0
        private void InsertDettaglio(int IdGlossario, string Ordinamento, string Funzione, bool Visibile, int Posizione)
        {
            ApplicationDataLayer.OracleDataLayer _OraDl;
            _OraDl = new OracleDataLayer(s_ConnStr);

            S_ControlsCollection param = new S_ControlsCollection();

            S_Object pIdSchema;

            pIdSchema = new S_Object();
            pIdSchema.ParameterName = "pIdSchema";
            pIdSchema.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pIdSchema.Size          = 32;
            pIdSchema.Direction     = ParameterDirection.Input;
            pIdSchema.Value         = IdQuery == 0?NewIdQuery:IdQuery;
            pIdSchema.Index         = 0;
            param.Add(pIdSchema);

            S_Object pIdGlossario;

            pIdGlossario = new S_Object();
            pIdGlossario.ParameterName = "pIdGlossario";
            pIdGlossario.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pIdGlossario.Size          = 32;
            pIdGlossario.Direction     = ParameterDirection.Input;
            pIdGlossario.Value         = IdGlossario;
            pIdGlossario.Index         = 1;
            param.Add(pIdGlossario);

            S_Object pOrdinamento;

            pOrdinamento = new S_Object();
            pOrdinamento.ParameterName = "pOrdinamento";
            pOrdinamento.Size          = 32;
            pOrdinamento.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pOrdinamento.Direction     = ParameterDirection.Input;
            pOrdinamento.Value         = Ordinamento;
            pOrdinamento.Index         = 2;
            param.Add(pOrdinamento);

            S_Object pFunzione;

            pFunzione = new S_Object();
            pFunzione.ParameterName = "pFunzione";
            pFunzione.Size          = 32;
            pFunzione.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pFunzione.Direction     = ParameterDirection.Input;
            pFunzione.Value         = Funzione;
            pFunzione.Index         = 3;
            param.Add(pFunzione);

            S_Object pVisibile;

            pVisibile = new S_Object();
            pVisibile.ParameterName = "pVisibile";
            pVisibile.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pVisibile.Size          = 32;
            pVisibile.Direction     = ParameterDirection.Input;
            pVisibile.Value         = Visibile?0:1;
            pVisibile.Index         = 4;
            param.Add(pVisibile);

            S_Object pPosizione;

            pPosizione = new S_Object();
            pPosizione.ParameterName = "pPosizione";
            pPosizione.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            pPosizione.Size          = 32;
            pPosizione.Direction     = ParameterDirection.Input;
            pPosizione.Value         = Posizione;
            pPosizione.Index         = 5;
            param.Add(pPosizione);

            _OraDl.ExecuteProcedure(param, "IL_PACK_INTERROGAZIONI.IL_SpInsertDettaglio");
        }