Exemple #1
0
        public string[] GetValueParametri()
        {
            S_ControlsCollection CollezioneControlli = new S_ControlsCollection();

            S_Controls.Collections.S_Object s_totEQ = new S_Object();
            s_totEQ.ParameterName = "p_totEQ";
            s_totEQ.DbType        = CustomDBType.Integer;
            s_totEQ.Direction     = ParameterDirection.Output;
            s_totEQ.Index         = 0;
            s_totEQ.Size          = 50;

            S_Controls.Collections.S_Object s_totEQSTDinEQ = new S_Object();
            s_totEQSTDinEQ.ParameterName = "p_totEQSTDinEQ";
            s_totEQSTDinEQ.DbType        = CustomDBType.Integer;
            s_totEQSTDinEQ.Direction     = ParameterDirection.Output;
            s_totEQSTDinEQ.Index         = 1;
            s_totEQSTDinEQ.Size          = 50;

            S_Controls.Collections.S_Object s_totEQinPMS = new S_Object();
            s_totEQinPMS.ParameterName = "p_totEQinPMS";
            s_totEQinPMS.DbType        = CustomDBType.Integer;
            s_totEQinPMS.Direction     = ParameterDirection.Output;
            s_totEQinPMS.Index         = 2;
            s_totEQinPMS.Size          = 50;

            S_Controls.Collections.S_Object s_totEQnoPMS = new S_Object();
            s_totEQnoPMS.ParameterName = "p_totEQnoPMS";
            s_totEQnoPMS.DbType        = CustomDBType.Integer;
            s_totEQnoPMS.Direction     = ParameterDirection.Output;
            s_totEQnoPMS.Index         = 3;
            s_totEQnoPMS.Size          = 50;

            S_Controls.Collections.S_Object s_totEQSTDinPMP = new S_Object();
            s_totEQSTDinPMP.ParameterName = "p_totEQSTDinPMP";
            s_totEQSTDinPMP.DbType        = CustomDBType.Integer;
            s_totEQSTDinPMP.Direction     = ParameterDirection.Output;
            s_totEQSTDinPMP.Index         = 4;
            s_totEQSTDinPMP.Size          = 50;

            S_Controls.Collections.S_Object s_totEQSTDEQinPMP = new S_Object();
            s_totEQSTDEQinPMP.ParameterName = "p_totEQSTDEQinPMP";
            s_totEQSTDEQinPMP.DbType        = CustomDBType.Integer;
            s_totEQSTDEQinPMP.Direction     = ParameterDirection.Output;
            s_totEQSTDEQinPMP.Index         = 5;
            s_totEQSTDEQinPMP.Size          = 50;

            S_Controls.Collections.S_Object s_totEQSTD = new S_Object();
            s_totEQSTD.ParameterName = "p_totEQSTD";
            s_totEQSTD.DbType        = CustomDBType.Integer;
            s_totEQSTD.Direction     = ParameterDirection.Output;
            s_totEQSTD.Index         = 6;
            s_totEQSTD.Size          = 50;

            CollezioneControlli.Add(s_totEQ);
            CollezioneControlli.Add(s_totEQSTDinEQ);
            CollezioneControlli.Add(s_totEQinPMS);
            CollezioneControlli.Add(s_totEQnoPMS);
            CollezioneControlli.Add(s_totEQSTDinPMP);
            CollezioneControlli.Add(s_totEQSTDEQinPMP);
            CollezioneControlli.Add(s_totEQSTD);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);
            string s_StrSql = "PACK_SCHEDULA.getConta_EQ_PMP";

            System.Data.OracleClient.OracleParameterCollection Parametri = _OraDl.ParametersArray(CollezioneControlli, s_StrSql);

            string[] ParValues = new string[Parametri.Count];
            for (int Par = 0; Par < Parametri.Count; Par++)
            {
                //ParValues.SetValue(Parametri[Par].Value,Par);
                ParValues[Par] = Parametri[Par].Value.ToString();
            }
            return(ParValues);
        }
        public DataTable GetDati(int Parm, string ProcedureName)
        {
            S_ControlsCollection CollezioneControlli = new S_ControlsCollection();

            if (Parm == 1)
            {
                S_Controls.Collections.S_Object p = new S_Object();
                p.ParameterName = "P_ID_PROGETTO";
                p.DbType        = CustomDBType.Integer;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                p.Value         = 1;
                CollezioneControlli.Add(p);
            }

            if (Parm == 2 || Parm == 4)
            {
                S_Controls.Collections.S_Object p = new S_Object();
                p.ParameterName = "P_ID_PROGETTO";
                p.DbType        = CustomDBType.Integer;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                p.Value         = 1;
                CollezioneControlli.Add(p);

                p = new S_Object();
                p.ParameterName = "P_ANNO";
                p.DbType        = CustomDBType.VarChar;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                p.Value         = DrAnno4.SelectedValue;
                p.Size          = 4;
                CollezioneControlli.Add(p);

                p = new S_Object();
                p.ParameterName = "P_MESE";
                p.DbType        = CustomDBType.VarChar;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                if (DrMese4.SelectedValue.Length == 1)
                {
                    p.Value = "0" + DrMese4.SelectedValue;
                }
                else
                {
                    p.Value = DrMese4.SelectedValue;
                }
                p.Size = 4;
                CollezioneControlli.Add(p);

                p = new S_Object();
                p.ParameterName = "P_COD_SEDE";
                p.DbType        = CustomDBType.VarChar;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                p.Value         = DrEdi.SelectedValue;
                p.Size          = 10;
                CollezioneControlli.Add(p);
            }


            if (Parm == 3)
            {
                S_Controls.Collections.S_Object p = new S_Object();
                p.ParameterName = "P_ID_PROGETTO";
                p.DbType        = CustomDBType.Integer;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                p.Value         = 1;
                CollezioneControlli.Add(p);
            }


            S_Controls.Collections.S_Object s_IdOut = new S_Object();
            s_IdOut.ParameterName = "IO_CURSOR";
            s_IdOut.DbType        = CustomDBType.Cursor;
            s_IdOut.Direction     = ParameterDirection.Output;
            s_IdOut.Index         = CollezioneControlli.Count;
            CollezioneControlli.Add(s_IdOut);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]);

            DataSet _Ds = _OraDl.GetRows(CollezioneControlli, ProcedureName);

            return(_Ds.Tables[0]);
        }
Exemple #3
0
        private void BindDt()
        {
            ApplicationDataLayer.OracleDataLayer _OraDl;
            _OraDl = new OracleDataLayer(s_ConnStr);

            S_ControlsCollection CollezioneParametri = new S_ControlsCollection();


//			S_Object pTabella=new S_Object();
//			pTabella.ParameterName = "pTabella";
//			pTabella.DbType = CustomDBType.VarChar;
//			pTabella.Direction = ParameterDirection.Input;
//			pTabella.Size = 100;
//			pTabella.Value = NomeTabella;
//			pTabella.Index=0;
//			CollezioneParametri.Add(pTabella);


            S_Object pCampo = new S_Object();

            pCampo.ParameterName = "pCampo";
            pCampo.DbType        = CustomDBType.VarChar;
            pCampo.Direction     = ParameterDirection.Input;
            pCampo.Size          = 100;
            pCampo.Value         = NomeCampo;
            pCampo.Index         = 1;
            CollezioneParametri.Add(pCampo);

            S_Object pVal = new S_Object();

            pVal.ParameterName = "pVal";
            pVal.DbType        = CustomDBType.VarChar;
            pVal.Direction     = ParameterDirection.Input;
            pVal.Size          = 100;
            pVal.Value         = Valore;
            pVal.Index         = 2;
            CollezioneParametri.Add(pVal);

            S_Object pTipo = new S_Object();

            pTipo.ParameterName = "pTipo";
            pTipo.DbType        = CustomDBType.VarChar;
            pTipo.Direction     = ParameterDirection.Input;
            pTipo.Size          = 100;
            pTipo.Value         = Tipo;
            pTipo.Index         = 3;
            CollezioneParametri.Add(pTipo);

            Hashtable _HS       = (Hashtable)Session["ParametriSelectSchema"];
            string    NomeVista = Convert.ToString(_HS["NomeVista"]);

            S_Object pNomeVista = new S_Object();

            pNomeVista.ParameterName = "pNomeVista";
            pNomeVista.DbType        = CustomDBType.VarChar;
            pNomeVista.Direction     = ParameterDirection.Input;
            pNomeVista.Size          = 100;
            pNomeVista.Value         = NomeVista;
            pNomeVista.Index         = 4;
            CollezioneParametri.Add(pNomeVista);

            S_Object s_IdIn = new S_Object();

            s_IdIn.ParameterName = "putente";
            s_IdIn.DbType        = CustomDBType.VarChar;
            s_IdIn.Direction     = ParameterDirection.Input;
            s_IdIn.Index         = 5;
            s_IdIn.Value         = System.Web.HttpContext.Current.User.Identity.Name;
            CollezioneParametri.Add(s_IdIn);

            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         = 6;
            CollezioneParametri.Add(io_cursor);

            DataTable dt = new DataTable();

            //Recupero i dati dal DataBase

            dt = _OraDl.GetRows(CollezioneParametri, "IL_PACK_INTERROGAZIONI.IL_SpSelectValCampo").Copy().Tables[0];

            MyDataGrid1.DataSource = dt;
            MyDataGrid1.DataBind();

            elementiTrovati = dt.Rows.Count;
        }
