Example #1
0
        /// <summary>
        /// 搜索通讯日志
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        public List <AuditBusiness> AuditBusinessSearch(AuditBusinessSearchCondition condition)
        {
            DateTime today      = DateTime.Now;
            DateTime todayStart = new DateTime(today.Year, today.Month, today.Day, 0, 0, 0);

            if (condition.DateScopeBegin == DateTime.MinValue)
            {
                condition.DateScopeBegin = todayStart;

                switch (condition.DateScope)
                {
                case DateScopeEnum.OneDay:
                    break;

                case DateScopeEnum.OneWeek:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-7);
                    break;

                case DateScopeEnum.OneMonth:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-30);
                    break;

                case DateScopeEnum.OneYear:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-365);
                    break;

                case DateScopeEnum.All:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddYears(-100);
                    break;

                default:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddYears(-100);
                    break;
                }
            }

            if (condition.DateScopeEnd == DateTime.MinValue)
            {
                condition.DateScopeEnd = today;
            }

            string businessID = condition.BusinessID == Guid.Empty ? "" : condition.BusinessID.ToString();
            string serviceID  = condition.ServiceID == Guid.Empty ? "" : condition.ServiceID.ToString();
            string _SSE       = string.Format("exec AuditBusinessPage {0},{1},'{2}','{3}','{4}','{5}','{6}'",
                                              10,                                                            //PageSize
                                              1,                                                             //PageIndex
                                              condition.DateScopeBegin.ToString("yyyy-MM-dd") + " 00:00:00", //开始时间
                                              condition.DateScopeEnd.ToString("yyyy-MM-dd") + " 23:59:59",   //结束时间
                                              condition.Status.GetHashCode(),                                //通讯状态
                                              businessID,                                                    //实体ID
                                              serviceID);
            IEnumerable <AuditBusiness> auditList = execptionDC.ExecuteQuery <AuditBusiness>(_SSE);

            return(auditList.ToList <AuditBusiness>());
        }
Example #2
0
        /// <summary>
        /// 格式化搜索条件
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        private AuditBusinessSearchCondition FormatSearchCondition(AuditBusinessSearchCondition condition)
        {
            DateTime today      = DateTime.Now;
            DateTime todayStart = new DateTime(today.Year, today.Month, today.Day, 0, 0, 0);

            if (condition.DateScopeBegin == DateTime.MinValue)
            {
                condition.DateScopeBegin = todayStart;

                switch (condition.DateScope)
                {
                case DateScopeEnum.OneDay:
                    break;

                case DateScopeEnum.OneWeek:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-7);
                    break;

                case DateScopeEnum.OneMonth:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-30);
                    break;

                case DateScopeEnum.OneYear:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-365);
                    break;

                case DateScopeEnum.All:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddYears(-100);
                    break;

                default:
                    condition.DateScopeBegin = condition.DateScopeBegin.AddYears(-100);
                    break;
                }
            }

            if (condition.DateScopeEnd == DateTime.MinValue)
            {
                condition.DateScopeEnd = today;
            }

            return(condition);
        }
Example #3
0
        /// <summary>
        /// 获取到审计日志的数量
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        public int GetAuditBusinessCount(AuditBusinessSearchCondition condition)
        {
            condition = FormatSearchCondition(condition);

            string businessID = condition.BusinessID == Guid.Empty ? "" : condition.BusinessID.ToString();
            string serviceID  = condition.ServiceID == Guid.Empty ? "" : condition.ServiceID.ToString();
            string _SSE       = string.Format("exec GetAuditBusinessRowsCount '{0}','{1}','{2}','{3}','{4}','{5}','{6}'",
                                              condition.DateScopeBegin.ToString("yyyy-MM-dd") + " 00:00:00.000", //开始时间
                                              condition.DateScopeEnd.ToString("yyyy-MM-dd") + " 23:59:59.999",   //结束时间
                                              condition.Status.GetHashCode(),                                    //通讯状态
                                              businessID,                                                        //实体ID
                                              serviceID,
                                              condition.HostName,
                                              condition.IfShowHeartBeat);

            var rowsCount = execptionDC.ExecuteQuery <int>(_SSE);

            return(rowsCount.First <int>());
        }
