示例#1
0
 private void BuildDpaPluginHashObject(DataSet ds, ref DpaPluginHash dpaPluginHash)
 {
     try
     {
         if (ds.Tables["dpa_plugin_hash"] != null && ds.Tables["dpa_plugin_hash"].Rows.Count > 0)
         {
             if (ds.Tables["dpa_plugin_hash"].Rows != null && ds.Tables["dpa_plugin_hash"].Rows.Count > 0)
             {
                 DataRow row = ds.Tables["dpa_plugin_hash"].Rows[0];
                 dpaPluginHash = new DpaPluginHash()
                 {
                     idProfile        = !string.IsNullOrEmpty(row["ID_PROFILE"].ToString()) ? row["ID_PROFILE"].ToString() : string.Empty,
                     dataElaborazione = Convert.ToDateTime(row["DTA_ELAB"].ToString(), new System.Globalization.CultureInfo("it-IT")),
                     idPeople         = !string.IsNullOrEmpty(row["ID_PEOPLE"].ToString()) ? row["ID_PEOPLE"].ToString() : string.Empty,
                     systemId         = !string.IsNullOrEmpty(row["SYSTEM_ID"].ToString()) ? row["SYSTEM_ID"].ToString() : string.Empty,
                     hashFile         = !string.IsNullOrEmpty(row["HASH_FILE"].ToString()) ? row["HASH_FILE"].ToString() : string.Empty
                 };
             }
         }
     }
     catch (Exception exc)
     {
         throw exc;
     }
 }
示例#2
0
        public DpaPluginHash GetHashMail(string hashFile)
        {
            DpaPluginHash dpaPluginHash = null;

            try
            {
                string            query;
                DataSet           ds = new DataSet();
                DocsPaUtils.Query q  = DocsPaUtils.InitQuery.getInstance().getQuery("S_DPA_PLUGIN_HASH");
                q.setParam("hashFile", hashFile);
                if (dbType.ToUpper() == "SQL")
                {
                    q.setParam("dbuser", getUserDB());
                }
                query = q.getSQL();
                if (this.ExecuteQuery(out ds, "dpa_plugin_hash", query))
                {
                    BuildDpaPluginHashObject(ds, ref dpaPluginHash);
                }
            }
            catch (Exception exc)
            {
                throw exc;
            }
            return(dpaPluginHash);
        }
示例#3
0
        public static Services.PluginHash.GetHashMail.GetHashMailResponse GetHashMail(Services.PluginHash.GetHashMail.GetHashMailRequest request)
        {
            Services.PluginHash.GetHashMail.GetHashMailResponse response = new Services.PluginHash.GetHashMail.GetHashMailResponse();

            DocsPaVO.utente.InfoUtente infoUtente = null;

            //Inizio controllo autenticazione utente
            infoUtente = Utils.CheckAuthentication(request, "GetHashMail");

            if (string.IsNullOrEmpty(request.HashFile))
            {
                throw new PisException("MISSING_PARAMETER");
            }

            try
            {
                DpaPluginHash dpaPluginHash = BusinessLogic.Plugin.PluginHashBL.GetHashMail(request.HashFile);
                response = new Services.PluginHash.GetHashMail.GetHashMailResponse()
                {
                    DpaPluginHash = dpaPluginHash != null ? new Domain.DpaPluginHash()
                    {
                        DataElaborazione = dpaPluginHash.dataElaborazione,
                        HashFile         = dpaPluginHash.hashFile,
                        Utente           = BusinessLogic.Utenti.UserManager.getUtenteById(dpaPluginHash.idPeople),
                        IdProfile        = dpaPluginHash.idProfile,
                        SystemId         = dpaPluginHash.systemId,
                        AccessRight      = BusinessLogic.Documenti.DocManager.getAccessRightDocBySystemID(dpaPluginHash.idProfile, infoUtente)
                    } : null
                };
                response.Success = true;
            }
            catch (PisException pisEx)
            {
                logger.ErrorFormat("PISException: {0}, {1}", pisEx.ErrorCode, pisEx.Description);
                response.Error = new Services.ResponseError
                {
                    Code        = pisEx.ErrorCode,
                    Description = pisEx.Description
                };

                response.Success = false;
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("Eccezione Generica: APPLICATION_ERROR, {0}", ex.Message);
                response.Error = new Services.ResponseError
                {
                    Code        = "APPLICATION_ERROR",
                    Description = ex.Message
                };

                response.Success = false;
            }

            return(response);
        }
示例#4
0
        public static DpaPluginHash GetHashMail(string hashFile)
        {
            DpaPluginHash dpaPluginHash = null;

            try
            {
                DocsPaDB.Query_DocsPAWS.PluginHashDB pluginHashDB = new DocsPaDB.Query_DocsPAWS.PluginHashDB();
                dpaPluginHash = pluginHashDB.GetHashMail(hashFile);
            }
            catch (Exception e)
            {
                logger.Debug("Errore in BusinessLogic.Plugin.PluginHashBL  - metodo: GetHashMail ", e);
            }
            return(dpaPluginHash);
        }