Ejemplo n.º 1
0
        /// <summary>
        /// 查询列表数据
        /// </summary>
        /// <param name="nvc">参数集合</param>
        /// <returns></returns>
        public OperateLogListModel Query(NameValueCollection nvc)
        {
            OperateLogListModel model  = new OperateLogListModel();
            MOperateLog         entity = new MOperateLog();

            model.PageSize = CommFun.ToInt(nvc["ps"],
                                           SettingHelper.Instance.GetInt("PageSize", 10)).Value;
            model.PageIndex = CommFun.ToInt(nvc["pi"],
                                            SettingHelper.Instance.GetInt("PageIndex", 0)).Value + 1;
            entity.SetData(nvc, false);
            entity.TrimEmptyProperty();
            entity.AddData(":PS", model.PageSize);
            entity.AddData(":PI", model.PageIndex);
            string sTime = CommFun.ToDateTime(nvc["s"], DateTime.Now).Value.ToString("yyyy-MM-dd");
            string eTime = CommFun.ToDateTime(nvc["e"], DateTime.Now).Value.ToString("yyyy-MM-dd");

            entity.AddData("ST", sTime);
            entity.AddData("ET", eTime);
            model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getCount", entity), 0).GetValueOrDefault();
            if (model.TotalCount > 0)
            {
                model.List = handler.GetDataListByTemplate("getList", entity);
            }
            return(model);
        }
Ejemplo n.º 2
0
        public string Item()
        {
            MOperateLog entity = new MOperateLog();

            entity.SetData(Request.Form);
            entity.TrimEmptyProperty();
            string  id     = Request.Form["__id"];
            IResult result = OperateLogService.Instance.Save(id, entity);

            return(result.ToString());
        }