Example #4
0
        /// <summary>
        /// 搜索通讯日志 分页版
        /// Tony 2011-07-29 按增加主机名称搜索
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        public List <AuditBusiness> AuditBusinessSearch(AuditBusinessSearchCondition condition, int pageIndex, int pageSize)
        {
            condition = FormatSearchCondition(condition);

            string businessID = condition.BusinessID == Guid.Empty ? "" : condition.BusinessID.ToString();
            string serviceID  = condition.ServiceID == Guid.Empty ? "" : condition.ServiceID.ToString();

            pageIndex = pageIndex / pageSize + 1;

            string _SSE = string.Format("exec AuditBusinessPage {0},{1},'{2}','{3}','{4}','{5}','{6}','{7}','{8}'",
                                        pageSize,                                                          //PageSize
                                        pageIndex,                                                         //PageIndex
                                        condition.DateScopeBegin.ToString("yyyy-MM-dd") + " 00:00:00.000", //开始时间
                                        condition.DateScopeEnd.ToString("yyyy-MM-dd") + " 23:59:59.999",   //结束时间
                                        condition.Status.GetHashCode(),                                    //通讯状态
                                        businessID,                                                        //实体ID
                                        serviceID,
                                        condition.HostName,
                                        condition.IfShowHeartBeat);

            IEnumerable <AuditBusiness> auditList = execptionDC.ExecuteQuery <AuditBusiness>(_SSE);

            return(auditList.ToList <AuditBusiness>());
        }
Example #5
0
 /// <summary>
 /// 获取到审计日之的数量
 /// </summary>
 /// <param name="condition"></param>
 /// <returns></returns>
 public int GetAuditBusinessCount(AuditBusinessSearchCondition condition)
 {
     return dataAccess.GetAuditBusinessCount(condition);
 }
Example #6
0
 /// <summary>
 /// 搜索通讯日志
 /// </summary>
 /// <param name="condition"></param>
 /// <returns></returns>
 public List<AuditBusiness> AuditBusinessSearch(AuditBusinessSearchCondition condition)
 {
     return dataAccess.AuditBusinessSearch(condition);
 }
Example #7
0
 /// <summary>
 /// 搜索通讯日志 带分页版本
 /// </summary>
 /// <param name="condition"></param>
 /// <returns></returns>
 public List<AuditBusiness> AuditBusinessSearch(AuditBusinessSearchCondition condition, int pageIndex, int pageSize)
 {
     return dataAccess.AuditBusinessSearch(condition, pageIndex, pageSize);
 }
Example #8
0
 /// <summary>
 /// 审计日志查询
 /// </summary>
 /// <param name="condition"></param>
 /// <returns></returns>
 public List<AuditBusiness> AuditBusinessSearch(AuditBusinessSearchCondition condition)
 {
     AuditLogic auditLogic = new AuditLogic();
     return auditLogic.AuditBusinessSearch(condition);
 }
Example #9
0
 public List<AuditBusiness> AuditBusinessSearch(AuditBusinessSearchCondition condition, int pageIndex, int pageSize)
 {
     AuditLogic auditLogic = new AuditLogic();
     return auditLogic.AuditBusinessSearch(condition, pageIndex, pageSize);
 }
Example #10
0
 public int GetAuditBusinessCount(AuditBusinessSearchCondition condition)
 {
     AuditLogic auditLogic = new AuditLogic();
     return auditLogic.GetAuditBusinessCount(condition);
 }
Example #11
0
        /// <summary>
        /// 格式化搜索条件
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        private AuditBusinessSearchCondition FormatSearchCondition(AuditBusinessSearchCondition condition)
        {
            DateTime today = DateTime.Now;
            DateTime todayStart = new DateTime(today.Year, today.Month, today.Day, 0, 0, 0);

            if (condition.DateScopeBegin == DateTime.MinValue)
            {
                condition.DateScopeBegin = todayStart;

                switch (condition.DateScope)
                {
                    case DateScopeEnum.OneDay:
                        break;
                    case DateScopeEnum.OneWeek:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-7);
                        break;
                    case DateScopeEnum.OneMonth:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-30);
                        break;
                    case DateScopeEnum.OneYear:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-365);
                        break;
                    case DateScopeEnum.All:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddYears(-100);
                        break;
                    default:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddYears(-100);
                        break;
                }
            }

            if (condition.DateScopeEnd == DateTime.MinValue)
            {
                condition.DateScopeEnd = today;
            }

            return condition;
        }
