示例#1
0
        /// <summary>
        /// 查询列表数据
        /// </summary>
        /// <param name="nvc">参数集合</param>
        /// <returns></returns>
        public DailyAccountSnapshotListModel Query(NameValueCollection nvc)
        {
            DailyAccountSnapshotListModel model  = new DailyAccountSnapshotListModel();
            MDailyAccountSnapshot         entity = new MDailyAccountSnapshot();

            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);

            DateTime st = CommFun.ToDateTime(nvc["s"], DateTime.Now).Value;
            DateTime et = CommFun.ToDateTime(nvc["e"], DateTime.Now).Value.AddDays(1);

            entity.AddData("ST", st.ToString("yyyy-MM-dd"));
            entity.AddData("ET", et.ToString("yyyy-MM-dd"));

            model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getCount", entity), 0).GetValueOrDefault();
            if (model.TotalCount > 0)
            {
                model.Statistics = handler.GetSingleDataByTemplate("getStatistics", entity);
                model.List       = handler.GetDataListByTemplate("getList", entity);
            }
            return(model);
        }
示例#2
0
        public string Item()
        {
            MDailyAccountSnapshot entity = new MDailyAccountSnapshot();

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

            return(result.ToString());
        }