Exemple #1
0
        public ServerResponse <NewsGetListResponse> GetList(NewsGetListRequest request)
        {
            ServerResponse <NewsGetListResponse> response = new ServerResponse <NewsGetListResponse>();

            try
            {
                //查数据
                var list = dal.GetList(request);
                //查总记录数
                var count = dal.GetCount(JsonHelper.CloneObject <NewsGetCountRequest>(request));
                response.Data = new NewsGetListResponse()
                {
                    DataList = list, Count = count
                };
                response.Code = ServerResponseType.成功;
            }
            catch (Exception ex)
            {
                response.Code     = ServerResponseType.调用异常;
                response.ErrorMsg = ex.ToString();
                Log.LogHelper.WriteErrorLog(GetType(), ex);
            }
            return(response);
        }
Exemple #2
0
 public int GetCount(string keywords)
 {
     return(Convert.ToInt32(NewsDAL.GetCount(keywords)));
 }
Exemple #3
0
 public int GetCount()
 {
     return(Convert.ToInt32(NewsDAL.GetCount()));
 }