Exemple #1
0
        int INoticeInfo <MessageInfo> .GetMyNoticeInfoCount(MyNoticeView myNoticeView)
        {
            Contract.Requires <ArgumentNullException>(myNoticeView != null, "参数myNoticeView:不能为空");
            int    result  = 0;
            string message = string.Empty;
            MiicConditionCollections conditions = myNoticeView.visitor(this);

            try
            {
                result = dbService.GetCount <MessageInfo>(null, conditions, out message);
            }
            catch (Exception ex)
            {
                Config.IlogicLogService.Write(new LogicLog()
                {
                    AppName       = Config.AppName,
                    ClassName     = ClassName,
                    NamespaceName = NamespaceName,
                    MethodName    = MethodBase.GetCurrentMethod().Name,
                    Message       = ex.Message,
                    Oper          = Config.Oper
                });
            }
            return(result);
        }
Exemple #2
0
        DataTable INoticeInfo <MessageInfo> .GetMyNoticeInfoList(MyNoticeView myNoticeView, MiicPage page)
        {
            Contract.Requires <ArgumentNullException>(myNoticeView != null, "参数myNoticeView:不能为空");
            DataTable result  = new DataTable();
            string    message = string.Empty;
            MiicConditionCollections conditions = myNoticeView.visitor(this);
            List <MiicOrderBy>       order      = new List <MiicOrderBy>();

            order.Add(new MiicOrderBy()
            {
                Desc         = true,
                PropertyName = Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, DateTime?>(o => o.PublishTime)
            });
            conditions.order = order;
            MiicRelation relation = new MiicRelation(Config.Attribute.GetSqlTableNameByClassName <MessageInfo>(),
                                                     Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, string>(o => o.PublisherID),
                                                     Config.Attribute.GetSqlTableNameByClassName <SimplePersonUserView>(),
                                                     Config.Attribute.GetSqlColumnNameByPropertyName <SimplePersonUserView, string>(o => o.UserID),
                                                     MiicDBOperatorSetting.Equal,
                                                     MiicDBRelationSetting.InnerJoin);

            try
            {
                if (page != null)
                {
                    result = dbService.GetInformationsPage(null, relation, conditions, page, out message);
                }
                else
                {
                    result = dbService.GetInformations(null, relation, conditions, out message);
                }
            }
            catch (Exception ex)
            {
                Config.IlogicLogService.Write(new LogicLog()
                {
                    AppName       = Config.AppName,
                    ClassName     = ClassName,
                    NamespaceName = NamespaceName,
                    MethodName    = MethodBase.GetCurrentMethod().Name,
                    Message       = ex.Message,
                    Oper          = Config.Oper
                });
            }
            return(result);
        }