internal List <SystemNotificationEntity> GetActiveNotification(bool IsActive)
        {
            List <SystemNotificationEntity> results = new List <SystemNotificationEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "capp.GetAllNotification";  // MP-846 Admin database cleanup and code cleanup.
                sproc.StoredProceduresParameter.Add(GetParam("@IsActive", IsActive.ToString().Trim(), SQLServerDatatype.BitDataType));


                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc);
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new SystemNotificationAdapter().Adapt(dt);
                    foreach (SystemNotificationEntity comp in results)
                    {
                        results = new SystemNotificationAdapter().Adapt(dt);
                    }
                }
            }
            catch (Exception)
            {
                //Put log to db here
                throw;
            }
            return(results);
        }
        internal List <SystemNotificationEntity> GetAllNotification()
        {
            List <SystemNotificationEntity> results = new List <SystemNotificationEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "mapp.GetAllNotification";

                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc);
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new SystemNotificationAdapter().Adapt(dt);
                    foreach (SystemNotificationEntity comp in results)
                    {
                        results = new SystemNotificationAdapter().Adapt(dt);
                    }
                }
            }
            catch (Exception)
            {
                //Put log to db here
                throw;
            }
            return(results);
        }
        // Gets all Notifications
        internal List <SystemNotificationEntity> GetAllNotificationPaging(int SortOrder, int PageNumber, int PageSize, out int TotalCount)
        {
            TotalCount = 0;
            List <SystemNotificationEntity> results = new List <SystemNotificationEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "mapp.GetAllNotificationPaging";
                sproc.StoredProceduresParameter.Add(GetParam("@SortOrder", SortOrder.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@PageNumber", PageNumber.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@PageSize", PageSize.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@TotalRecords", TotalCount.ToString(), SQLServerDatatype.IntDataType, ParameterDirection.Output));

                string    outParam = "";
                DataTable dt;
                dt = sql.ExecuteDataTableWithOutputParam(CommandType.StoredProcedure, sproc, out outParam);

                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new SystemNotificationAdapter().Adapt(dt);
                }
                TotalCount = Convert.ToInt32(outParam);
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
        internal SystemNotificationEntity GetNotificationByMessageId(int MessageId)
        {
            List <SystemNotificationEntity> results = new List <SystemNotificationEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "mapp.GetAllNotification";
                sproc.StoredProceduresParameter.Add(GetParam("@MessageId", MessageId.ToString().Trim(), SQLServerDatatype.IntDataType));
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc);
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new SystemNotificationAdapter().Adapt(dt);
                    foreach (SystemNotificationEntity comp in results)
                    {
                        results = new SystemNotificationAdapter().Adapt(dt);
                    }
                }
            }
            catch (Exception)
            {
                //Put log to db here
                throw;
            }
            return(results.FirstOrDefault());
        }