Exemple #4
0
        public int ExecutePianiBuilding(string operazione, long idBl, long idPiano, decimal mQLordi, decimal mQNetti, decimal mQMura)
        {
            int result = 0;

            S_ControlsCollection _SColl = new S_ControlsCollection();

            S_Controls.Collections.S_Object s_id = new S_Object();
            s_id.ParameterName = "p_ID_BL";
            s_id.DbType        = CustomDBType.Integer;
            s_id.Direction     = ParameterDirection.Input;
            s_id.Index         = 0;
            s_id.Value         = idBl;

            S_Controls.Collections.S_Object s_idPiano = new S_Object();
            s_idPiano.ParameterName = "p_ID_PIANO";
            s_idPiano.DbType        = CustomDBType.Integer;
            s_idPiano.Direction     = ParameterDirection.Input;
            s_idPiano.Index         = 1;
            s_idPiano.Value         = idPiano;

            S_Controls.Collections.S_Object s_lordi = new S_Object();
            s_lordi.ParameterName = "p_MQLORDI";
            s_lordi.DbType        = CustomDBType.Float;
            s_lordi.Direction     = ParameterDirection.Input;
            s_lordi.Index         = 2;
            s_lordi.Value         = mQLordi;

            S_Controls.Collections.S_Object s_netti = new S_Object();
            s_netti.ParameterName = "p_MQNETTI";
            s_netti.DbType        = CustomDBType.Float;
            s_netti.Direction     = ParameterDirection.Input;
            s_netti.Index         = 3;
            s_netti.Value         = mQNetti;

            S_Controls.Collections.S_Object s_mura = new S_Object();
            s_mura.ParameterName = "p_MQMURA";
            s_mura.DbType        = CustomDBType.Float;
            s_mura.Direction     = ParameterDirection.Input;
            s_mura.Index         = 4;
            s_mura.Value         = mQMura;


            S_Controls.Collections.S_Object s_Output = new S_Object();
            s_Output.ParameterName = "p_IdOut";
            s_Output.DbType        = CustomDBType.Integer;
            s_Output.Direction     = ParameterDirection.Output;
            s_Output.Index         = 5;

            _SColl.Add(s_id);
            _SColl.Add(s_idPiano);
            _SColl.Add(s_lordi);
            _SColl.Add(s_netti);
            _SColl.Add(s_mura);
            _SColl.Add(s_Output);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);

            if (operazione == "update")
            {
                string s_StrSql = "PACK_BUILDINGS.SP_UPDATEPIANIBUILDING";
                return(result = _OraDl.GetRowsAffected(_SColl, s_StrSql));
            }

            if (operazione == "insert")
            {
                string s_StrSql = "PACK_BUILDINGS.SP_NEWPIANIBUILDING";
                result = _OraDl.GetRowsAffected(_SColl, s_StrSql);
                return(result);
            }

            if (operazione == "delete")
            {
                //string s_StrSql = "PACK_BUILDINGS.SP_NEWPIANIBUILDING";
                //return result = _OraDl.GetRowsAffected(_SColl, s_StrSql);
            }

            return(result);
        }
Exemple #5
0
        public DataSet GetSpecializzazionePMP(int PMP_id, int eqstd_id, int servizio_id)
        {
            DataSet _Ds;

            S_ControlsCollection CollezioneControlli = new S_ControlsCollection();

            //BL_ID Lo passo sempre vuoto
            S_Controls.Collections.S_Object s_BL_id = new S_Object();
            s_BL_id.ParameterName = "p_Bl_Id";
            s_BL_id.DbType        = CustomDBType.VarChar;
            s_BL_id.Value         = "";
            s_BL_id.Direction     = ParameterDirection.Input;
            s_BL_id.Index         = 0;
            s_BL_id.Size          = 20;

            CollezioneControlli.Add(s_BL_id);

            //Servizio ID
            S_Controls.Collections.S_Object s_Servizio_id = new S_Object();
            s_Servizio_id.ParameterName = "p_ID_Servizio";
            s_Servizio_id.DbType        = CustomDBType.Integer;
            s_Servizio_id.Value         = servizio_id;
            s_Servizio_id.Direction     = ParameterDirection.Input;
            s_Servizio_id.Index         = 1;

            CollezioneControlli.Add(s_Servizio_id);

            //Eqstd ID
            S_Controls.Collections.S_Object s_Eqstd_id = new S_Object();
            s_Eqstd_id.ParameterName = "p_eqstd_id";
            s_Eqstd_id.DbType        = CustomDBType.Integer;
            s_Eqstd_id.Value         = eqstd_id;
            s_Eqstd_id.Direction     = ParameterDirection.Input;
            s_Eqstd_id.Index         = 2;

            CollezioneControlli.Add(s_Eqstd_id);

            //Eq ID
            S_Controls.Collections.S_Object s_Eq_id = new S_Object();
            s_Eq_id.ParameterName = "p_eq_id";
            s_Eq_id.DbType        = CustomDBType.VarChar;
            s_Eq_id.Value         = "";
            s_Eq_id.Direction     = ParameterDirection.Input;
            s_Eq_id.Index         = 3;
            s_Eq_id.Size          = 50;

            CollezioneControlli.Add(s_Eq_id);

            S_Controls.Collections.S_Object s_PMP_id = new S_Object();
            s_PMP_id.ParameterName = "p_PMP_id";
            s_PMP_id.DbType        = CustomDBType.Integer;
            s_PMP_id.Value         = PMP_id;
            s_PMP_id.Direction     = ParameterDirection.Input;
            s_PMP_id.Index         = 4;

            CollezioneControlli.Add(s_PMP_id);

            S_Controls.Collections.S_Object s_UserName = new S_Object();
            s_UserName.ParameterName = "p_UserName";
            s_UserName.DbType        = CustomDBType.VarChar;
            s_UserName.Direction     = ParameterDirection.Input;
            s_UserName.Index         = 5;
            s_UserName.Size          = 50;
            s_UserName.Value         = System.Web.HttpContext.Current.User.Identity.Name;
            CollezioneControlli.Add(s_UserName);

            S_Controls.Collections.S_Object s_Cursor = new S_Object();
            s_Cursor.ParameterName = "IO_CURSOR";
            s_Cursor.DbType        = CustomDBType.Cursor;
            s_Cursor.Direction     = ParameterDirection.Output;
            s_Cursor.Index         = 6;

            CollezioneControlli.Add(s_Cursor);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);
            string s_StrSql = "PACK_ADDETTI.SP_GETSPECIALIZZAZIONI";

            _Ds = _OraDl.GetRows(CollezioneControlli, s_StrSql).Copy();

            return(_Ds);
        }
Exemple #6
0
        public DataSet GetReport(int TipoReport, int bl_id)
        {
            DataSet _Ds;

            S_ControlsCollection CollezioneControlli = new  S_ControlsCollection();

            if (TipoReport == 0)
            {
                S_Controls.Collections.S_Object p_blid = new S_Object();
                p_blid.ParameterName = "p_bl_Id";
                p_blid.DbType        = CustomDBType.Integer;
                p_blid.Direction     = ParameterDirection.Input;
                p_blid.Index         = CollezioneControlli.Count;
                p_blid.Value         = bl_id;
                CollezioneControlli.Add(p_blid);
            }
            if (TipoReport == 1 || TipoReport == 2 || TipoReport == 0)
            {
                S_Controls.Collections.S_Object s_UserName = new S_Object();
                s_UserName.ParameterName = "p_UserName";
                s_UserName.DbType        = CustomDBType.VarChar;
                s_UserName.Direction     = ParameterDirection.Input;
                s_UserName.Index         = CollezioneControlli.Count;
                s_UserName.Value         = this.s_username;
                s_UserName.Size          = 50;
                CollezioneControlli.Add(s_UserName);
            }

            S_Controls.Collections.S_Object s_Cursor = new S_Object();
            s_Cursor.ParameterName = "IO_CURSOR";
            s_Cursor.DbType        = CustomDBType.Cursor;
            s_Cursor.Direction     = ParameterDirection.Output;
            s_Cursor.Index         = CollezioneControlli.Count;
            CollezioneControlli.Add(s_Cursor);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);
            string s_StrSql = "";

            if (TipoReport == 0)
            {
                s_StrSql = "PACK_APPARECCHIATURE.SP_GETSTD1";
            }
            if (TipoReport == 1)
            {
                s_StrSql = "PACK_APPARECCHIATURE.SP_GETSTD2";
            }
            if (TipoReport == 2)
            {
                s_StrSql = "PACK_APPARECCHIATURE.SP_GETSTD3";
            }
            if (TipoReport == 3)
            {
                s_StrSql = "PACK_APPARECCHIATURE.SP_GETSTD4";
            }
            if (TipoReport == 4)
            {
                s_StrSql = "PACK_APPARECCHIATURE.SP_GETSTD5";
            }


            _Ds = _OraDl.GetRows(CollezioneControlli, s_StrSql).Copy();

            return(_Ds);
        }
Exemple #7
0
        /// <summary>
        /// Recupera le apparecchiature legate ad un edificio
        /// </summary>
        /// <param name="itemId">è il ID BL dell'edificio</param>
        /// <returns></returns>
        public DataSet GetApparecchiature(int itemId, int id_servizio, int id_piano, string s_stanza, int id_stapp, int id_codapp)
        {
            DataSet _Ds;
            S_ControlsCollection CollezioneControlli = new S_ControlsCollection();

            S_Controls.Collections.S_Object s_p_id = new S_Controls.Collections.S_Object();
            s_p_id.ParameterName = "p_id";
            s_p_id.DbType        = CustomDBType.Integer;
            s_p_id.Direction     = ParameterDirection.Input;
            s_p_id.Index         = CollezioneControlli.Count + 1;
            s_p_id.Value         = itemId;
            CollezioneControlli.Add(s_p_id);

            S_Controls.Collections.S_Object s_p_id_servizio = new S_Controls.Collections.S_Object();
            s_p_id_servizio.ParameterName = "p_id_servizio";
            s_p_id_servizio.DbType        = CustomDBType.Integer;
            s_p_id_servizio.Direction     = ParameterDirection.Input;
            s_p_id_servizio.Index         = CollezioneControlli.Count + 1;
            s_p_id_servizio.Value         = id_servizio;
            CollezioneControlli.Add(s_p_id_servizio);

            S_Controls.Collections.S_Object s_p_id_piano = new S_Controls.Collections.S_Object();
            s_p_id_piano.ParameterName = "p_id_piano";
            s_p_id_piano.DbType        = CustomDBType.Integer;
            s_p_id_piano.Direction     = ParameterDirection.Input;
            s_p_id_piano.Index         = CollezioneControlli.Count + 1;
            s_p_id_piano.Value         = id_piano;
            CollezioneControlli.Add(s_p_id_piano);

            S_Controls.Collections.S_Object s_p_id_stanza = new S_Controls.Collections.S_Object();
            s_p_id_stanza.ParameterName = "p_id_stanza";
            s_p_id_stanza.DbType        = CustomDBType.VarChar;
            s_p_id_stanza.Direction     = ParameterDirection.Input;
            s_p_id_stanza.Index         = CollezioneControlli.Count + 1;
            s_p_id_stanza.Size          = 25;
            if (s_stanza == "")
            {
                s_p_id_stanza.Value = "-1";
            }
            else
            {
                s_p_id_stanza.Value = s_stanza;
            }
            CollezioneControlli.Add(s_p_id_stanza);

            S_Controls.Collections.S_Object s_p_id_stapp = new S_Controls.Collections.S_Object();
            s_p_id_stapp.ParameterName = "p_id_stappar";
            s_p_id_stapp.DbType        = CustomDBType.Integer;
            s_p_id_stapp.Direction     = ParameterDirection.Input;
            s_p_id_stapp.Index         = CollezioneControlli.Count + 1;
            s_p_id_stapp.Value         = id_stapp;
            CollezioneControlli.Add(s_p_id_stapp);

            S_Controls.Collections.S_Object s_p_id_codapp = new S_Controls.Collections.S_Object();
            s_p_id_codapp.ParameterName = "p_id_codapp";
            s_p_id_codapp.DbType        = CustomDBType.Integer;
            s_p_id_codapp.Direction     = ParameterDirection.Input;
            s_p_id_codapp.Index         = CollezioneControlli.Count + 1;
            s_p_id_codapp.Value         = id_codapp;
            CollezioneControlli.Add(s_p_id_codapp);


            S_Controls.Collections.S_Object s_Cursor = new S_Object();
            s_Cursor.ParameterName = "IO_CURSOR";
            s_Cursor.DbType        = CustomDBType.Cursor;
            s_Cursor.Direction     = ParameterDirection.Output;
            s_Cursor.Index         = CollezioneControlli.Count + 1;

            CollezioneControlli.Add(s_Cursor);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);
            string s_StrSql = "PACK_DATITECNICIAPP.SP_GETAPPARECCHIATURE";

//			string s_StrSql = "PACK_DATITECNICI_M.SP_GETAPPARECCHIATURE";
            _Ds = _OraDl.GetRows(CollezioneControlli, s_StrSql).Copy();

            return(_Ds);
        }
