Exemplo n.º 1
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string Delete()
        {
            long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]);              //主表主键

            var deletedresult = LogCfgService.Delete <System.Int64>(id);

            return(DataConverterHelper.SerializeObject(deletedresult));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据主键获取数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string GetLogCfgInfo()
        {
            long   id      = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键
            string tabtype = System.Web.HttpContext.Current.Request.Params["tabtype"];             //Tab类型

            var findedresult = LogCfgService.Find(id);

            return(DataConverterHelper.ResponseResultToJson(findedresult));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 取列表数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string GetLogCfgList()
        {
            string clientJsonQuery = System.Web.HttpContext.Current.Request.Params["queryfilter"];    //查询条件
            Dictionary <string, object> dicWhere = DataConverterHelper.ConvertToDic(clientJsonQuery); //查询条件转Dictionary

            DataStoreParam storeparam = this.GetDataStoreParam();
            var            result     = LogCfgService.LoadWithPage(storeparam.PageIndex, storeparam.PageSize, dicWhere);

            return(DataConverterHelper.EntityListToJson <LogCfgModel>(result.Results, (Int32)result.TotalItems));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string Save()
        {
            //sql数据
            string logcfgGrid = System.Web.HttpContext.Current.Request.Form["logcfgGrid"];

            var datas = JsonToModel.GetModifiedLogCfgModels(logcfgGrid);

            var savedresult = LogCfgService.SaveCfg(datas);

            //refresh 缓存
            if (savedresult.SaveRows > 0)
            {
                NG3LoggerManager.RefreshLogCfg();
            }

            return(DataConverterHelper.SerializeObject(savedresult));
        }