コード例 #1
0
        public ActionResult <object> GetList([FromBody] log_infoVM model, int pageindex, int pagesize)
        {
            log_info_Entity entity = model.ConvertToT <log_info_Entity>();

            var(list, total) = this._repository.GetList(entity, pageindex, pagesize);
            return(list.ResponseSuccess("", total));
        }
コード例 #2
0
        /// <summary>
        /// 修改
        /// <summary>
        public bool Update(log_info_Entity model, int id)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic["id"] = id;
            if (model.chain_id != null)
            {
                dic["chain_id"] = model.chain_id;
            }
            if (model.content != null)
            {
                dic["content"] = model.content;
            }
            if (model.interface_name != null)
            {
                dic["interface_name"] = model.interface_name;
            }
            if (model.type != null && model.type.HasValue)
            {
                dic["type"] = model.type;
            }
            if (model.ip != null)
            {
                dic["ip"] = model.ip;
            }
            return(SQLHelperFactory.Instance.ExecuteNonQuery("Update_log_info", dic) > 0);
        }
コード例 #3
0
        /// <summary>
        /// 获取列表
        /// <summary>
        public (IEnumerable <log_info_Entity>, int) GetList(log_info_Entity model, int pageindex, int pagesize)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            if (model.id != 0)
            {
                dic["id"] = model.id;
            }
            if (model.chain_id != null)
            {
                dic["chain_id"] = model.chain_id;
            }
            if (model.content != null)
            {
                dic["content"] = model.content;
            }
            if (model.interface_name != null)
            {
                dic["interface_name"] = model.interface_name;
            }
            if (model.type != null && model.type.HasValue)
            {
                dic["type"] = model.type;
            }
            if (model.creation_time != null && model.creation_time.HasValue)
            {
                dic["creation_time"] = model.creation_time;
            }
            if (model.ip != null)
            {
                dic["ip"] = model.ip;
            }
            if (pageindex >= 0)
            {
                dic["StartIndex"] = pageindex <= 1 ? 0 : (pageindex - 1) * pagesize;
            }
            if (pagesize > 0)
            {
                dic["SelectCount"] = pagesize;
            }
            var list = SQLHelperFactory.Instance.QueryMultipleByPage <log_info_Entity>("Select_log_info_List", dic, out int total);

            return(list, total);
        }
コード例 #4
0
        public ActionResult <object> Update([FromBody] log_infoVM model, int id)
        {
            log_info_Entity entity = model.ConvertToT <log_info_Entity>();

            return(this._repository.Update(entity, id).ResponseSuccess());
        }
コード例 #5
0
        public ActionResult <object> Post([FromBody] log_infoVM model)
        {
            log_info_Entity entity = model.ConvertToT <log_info_Entity>();

            return(this._repository.Insert(entity).ResponseSuccess());
        }