Exemple #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public string[] GetRuoli(string UserName)
        {
            // crea un String array da stored data
            ArrayList a_userRoles = new ArrayList();

            S_ControlsCollection _SColl = new S_ControlsCollection();

            S_Controls.Collections.S_Object s_UserId = new S_Object();
            s_UserId.ParameterName = "p_utente_id";
            s_UserId.DbType        = CustomDBType.Integer;
            s_UserId.Direction     = ParameterDirection.Input;
            s_UserId.Value         = 0;
            s_UserId.Index         = 0;

            S_Controls.Collections.S_Object s_UserName = new S_Object();
            s_UserName.ParameterName = "p_UserName";
            s_UserName.DbType        = CustomDBType.VarChar;
            s_UserName.Direction     = ParameterDirection.Input;
            s_UserName.Value         = UserName;
            s_UserName.Index         = 1;

            S_Controls.Collections.S_Object s_Cursor = new S_Object();
            s_Cursor.ParameterName = "IO_CURSOR";
            s_Cursor.DbType        = CustomDBType.Cursor;
            s_Cursor.Direction     = ParameterDirection.Output;
            s_Cursor.Index         = 2;

            _SColl.Add(s_UserId);
            _SColl.Add(s_UserName);
            _SColl.Add(s_Cursor);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);

            DataSet _MyDs = _OraDl.GetRows(_SColl, "PACK_UTENTI.SP_RUOLI_UTENTI").Copy();

            if (_MyDs.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow _Dr in _MyDs.Tables[0].Rows)
                {
                    a_userRoles.Add(_Dr["DESCRIZIONE"].ToString());
                }
            }
            if (_MyDs.Tables[0].Rows.Count > 0)
            {
                bool flag_callcenter = false;
                foreach (DataRow _Dr in _MyDs.Tables[0].Rows)
                {
                    if (_Dr["DESCRIZIONE"].ToString().ToUpper() == "CALLCENTER" || _Dr["DESCRIZIONE"].ToString().ToUpper() == "ADMINISTRATOR")
                    {
                        flag_callcenter = true;
                    }
                }
                if (flag_callcenter == false)
                {
                    DataRow Riga = _MyDs.Tables[0].Rows[0];
                    if (Riga["ID_PROGETTO"].ToString() == "1")
                    {
                        a_userRoles.Add("MA");
                    }
                    if (Riga["ID_PROGETTO"].ToString() == "2")
                    {
                        a_userRoles.Add("PA");
                    }
                }
            }


            return((String[])a_userRoles.ToArray(typeof(String)));
        }
Exemple #9
0
        public int EmettiRdl(ParamRichiesta parametri)
        {
            S_ControlsCollection _SColl = new S_ControlsCollection();

            // WR_ID
            S_Controls.Collections.S_Object s_IdWR = new S_Object();
            s_IdWR.ParameterName = "p_Wr_Id";
            s_IdWR.DbType        = CustomDBType.Integer;
            s_IdWR.Direction     = ParameterDirection.Input;
            s_IdWR.Index         = 0;
            s_IdWR.Value         = parametri.wr_id;

            // STATUS_ID
            S_Controls.Collections.S_Object s_IdStatus = new S_Object();
            s_IdStatus.ParameterName = "p_stato";
            s_IdStatus.DbType        = CustomDBType.Integer;
            s_IdStatus.Direction     = ParameterDirection.Input;
            s_IdStatus.Index         = 1;
            s_IdStatus.Value         = (int)parametri.status_id;

            // UTENTE

            S_Controls.Collections.S_Object s_CurrentUser = new S_Object();
            s_CurrentUser.ParameterName = "p_CurrentUser";
            s_CurrentUser.DbType        = CustomDBType.VarChar;
            s_CurrentUser.Direction     = ParameterDirection.Input;
            s_CurrentUser.Index         = 2;
            s_CurrentUser.Value         = parametri.utente;

            // URGENZA

            S_Controls.Collections.S_Object s_Urgenza = new S_Object();
            s_Urgenza.ParameterName = "p_urgenza";
            s_Urgenza.DbType        = CustomDBType.Integer;
            s_Urgenza.Direction     = ParameterDirection.Input;
            s_Urgenza.Index         = 3;
            s_Urgenza.Value         = parametri.urgenza_id;

            // RICHIEDENTE

            S_Controls.Collections.S_Object s_Richiedente = new S_Object();
            s_Richiedente.ParameterName = "p_richiedente";
            s_Richiedente.DbType        = CustomDBType.VarChar;
            s_Richiedente.Direction     = ParameterDirection.Input;
            s_Richiedente.Index         = 4;
            s_Richiedente.Value         = parametri.richiedente;

            // DESCRIZIONE

            S_Controls.Collections.S_Object s_Descrizione = new S_Object();
            s_Descrizione.ParameterName = "p_descrizione";
            s_Descrizione.DbType        = CustomDBType.VarChar;
            s_Descrizione.Direction     = ParameterDirection.Input;
            s_Descrizione.Index         = 5;
            s_Descrizione.Size          = 4000;
            s_Descrizione.Value         = parametri.descrizione;

            // DATAPIANIFICATA

            S_Controls.Collections.S_Object s_DataP = new S_Object();
            s_DataP.ParameterName = "p_datapianificata";
            s_DataP.DbType        = CustomDBType.VarChar;
            s_DataP.Direction     = ParameterDirection.Input;
            s_DataP.Index         = 6;
            s_DataP.Size          = 30;
            s_DataP.Value         = parametri.data_pianificata;

            // SERVIZIO

            S_Controls.Collections.S_Object s_Servizio = new S_Object();
            s_Servizio.ParameterName = "p_servizio_id";
            s_Servizio.DbType        = CustomDBType.Integer;
            s_Servizio.Direction     = ParameterDirection.Input;
            s_Servizio.Index         = 7;
            s_Servizio.Value         = parametri.servizio_id;

            // TRASMISSIONE

            S_Controls.Collections.S_Object s_Trasmissione = new S_Object();
            s_Trasmissione.ParameterName = "p_trasmissione_id";
            s_Trasmissione.DbType        = CustomDBType.Integer;
            s_Trasmissione.Direction     = ParameterDirection.Input;
            s_Trasmissione.Index         = 8;
            s_Trasmissione.Value         = parametri.trasmissione_id;

            // MANUTENZIONE

            S_Controls.Collections.S_Object s_Manutenzione = new S_Object();
            s_Manutenzione.ParameterName = "p_manutenzione_id";
            s_Manutenzione.DbType        = CustomDBType.Integer;
            s_Manutenzione.Direction     = ParameterDirection.Input;
            s_Manutenzione.Index         = 9;
            s_Manutenzione.Value         = parametri.tipo_mautenzione_id;

            // BL_ID

            S_Controls.Collections.S_Object s_BL = new S_Object();
            s_BL.ParameterName = "p_bl_id";
            s_BL.DbType        = CustomDBType.Integer;
            s_BL.Direction     = ParameterDirection.Input;
            s_BL.Index         = 10;
            s_BL.Value         = parametri.bl_id;

            // ADDETTO_ID

            S_Controls.Collections.S_Object s_Addetto = new S_Object();
            s_Addetto.ParameterName = "p_addetto_id";
            s_Addetto.DbType        = CustomDBType.Integer;
            s_Addetto.Direction     = ParameterDirection.Input;
            s_Addetto.Index         = 11;
            s_Addetto.Value         = parametri.addetto_id;

            // ID_DITTA
            S_Controls.Collections.S_Object p_id_ditta = new S_Object();
            p_id_ditta.ParameterName = "p_id_ditta";
            p_id_ditta.DbType        = CustomDBType.Integer;
            p_id_ditta.Direction     = ParameterDirection.Input;
            p_id_ditta.Index         = 12;
            p_id_ditta.Value         = parametri.id_ditta;

            // STD APPARECCHIATURA
            S_Controls.Collections.S_Object p_stdApparecchiatura_id = new S_Object();
            p_stdApparecchiatura_id.ParameterName = "p_stdApparecchiatura_id";
            p_stdApparecchiatura_id.DbType        = CustomDBType.Integer;
            p_stdApparecchiatura_id.Direction     = ParameterDirection.Input;
            p_stdApparecchiatura_id.Index         = 13;
            p_stdApparecchiatura_id.Value         = parametri.stdApparecchiatura_id;

            // APPARECCHIATURA
            S_Controls.Collections.S_Object p_eq_id = new S_Object();
            p_eq_id.ParameterName = "p_eq_id";
            p_eq_id.DbType        = CustomDBType.Integer;
            p_eq_id.Direction     = ParameterDirection.Input;
            p_eq_id.Index         = 14;
            p_eq_id.Value         = parametri.eq_id;

            //TODO: nuovi parametri
//          p_tipointervento in number,
//          p_numeropreventivo in varchar2,
//          p_importopreventivo in number,
//          p_pdfpreventivo in varchar2,

            //Tipo intervento ATER
            S_Controls.Collections.S_Object p_tipointervento = new S_Object();
            p_tipointervento.ParameterName = "p_tipointervento";
            p_tipointervento.DbType        = CustomDBType.Integer;
            p_tipointervento.Direction     = ParameterDirection.Input;
            p_tipointervento.Index         = 15;
            p_tipointervento.Value         = parametri.tipoInterventoAter;

            //Numero preventivo
            S_Controls.Collections.S_Object p_numeropreventivo = new S_Object();
            p_numeropreventivo.ParameterName = "p_numeropreventivo";
            p_numeropreventivo.DbType        = CustomDBType.VarChar;
            p_numeropreventivo.Direction     = ParameterDirection.Input;
            p_numeropreventivo.Index         = 16;
            p_numeropreventivo.Size          = 8;
            p_numeropreventivo.Value         = parametri.numero_preventivo;

            //importo preventivo
            S_Controls.Collections.S_Object p_importopreventivo = new S_Object();
            p_importopreventivo.ParameterName = "p_importopreventivo";
            p_importopreventivo.DbType        = CustomDBType.Double;
            p_importopreventivo.Direction     = ParameterDirection.Input;
            p_importopreventivo.Index         = 17;
            p_importopreventivo.Value         = double.Parse(parametri.importo_preventivo);

            //Nome del file pdf
            S_Controls.Collections.S_Object p_pdfpreventivo = new S_Object();
            p_pdfpreventivo.ParameterName = "p_pdfpreventivo";
            p_pdfpreventivo.DbType        = CustomDBType.VarChar;
            p_pdfpreventivo.Direction     = ParameterDirection.Input;
            p_pdfpreventivo.Index         = 18;
            p_pdfpreventivo.Size          = 250;
            p_pdfpreventivo.Value         = parametri.PdfPreventivo;

            // OUT
            S_Controls.Collections.S_Object s_IdOut = new S_Object();
            s_IdOut.ParameterName = "p_IdOut";
            s_IdOut.DbType        = CustomDBType.Integer;
            s_IdOut.Direction     = ParameterDirection.Output;
            s_IdOut.Index         = 19;

            _SColl.Add(s_IdWR);
            _SColl.Add(s_IdStatus);
            _SColl.Add(s_CurrentUser);
            _SColl.Add(s_Urgenza);
            _SColl.Add(s_Richiedente);
            _SColl.Add(s_Descrizione);
            _SColl.Add(s_DataP);
            _SColl.Add(s_Servizio);
            _SColl.Add(s_Trasmissione);
            _SColl.Add(s_Manutenzione);
            _SColl.Add(s_BL);
            _SColl.Add(s_Addetto);
            _SColl.Add(p_id_ditta);
            _SColl.Add(p_stdApparecchiatura_id);
            _SColl.Add(p_eq_id);

            _SColl.Add(p_tipointervento);
            _SColl.Add(p_numeropreventivo);
            _SColl.Add(p_importopreventivo);
            _SColl.Add(p_pdfpreventivo);

            _SColl.Add(s_IdOut);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);

            int i_Result = 0;

            switch (parametri.status_id)
            {
            case Classi.StateType.EmessaInLavorazione:
                i_Result = _OraDl.GetRowsAffected(_SColl, "PACK_EMETTI_RDL_STR.SP_EMETTI");
                break;

            case Classi.StateType.RichiestaRifiutata:
                i_Result = _OraDl.GetRowsAffected(_SColl, "PACK_EMETTI_RDL_STR.SP_RIFIUTA");
                break;

            case Classi.StateType.RichiestaSospesa:
                i_Result = _OraDl.GetRowsAffected(_SColl, "PACK_EMETTI_RDL_STR.SP_SOSPENDI");
                break;
            }

            return(i_Result);
        }
