Пример #1
0
        internal List <MonitoringProductElementEntity> GetProductElementData(int productID)
        {
            List <MonitoringProductElementEntity> results = new List <MonitoringProductElementEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.GetProductElementData";

                StoredProceduresParameterEntity param = new StoredProceduresParameterEntity();
                param.ParameterName  = "@ProductID";
                param.ParameterValue = productID.ToString();
                sproc.StoredProceduresParameter.Add(param);

                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new MonitoringProductAdapter().AdaptElement(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
Пример #2
0
        internal MonitoringProfileEntity GetMonitorProfileByID(int Id)
        {
            MonitoringProfileEntity results = new MonitoringProfileEntity();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.GetMonitorProfileByID";

                StoredProceduresParameterEntity param = new StoredProceduresParameterEntity();
                param.ParameterName  = "@MonitoringProfileID";
                param.ParameterValue = Id.ToString();
                sproc.StoredProceduresParameter.Add(param);

                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new MonitoringProductAdapter().AdaptProfile(dt).FirstOrDefault();
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
Пример #3
0
        internal List <MonitoringProfileEntity> ValidateMonitoringProfile(int ElementId, string ProductCode, string MonitoringLevel, int Id = 0)
        {
            List <MonitoringProfileEntity> results = new List <MonitoringProfileEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.ValidateMonitoringProfile";
                sproc.StoredProceduresParameter.Add(GetParam("@ProfileId", Id.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@ElementId ", ElementId.ToString(), SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@ProductCode", ProductCode.ToString(), SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@MonitoringLevel", MonitoringLevel.ToString(), SQLServerDatatype.VarcharDataType));

                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc);
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new MonitoringProductAdapter().AdaptProfile(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
Пример #4
0
        internal List <MonitoringProfileEntity> GetAllMonitoringProfileNames()
        {
            List <MonitoringProfileEntity> results = new List <MonitoringProfileEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.GetMonitoringProfileNames";
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new MonitoringProductAdapter().AdaptProfile(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
Пример #5
0
        internal List <MonitoringProfileEntity> GetMonitoringProfile(int CredentialId)
        {
            List <MonitoringProfileEntity> results = new List <MonitoringProfileEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.GetMonitoringProfile";
                sproc.StoredProceduresParameter.Add(GetParam("@CredentialId", CredentialId.ToString(), SQLServerDatatype.IntDataType));
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.ReadWrite.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new MonitoringProductAdapter().AdaptProfile(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }