/// <summary> /// 查询列表数据 /// </summary> /// <param name="nvc">参数集合</param> /// <returns></returns> public UpChannelConfigListModel Query(NameValueCollection nvc) { UpChannelConfigListModel model = new UpChannelConfigListModel(); MUpChannelConfig entity = new MUpChannelConfig(); 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); model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getCount", entity), 0).GetValueOrDefault(); if (model.TotalCount > 0) { model.List = handler.GetDataListByTemplate("getList", entity); } return(model); }
public IResult Item() { try { MUpChannelConfig entity = new MUpChannelConfig(); entity.SetData(Request.Form); entity.DownChannelNo = CommFun.ToInt(Request["DChannelNo"], null); string id = CommFun.GetString(Request["__id"]); IResult result = UpChannelConfigService.Instance.Save(id, entity); if (result.Status) { result.SetSuccessMessage("保存成功"); } else { result.SetErrorMessage("保存失败"); } return(result); } catch (Exception ex) { return(new Result(false, ex.Message)); } }