Exemple #10
0
        public int EmettiRdl(int wr_id, Classi.StateType status_id, string utente, int urgenza_id, string richiedente, string descrizione, string data_pianificata, int servizio_id, int stdApparecchiatura_id, int eq_id, int trasmissione_id, int tipo_mautenzione_id, int bl_id, int addetto_id, int id_ditta)
        {
            S_ControlsCollection _SColl = new S_ControlsCollection();

            // WR_ID
            S_Controls.Collections.S_Object s_IdWR = new S_Object();
            s_IdWR.ParameterName = "p_Wr_Id";
            s_IdWR.DbType        = CustomDBType.Integer;
            s_IdWR.Direction     = ParameterDirection.Input;
            s_IdWR.Index         = 0;
            s_IdWR.Value         = wr_id;

            // STATUS_ID
            S_Controls.Collections.S_Object s_IdStatus = new S_Object();
            s_IdStatus.ParameterName = "p_stato";
            s_IdStatus.DbType        = CustomDBType.Integer;
            s_IdStatus.Direction     = ParameterDirection.Input;
            s_IdStatus.Index         = 1;
            s_IdStatus.Value         = (int)status_id;

            // UTENTE

            S_Controls.Collections.S_Object s_CurrentUser = new S_Object();
            s_CurrentUser.ParameterName = "p_CurrentUser";
            s_CurrentUser.DbType        = CustomDBType.VarChar;
            s_CurrentUser.Direction     = ParameterDirection.Input;
            s_CurrentUser.Index         = 2;
            s_CurrentUser.Value         = utente;

            // URGENZA

            S_Controls.Collections.S_Object s_Urgenza = new S_Object();
            s_Urgenza.ParameterName = "p_urgenza";
            s_Urgenza.DbType        = CustomDBType.Integer;
            s_Urgenza.Direction     = ParameterDirection.Input;
            s_Urgenza.Index         = 3;
            s_Urgenza.Value         = urgenza_id;

            // RICHIEDENTE

            S_Controls.Collections.S_Object s_Richiedente = new S_Object();
            s_Richiedente.ParameterName = "p_richiedente";
            s_Richiedente.DbType        = CustomDBType.VarChar;
            s_Richiedente.Direction     = ParameterDirection.Input;
            s_Richiedente.Index         = 4;
            s_Richiedente.Value         = richiedente;

            // DESCRIZIONE

            S_Controls.Collections.S_Object s_Descrizione = new S_Object();
            s_Descrizione.ParameterName = "p_descrizione";
            s_Descrizione.DbType        = CustomDBType.VarChar;
            s_Descrizione.Direction     = ParameterDirection.Input;
            s_Descrizione.Index         = 5;
            s_Descrizione.Size          = 4000;
            s_Descrizione.Value         = descrizione;

            // DATAPIANIFICATA

            S_Controls.Collections.S_Object s_DataP = new S_Object();
            s_DataP.ParameterName = "p_datapianificata";
            s_DataP.DbType        = CustomDBType.VarChar;
            s_DataP.Direction     = ParameterDirection.Input;
            s_DataP.Index         = 6;
            s_DataP.Size          = 30;
            s_DataP.Value         = data_pianificata;

            // SERVIZIO

            S_Controls.Collections.S_Object s_Servizio = new S_Object();
            s_Servizio.ParameterName = "p_servizio_id";
            s_Servizio.DbType        = CustomDBType.Integer;
            s_Servizio.Direction     = ParameterDirection.Input;
            s_Servizio.Index         = 7;
            s_Servizio.Value         = servizio_id;

            // TRASMISSIONE

            S_Controls.Collections.S_Object s_Trasmissione = new S_Object();
            s_Trasmissione.ParameterName = "p_trasmissione_id";
            s_Trasmissione.DbType        = CustomDBType.Integer;
            s_Trasmissione.Direction     = ParameterDirection.Input;
            s_Trasmissione.Index         = 8;
            s_Trasmissione.Value         = trasmissione_id;

            // MANUTENZIONE

            S_Controls.Collections.S_Object s_Manutenzione = new S_Object();
            s_Manutenzione.ParameterName = "p_manutenzione_id";
            s_Manutenzione.DbType        = CustomDBType.Integer;
            s_Manutenzione.Direction     = ParameterDirection.Input;
            s_Manutenzione.Index         = 9;
            s_Manutenzione.Value         = tipo_mautenzione_id;

            // BL_ID

            S_Controls.Collections.S_Object s_BL = new S_Object();
            s_BL.ParameterName = "p_bl_id";
            s_BL.DbType        = CustomDBType.Integer;
            s_BL.Direction     = ParameterDirection.Input;
            s_BL.Index         = 10;
            s_BL.Value         = bl_id;

            // ADDETTO_ID

            S_Controls.Collections.S_Object s_Addetto = new S_Object();
            s_Addetto.ParameterName = "p_addetto_id";
            s_Addetto.DbType        = CustomDBType.Integer;
            s_Addetto.Direction     = ParameterDirection.Input;
            s_Addetto.Index         = 11;
            s_Addetto.Value         = addetto_id;

            // ID_DITTA
            S_Controls.Collections.S_Object p_id_ditta = new S_Object();
            p_id_ditta.ParameterName = "p_id_ditta";
            p_id_ditta.DbType        = CustomDBType.Integer;
            p_id_ditta.Direction     = ParameterDirection.Input;
            p_id_ditta.Index         = 12;
            p_id_ditta.Value         = id_ditta;

            // STD APPARECCHIATURA
            S_Controls.Collections.S_Object p_stdApparecchiatura_id = new S_Object();
            p_stdApparecchiatura_id.ParameterName = "p_stdApparecchiatura_id";
            p_stdApparecchiatura_id.DbType        = CustomDBType.Integer;
            p_stdApparecchiatura_id.Direction     = ParameterDirection.Input;
            p_stdApparecchiatura_id.Index         = 13;
            p_stdApparecchiatura_id.Value         = stdApparecchiatura_id;

            // APPARECCHIATURA
            S_Controls.Collections.S_Object p_eq_id = new S_Object();
            p_eq_id.ParameterName = "p_eq_id";
            p_eq_id.DbType        = CustomDBType.Integer;
            p_eq_id.Direction     = ParameterDirection.Input;
            p_eq_id.Index         = 14;
            p_eq_id.Value         = eq_id;

            // OUT

            S_Controls.Collections.S_Object s_IdOut = new S_Object();
            s_IdOut.ParameterName = "p_IdOut";
            s_IdOut.DbType        = CustomDBType.Integer;
            s_IdOut.Direction     = ParameterDirection.Output;
            s_IdOut.Index         = 15;

            _SColl.Add(s_IdWR);
            _SColl.Add(s_IdStatus);
            _SColl.Add(s_CurrentUser);
            _SColl.Add(s_Urgenza);
            _SColl.Add(s_Richiedente);
            _SColl.Add(s_Descrizione);
            _SColl.Add(s_DataP);
            _SColl.Add(s_Servizio);
            _SColl.Add(s_Trasmissione);
            _SColl.Add(s_Manutenzione);
            _SColl.Add(s_BL);
            _SColl.Add(s_Addetto);
            _SColl.Add(p_id_ditta);
            _SColl.Add(p_stdApparecchiatura_id);
            _SColl.Add(p_eq_id);
            _SColl.Add(s_IdOut);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);

            int i_Result = 0;

            switch (status_id)
            {
            case Classi.StateType.EmessaInLavorazione:
                i_Result = _OraDl.GetRowsAffected(_SColl, "PACK_EMETTI_RDL.SP_EMETTI");
                break;

            case Classi.StateType.RichiestaRifiutata:
                i_Result = _OraDl.GetRowsAffected(_SColl, "PACK_EMETTI_RDL.SP_RIFIUTA");
                break;

            case Classi.StateType.RichiestaSospesa:
                i_Result = _OraDl.GetRowsAffected(_SColl, "PACK_EMETTI_RDL.SP_SOSPENDI");
                break;
            }

            return(i_Result);
        }
