Exemplo n.º 1
0
        /// <summary>
        /// 查询单条记录
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public NewsModel GetModel(NewsGetModelRequest request)
        {
            List <DbParameter> paramenters = new List <DbParameter>();
            string             sqlWhere    = CreateWhereSql(request, paramenters);

            return(base.GetModel(sqlWhere, paramenters));
        }
Exemplo n.º 2
0
        public ServerResponse <NewsModel> GetModel(NewsGetModelRequest request)
        {
            ServerResponse <NewsModel> response = new ServerResponse <NewsModel>();

            try
            {
                var model = dal.GetModel(request);
                response.Data = model;
                if (model != null)
                {
                    response.Code = ServerResponseType.成功;
                }
                else
                {
                    response.Code = ServerResponseType.空数据;
                }
            }
            catch (Exception ex)
            {
                response.Code     = ServerResponseType.调用异常;
                response.ErrorMsg = ex.ToString();
                Log.LogHelper.WriteErrorLog(GetType(), ex);
            }
            return(response);
        }
Exemplo n.º 3
0
 public ServerResponse <NewsModel> GetModel(NewsGetModelRequest request)
 {
     return(Action <NewsModel>(request, "api/News/model"));
 }