Example #1
0
        int IMessageInfo.GetSearchCount(TopicSearchView searchView)
        {
            Contract.Requires <ArgumentNullException>(searchView != null, "参数searchView:不能为空");
            int    result  = 0;
            string message = string.Empty;
            MiicConditionCollections conditions = searchView.visitor(this);

            try
            {
                result = dbService.GetCount <TopicInfo>(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);
        }
Example #2
0
        DataTable IMessageInfo.Search(TopicSearchView searchView, MiicPage page)
        {
            Contract.Requires <ArgumentNullException>(searchView != null, "参数searchView:不能为空");
            DataTable result  = new DataTable();
            string    message = string.Empty;

            try
            {
                if (page == null)
                {
                    Dictionary <String, String> paras = new Dictionary <String, String>();
                    paras.Add("USER_ID", searchView.UserID);
                    paras.Add("GROUP_ID", searchView.GroupID);
                    paras.Add("KEYWORD", searchView.Keyword);
                    paras.Add("PAGE_START", string.Empty);
                    paras.Add("PAGE_END", string.Empty);
                    string storeProcedureName = "SearchGroupTopic";
                    result = dbService.QueryStoredProcedure <string>(storeProcedureName, paras, out message);
                }
                else
                {
                    Dictionary <String, String> paras = new Dictionary <String, String>();
                    paras.Add("USER_ID", searchView.UserID);
                    paras.Add("GROUP_ID", searchView.GroupID);
                    paras.Add("KEYWORD", searchView.Keyword);
                    paras.Add("PAGE_START", page.pageStart);
                    paras.Add("PAGE_END", page.pageEnd);
                    string storeProcedureName = "SearchGroupTopic";
                    result = dbService.QueryStoredProcedure <string>(storeProcedureName, paras, 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);
        }