public OrderDeliveryListModel ReviewQuery(NameValueCollection nvc) { OrderDeliveryListModel model = new OrderDeliveryListModel(); MOrderDelivery entity = new MOrderDelivery(); 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.AddDays(-1)).Value; DateTime et = CommFun.ToDateTime(nvc["t"], DateTime.Now).Value; entity.AddData("ST", st.ToString("yyyy-MM-dd")); entity.AddData("ET", et.ToString("yyyy-MM-dd")); string keyWord = CommFun.GetString(nvc["KeyWords"]); if (!string.IsNullOrEmpty(keyWord)) { int?type = CommFun.ToInt(nvc["keytype"], null); switch (type) { case 1: entity.OrderNo = nvc["KeyWords"]; break; case 2: entity.DeliveryId = CommFun.ToLong(nvc["KeyWords"], -1); break; case 3: entity.UpOrderNo = nvc["KeyWords"]; break; } } model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getReviewCount", entity), 0).GetValueOrDefault(); if (model.TotalCount > 0) { model.List = handler.GetDataListByTemplate("getReviewList", entity); } return(model); }
/// <summary> /// 查询列表数据 /// </summary> /// <param name="nvc">参数集合</param> /// <returns></returns> public OrderRefundListModel Query(NameValueCollection nvc) { OrderRefundListModel model = new OrderRefundListModel(); MOrderRefund entity = new MOrderRefund(); 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.AddDays(-1)).Value; DateTime et = CommFun.ToDateTime(nvc["e"], DateTime.Now).Value; entity.AddData("ST", st.ToString("yyyy-MM-dd")); entity.AddData("ET", et.ToString("yyyy-MM-dd")); if (!string.IsNullOrEmpty(nvc["ReStatus"])) { entity.Status = CommFun.ToInt(nvc["ReStatus"], null); } if (!string.IsNullOrEmpty(nvc["KeyWords"])) { switch (nvc["keytype"]) { case "1": entity.OrderNo = CommFun.GetString(nvc["KeyWords"], null); break; case "2": entity.RecordId = CommFun.ToLong(nvc["KeyWords"], null); break; case "3": entity.RefundFee = CommFun.ToDecimal(nvc["KeyWords"], null); break; } } model.TotalCount = CommFun.ToInt(handler.GetScalarByXmlTemplate("getCount", entity), 0).GetValueOrDefault(); if (model.TotalCount > 0) { model.List = handler.GetDataListByTemplate("getList", entity); } return(model); }