Exemple #11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="CollezioneControlli"></param>
        /// <returns></returns>

        public int UpdateInsertManutenzioneFondo(int fondo, ArrayList TipoIntevento, S_Controls.Collections.S_ControlsCollection Ctrl)
        {
            int i_Result = 0;
            S_ControlsCollection CollezioneControlli = new S_ControlsCollection();

            S_Controls.Collections.S_Object p = new S_Object();
            p.ParameterName = "p_id";
            p.DbType        = CustomDBType.Integer;
            p.Direction     = ParameterDirection.Input;
            p.Index         = CollezioneControlli.Count;
            p.Value         = fondo;
            CollezioneControlli.Add(p);

            p = new S_Object();
            p.ParameterName = "p_Operazione";
            p.DbType        = CustomDBType.VarChar;
            p.Direction     = ParameterDirection.Input;
            p.Index         = CollezioneControlli.Count;
            p.Value         = "delete";
            p.Size          = 50;
            CollezioneControlli.Add(p);


            p = new S_Object();
            p.ParameterName = "p_IdOut";
            p.DbType        = CustomDBType.Integer;
            p.Direction     = ParameterDirection.Output;
            p.Index         = CollezioneControlli.Count;
            CollezioneControlli.Add(p);

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);
            try
            {
                i_Result = _OraDl.GetRowsAffected(CollezioneControlli, "PACK_MS.SP_EXECUTEFONDI_INTERVENTO");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            foreach (string inter in TipoIntevento)
            {
                CollezioneControlli.Clear();


                p = new S_Object();
                p.ParameterName = "p_id";
                p.DbType        = CustomDBType.Integer;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                p.Value         = fondo;
                CollezioneControlli.Add(p);

                p = new S_Object();
                p.ParameterName = "p_tipointervento";
                p.DbType        = CustomDBType.Integer;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                p.Value         = int.Parse(inter);
                CollezioneControlli.Add(p);

                p = new S_Object();
                p.ParameterName = "p_Operazione";
                p.DbType        = CustomDBType.VarChar;
                p.Direction     = ParameterDirection.Input;
                p.Index         = CollezioneControlli.Count;
                p.Size          = 50;
                p.Value         = "insert";
                CollezioneControlli.Add(p);

                p = new S_Object();
                p.ParameterName = "p_IdOut";
                p.DbType        = CustomDBType.Integer;
                p.Direction     = ParameterDirection.Output;
                p.Index         = CollezioneControlli.Count;
                CollezioneControlli.Add(p);

                i_Result = _OraDl.GetRowsAffected(CollezioneControlli, "PACK_MS.SP_EXECUTEFONDI_INTERVENTO");
            }

            return(i_Result);
        }
Exemple #12
0
        protected override int ExecuteUpdate(S_ControlsCollection CollezioneControlli, ExecuteType Operazione, int itemId)
        {
            int i_MaxParametri = CollezioneControlli.Count + 1;

            ApplicationDataLayer.OracleDataLayer _OraDl = new OracleDataLayer(s_ConnStr);
            int i_Result = 0;

            S_Controls.Collections.S_Object s_IdIn        = new S_Object();
            S_Controls.Collections.S_Object s_CurrentUser = new S_Object();
            S_Controls.Collections.S_Object s_IdOut       = new S_Object();
            switch (Operazione.ToString().ToUpper())
            {
            case "UPDATE":
                s_IdIn.ParameterName = "pId";
                s_IdIn.DbType        = CustomDBType.Integer;
                s_IdIn.Direction     = ParameterDirection.Input;
                s_IdIn.Index         = i_MaxParametri;
                s_IdIn.Value         = itemId;
                CollezioneControlli.Add(s_IdIn);

                s_CurrentUser.ParameterName = "pcurrentuser";
                s_CurrentUser.DbType        = CustomDBType.VarChar;
                s_CurrentUser.Direction     = ParameterDirection.Input;
                s_CurrentUser.Index         = i_MaxParametri;
                s_CurrentUser.Value         = System.Web.HttpContext.Current.User.Identity.Name;
                i_MaxParametri++;
                CollezioneControlli.Add(s_CurrentUser);


                s_IdOut.ParameterName = "pOut";
                s_IdOut.DbType        = CustomDBType.Integer;
                s_IdOut.Direction     = ParameterDirection.Output;
                s_IdOut.Index         = i_MaxParametri;
                CollezioneControlli.Add(s_IdOut);
                i_Result = _OraDl.GetRowsAffected(CollezioneControlli, "pack_enti.UpdateEnti");
                break;

            case "DELETE":

                s_IdIn.ParameterName = "pId";
                s_IdIn.DbType        = CustomDBType.Integer;
                s_IdIn.Direction     = ParameterDirection.Input;
                s_IdIn.Index         = i_MaxParametri;
                s_IdIn.Value         = itemId;
                CollezioneControlli.Add(s_IdIn);

                s_IdOut.ParameterName = "pOut";
                s_IdOut.DbType        = CustomDBType.Integer;
                s_IdOut.Direction     = ParameterDirection.Output;
                s_IdOut.Index         = i_MaxParametri;
                CollezioneControlli.Add(s_IdOut);
                i_Result = _OraDl.GetRowsAffected(CollezioneControlli, "pack_enti.DeleteEnti");
                break;

            case "INSERT":

                s_CurrentUser.ParameterName = "pcurrentuser";
                s_CurrentUser.DbType        = CustomDBType.VarChar;
                s_CurrentUser.Direction     = ParameterDirection.Input;
                s_CurrentUser.Index         = i_MaxParametri;
                s_CurrentUser.Value         = System.Web.HttpContext.Current.User.Identity.Name;
                i_MaxParametri++;
                CollezioneControlli.Add(s_CurrentUser);


                s_IdOut.ParameterName = "pOut";
                s_IdOut.DbType        = CustomDBType.Integer;
                s_IdOut.Direction     = ParameterDirection.Output;
                s_IdOut.Index         = i_MaxParametri;
                CollezioneControlli.Add(s_IdOut);
                i_Result = _OraDl.GetRowsAffected(CollezioneControlli, "pack_enti.InsertEnti");
                break;
            }
            return(i_Result);
        }
Exemple #13
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");
        }
Exemple #14
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");
        }