Example #12
0
        /// <summary>
        /// 获取到审计日志的数量
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        public int GetAuditBusinessCount(AuditBusinessSearchCondition condition)
        {
            condition = FormatSearchCondition(condition);

            string businessID = condition.BusinessID == Guid.Empty ? "" : condition.BusinessID.ToString();
            string serviceID = condition.ServiceID == Guid.Empty ? "" : condition.ServiceID.ToString();
            string _SSE = string.Format("exec GetAuditBusinessRowsCount '{0}','{1}','{2}','{3}','{4}','{5}','{6}'",
                condition.DateScopeBegin.ToString("yyyy-MM-dd") + " 00:00:00.000",   //开始时间
                condition.DateScopeEnd.ToString("yyyy-MM-dd") + " 23:59:59.999",     //结束时间
                condition.Status.GetHashCode(),                                  //通讯状态   
                businessID,                                                              //实体ID   
                serviceID,
                condition.HostName,
                condition.IfShowHeartBeat);

            var rowsCount = execptionDC.ExecuteQuery<int>(_SSE);

            return rowsCount.First<int>();
        }
Example #13
0
        /// <summary>
        /// 搜索通讯日志 分页版
        /// Tony 2011-07-29 按增加主机名称搜索
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        public List<AuditBusiness> AuditBusinessSearch(AuditBusinessSearchCondition condition, int pageIndex, int pageSize)
        {
            condition = FormatSearchCondition(condition);

            string businessID = condition.BusinessID == Guid.Empty ? "" : condition.BusinessID.ToString();
            string serviceID = condition.ServiceID == Guid.Empty ? "" : condition.ServiceID.ToString();
            pageIndex = pageIndex / pageSize + 1;

            string _SSE = string.Format("exec AuditBusinessPage {0},{1},'{2}','{3}','{4}','{5}','{6}','{7}','{8}'",
                pageSize, //PageSize
                pageIndex,  //PageIndex
                condition.DateScopeBegin.ToString("yyyy-MM-dd") + " 00:00:00.000",   //开始时间
                condition.DateScopeEnd.ToString("yyyy-MM-dd") + " 23:59:59.999",     //结束时间
                condition.Status.GetHashCode(),                                  //通讯状态   
                businessID,                                                              //实体ID   
                serviceID,
                condition.HostName,
                condition.IfShowHeartBeat);

            IEnumerable<AuditBusiness> auditList = execptionDC.ExecuteQuery<AuditBusiness>(_SSE);

            return auditList.ToList<AuditBusiness>();
        }
Example #14
0
        /// <summary>
        /// 搜索通讯日志
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        public List<AuditBusiness> AuditBusinessSearch(AuditBusinessSearchCondition condition)
        {
            DateTime today = DateTime.Now;
            DateTime todayStart = new DateTime(today.Year, today.Month, today.Day, 0, 0, 0);

            if (condition.DateScopeBegin == DateTime.MinValue)
            {
                condition.DateScopeBegin = todayStart;

                switch (condition.DateScope)
                {
                    case DateScopeEnum.OneDay:
                        break;
                    case DateScopeEnum.OneWeek:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-7);
                        break;
                    case DateScopeEnum.OneMonth:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-30);
                        break;
                    case DateScopeEnum.OneYear:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddDays(-365);
                        break;
                    case DateScopeEnum.All:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddYears(-100);
                        break;
                    default:
                        condition.DateScopeBegin = condition.DateScopeBegin.AddYears(-100);
                        break;
                }
            }

            if (condition.DateScopeEnd == DateTime.MinValue)
            {
                condition.DateScopeEnd = today;
            }

            string businessID = condition.BusinessID == Guid.Empty ? "" : condition.BusinessID.ToString();
            string serviceID = condition.ServiceID == Guid.Empty ? "" : condition.ServiceID.ToString();
            string _SSE = string.Format("exec AuditBusinessPage {0},{1},'{2}','{3}','{4}','{5}','{6}'",
                10, //PageSize
                1,  //PageIndex
                condition.DateScopeBegin.ToString("yyyy-MM-dd") + " 00:00:00",   //开始时间
                condition.DateScopeEnd.ToString("yyyy-MM-dd") + " 23:59:59",     //结束时间
                condition.Status.GetHashCode(),                                  //通讯状态   
                businessID,                                                              //实体ID   
                serviceID);
            IEnumerable<AuditBusiness> auditList = execptionDC.ExecuteQuery<AuditBusiness>(_SSE);            

            return auditList.ToList<AuditBusiness>();
        }