Exemple #15
0
        private void InsertUpdateSchema(string titolo, string descrizione, bool salva)
        {
            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;
            if (salva)
            {
                pIdSchema.Value = IdQuery;
            }
            else
            {
                pIdSchema.Value = 0;
            }
            pIdSchema.Index = 0;
            param.Add(pIdSchema);


            S_Object pDenominazione;

            pDenominazione = new S_Object();
            pDenominazione.ParameterName = "pDenominazione";
            pDenominazione.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pDenominazione.Direction     = ParameterDirection.Input;
            pDenominazione.Size          = 100;
            pDenominazione.Index         = 1;
            if (salva)
            {
                pDenominazione.Value = titolo;
            }
            else
            if (txtHTitolo.Value == titolo)                  // Se sto copiando controllo se è stato cambiato il titolo
            {
                pDenominazione.Value = " copia di " + titolo;
            }
            else
            {
                pDenominazione.Value = titolo;
            }

            param.Add(pDenominazione);

            S_Object pDescrizione;

            pDescrizione = new S_Object();
            pDescrizione.ParameterName = "pDescrizione";
            pDescrizione.DbType        = ApplicationDataLayer.DBType.CustomDBType.VarChar;
            pDescrizione.Direction     = ParameterDirection.Input;
            pDescrizione.Value         = descrizione;
            pDescrizione.Size          = 1000;
            pDescrizione.Index         = 2;
            param.Add(pDescrizione);



            Hashtable _HS      = (Hashtable)Session["ParametriSelectSchema"];
            int       IdVista  = Convert.ToInt32(_HS["IdVista"]);
            S_Object  pIdVista = new S_Object();

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

            S_Controls.Collections.S_Object s_IdIn = new S_Object();
            s_IdIn.ParameterName = "putente";
            s_IdIn.DbType        = CustomDBType.VarChar;
            s_IdIn.Direction     = ParameterDirection.Input;
            s_IdIn.Index         = 4;
            s_IdIn.Value         = System.Web.HttpContext.Current.User.Identity.Name;
            param.Add(s_IdIn);

            S_Object pId;

            pId = new S_Object();
            pId.ParameterName = "pId";
            pId.DbType        = CustomDBType.Integer;
            pId.Direction     = ParameterDirection.Output;
            pId.Size          = 32;
            pId.Index         = 5;
            param.Add(pId);

            //_OraDl.ExecuteProcedure(param,"IL_PACK_INTERROGAZIONI.IL_SpInsertUpdateSchema");
            int i_Result = _OraDl.GetRowsAffected(param, "IL_PACK_INTERROGAZIONI.IL_SpInsertUpdateSchema");

            IdQuery = i_Result;

            NewIdQuery = i_Result;            //Convert.ToInt32(pId.Value);
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            ApplicationDataLayer.OracleDataLayer _OraDl;
            string s_ConnStr = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];

            _OraDl = new OracleDataLayer(s_ConnStr);

            //Istanzio la classe
            _ClManCorrettiva = new TheSite.Classi.ManCorrettiva.ClManCorrettiva(Context.User.Identity.Name);

            FunId = Int32.Parse(Request.Params["FunId"]);

            if (Request.QueryString["chiamante"] == "Materiali")
            {
                btnModificaRDL.Visible  = false;
                btnsNuova.Visible       = false;
                cmdApprova.Visible      = false;
                PageTitle1.VisibleLogut = false;
            }
            if (Request.Params["ItemId"] != null)
            {
                itemId           = Int32.Parse(Request.Params["ItemId"]);
                PageTitle1.Title = "Richiesta di Lavoro N° " + itemId;
                txtWrHidden.Text = itemId.ToString();


                Classi.ManOrdinaria.Richiesta _Richiesta = new TheSite.Classi.ManOrdinaria.Richiesta();

                DataSet _MyDs = _Richiesta.GetSingleData(itemId).Copy();
                if (_MyDs.Tables[0].Rows.Count == 1)
                {
                    DataRow  _Dr             = _MyDs.Tables[0].Rows[0];
                    DateTime d_DateRequested = (DateTime)_Dr["DATE_REQUESTED"];
                    this.lblData.Text = d_DateRequested.ToShortDateString();
                    DateTime d_TimeRequested = (DateTime)_Dr["TIME_REQUESTED"];
                    this.lblOra.Text            = d_TimeRequested.ToShortTimeString();
                    this.lblCodiceEdificio.Text = _Dr["BL_ID"].ToString();



                    if (_Dr["nr_crm"] != DBNull.Value)
                    {
                        this.Lblnr_crm.Text = _Dr["nr_crm"].ToString();
                    }

                    if (_Dr["id_bl"] != DBNull.Value)
                    {
                        this.id_bl = Convert.ToInt32(_Dr["id_bl"].ToString());
                    }

                    if (_Dr["id_progetto"] != DBNull.Value)
                    {
                        this.hidprog.Value = _Dr["id_progetto"].ToString();
                    }

                    if (_Dr["DENOMINAZIONE"] != DBNull.Value)
                    {
                        this.lblDenominazione.Text = _Dr["DENOMINAZIONE"].ToString();
                    }
                    if (_Dr["PIANO"] != DBNull.Value)
                    {
                        this.lblpianoed.Text = _Dr["PIANO"].ToString();
                    }
                    if (_Dr["STANZA"] != DBNull.Value)
                    {
                        this.lblstanzaed.Text = _Dr["STANZA"].ToString();
                    }

                    if (_Dr["INDIRIZZO"] != DBNull.Value)
                    {
                        this.lblIndirizzo.Text = _Dr["INDIRIZZO"].ToString();
                    }
                    if (_Dr["COMUNE"] != DBNull.Value)
                    {
                        this.lblComune.Text = _Dr["COMUNE"].ToString();
                    }
                    if (_Dr["descrizione_ditta"] != DBNull.Value)
                    {
                        this.lblDitta.Text = _Dr["descrizione_ditta"].ToString();
                    }
                    if (_Dr["TELEFONO_DITTA"] != DBNull.Value)
                    {
                        this.lblTelefonoDitta.Text = _Dr["TELEFONO_DITTA"].ToString();
                    }

                    if (_Dr["USERNAME"] != DBNull.Value)
                    {
                        this.lblOperatore.Text = _Dr["USERNAME"].ToString();
                    }
                    if (_Dr["REQUESTOR"] != DBNull.Value)
                    {
                        this.lblRichiedente.Text = _Dr["REQUESTOR"].ToString();
                    }

                    if (_Dr["telefonoric"] != DBNull.Value)
                    {
                        this.lblteleric.Text = _Dr["telefonoric"].ToString();
                    }
                    if (_Dr["emailric"] != DBNull.Value)
                    {
                        this.lblemailric.Text = _Dr["emailric"].ToString();
                    }
                    if (_Dr["stanzaric"] != DBNull.Value)
                    {
                        this.lblstanzaric.Text = _Dr["stanzaric"].ToString();
                    }

                    if (_Dr["PHONE"] != DBNull.Value)
                    {
                        this.lblTelefono.Text = _Dr["PHONE"].ToString();
                    }
                    if (_Dr["DESCRIZIONERICHIEDENTI"] != DBNull.Value)
                    {
                        this.lblGruppo.Text = _Dr["DESCRIZIONERICHIEDENTI"].ToString();
                    }

                    string s_Nota = string.Empty;
                    if (_Dr["NOTA_RIC"] != DBNull.Value)
                    {
                        s_Nota = _Dr["NOTA_RIC"].ToString();
                    }

                    this.lblNota.Text = s_Nota.Replace("\n", "<br>");

                    string s_Descrizione = string.Empty;
                    if (_Dr["DESCRIPTION"] != DBNull.Value)
                    {
                        s_Descrizione = _Dr["DESCRIPTION"].ToString();
                    }

                    this.lblDescrizione.Text = s_Descrizione.Replace("\n", "<br>");

                    if (_Dr["PRIORITY"] != DBNull.Value)
                    {
                        this.lblUrgenza.Text = _Dr["PRIORITY"].ToString();
                    }
                    if (_Dr["DESCRIZIONESERVIZI"] != DBNull.Value)
                    {
                        this.lblServizio.Text = _Dr["DESCRIZIONESERVIZI"].ToString();
                    }

                    string s_Eqstd = string.Empty;
                    if (_Dr["EQ_STD"] != DBNull.Value)
                    {
                        s_Eqstd = _Dr["EQ_STD"].ToString();
                    }
                    if (_Dr["DESCRIZIONEEQSTD"] != DBNull.Value)
                    {
                        s_Eqstd += " " + _Dr["DESCRIZIONEEQSTD"].ToString();
                    }
                    this.lblEqStd.Text = s_Eqstd;

                    if (_Dr["EQ_ID"] != DBNull.Value)
                    {
                        this.lblEqId.Text = _Dr["EQ_ID"].ToString();
                    }

                    //aggiunta SGA
                    if (_Dr["sga_anomalia"] != DBNull.Value)
                    {
                        this.LblAnomalia.Text = _Dr["sga_anomalia"].ToString();
                    }

                    if (_Dr["sga_effetto"] != DBNull.Value)
                    {
                        this.LblEffetto.Text = _Dr["sga_effetto"].ToString();
                    }

                    if (_Dr["conduzione"] != DBNull.Value)
                    {
                        ChkConduzione.Checked = (_Dr["conduzione"].ToString() == "1")?true:false;
                    }

                    if (_Dr["data_conduzione"] != DBNull.Value)
                    {
                        CPConduzioneData.Text = _Dr["data_conduzione"].ToString();
                    }

                    if (_Dr["ora_conduzione"] != DBNull.Value)
                    {
                        TxtOraAseguito.Text = _Dr["ora_conduzione"].ToString();
                    }

                    if (_Dr["sga_seguito"] != DBNull.Value)
                    {
                        CmbASeguito.Text = _Dr["sga_seguito"].ToString();
                    }
                    if (_Dr["DescTipoIntervento"] != DBNull.Value)
                    {
                        lblTipoIntervento.Text = _Dr["DescTipoIntervento"].ToString();
                    }

                    if (_Dr["tipomanut"] != DBNull.Value)
                    {
                        Lbltipomanut.Text = _Dr["tipomanut"].ToString();
                    }

                    HidTipInter.Value = _Dr["tipointervento_id"].ToString();
//					if (_Dr["tipointervento_id"].ToString() =="83")
//					{
//							BtSalvaSGA.Text="Salva/Invia DIE";
//					}


                    if (_Dr["die_numero"] != DBNull.Value)
                    {
                        TxtASeguito1.Text = _Dr["die_numero"].ToString();
                    }

                    if (_Dr["die_del"] != DBNull.Value)
                    {
                        CPAseguito.Text = _Dr["die_del"].ToString();
                    }

                    if (_Dr["sopralluogo"] != DBNull.Value)
                    {
                        ChkSopralluogo.Checked = (_Dr["sopralluogo"].ToString() == "1")?true:false;
                    }

                    if (_Dr["sopralluogo_n"] != DBNull.Value)
                    {
                        TxtSopralluogo.Text = _Dr["sopralluogo_n"].ToString();
                    }

                    if (_Dr["sopralluogo_del"] != DBNull.Value)
                    {
                        CPSopralluogoDie.Text = _Dr["sopralluogo_del"].ToString();
                    }

                    if (_Dr["sopralluogo_data"] != DBNull.Value)
                    {
                        CPSopralluogoData.Text = _Dr["sopralluogo_data"].ToString();
                    }

                    if (_Dr["sopralluogo_da"] != DBNull.Value)
                    {
                        TxtASeguito4.Text = _Dr["sopralluogo_da"].ToString();
                    }
//
//					if (_Dr["sga_aseguito1"] != DBNull.Value && _Dr["id_sga_seguito"]!= DBNull.Value)
//					{
//						switch(_Dr["id_sga_seguito"].ToString())
//						{
//							case "1":
//								this.lblAseguito1.Text ="IN DATA: " +  _Dr["sga_aseguito1"].ToString();
//								lblAseguito3.Visible=false;
//								lblAseguito4.Visible=false;
//							break;
//							case "4":
//								this.lblAseguito1.Text ="DIE N°: " +  _Dr["sga_aseguito1"].ToString();
//								lblAseguito3.Visible=false;
//								lblAseguito4.Visible=false;
//							break;
//							case "5":
//								this.lblAseguito1.Text ="N°: " +  _Dr["sga_aseguito1"].ToString();
//								lblAseguito3.Visible=true;
//								lblAseguito4.Visible=true;
//							break;
//						}
//					}
//
//					if (_Dr["sga_aseguito2"] != DBNull.Value && _Dr["id_sga_seguito"]!= DBNull.Value)
//					{
//						switch(_Dr["id_sga_seguito"].ToString())
//						{
//							case "1":
//								this.lblAseguito2.Text ="ORA: " +  _Dr["sga_aseguito2"].ToString();
//								break;
//							case "4": case "5":
//								this.lblAseguito2.Text ="DEL°: " +  _Dr["sga_aseguito2"].ToString();
//								break;
//								default:
//								break;
//						}
//					}
//
//					if (_Dr["sga_aseguito3"] != DBNull.Value)
//						this.lblAseguito3.Text = "Sopralluogo effettuato in data   "+_Dr["sga_aseguito3"].ToString();
//
//
//					if (_Dr["sga_aseguito4"] != DBNull.Value)
//						this.lblAseguito4.Text = "DA  "+_Dr["sga_aseguito4"].ToString();
                }
            }
            else
            {
                PageTitle1.Title = "Inserimento Richiesta di Lavoro - Impossibile visualizzare la Richiesta";
            }
        }