public ActionResult UsedRecord() { int pageIndex = 0; if (!int.TryParse(Request.Params["page"], out pageIndex)) { pageIndex = 1; } ; string code = Request["txtSearch"]; code = string.IsNullOrEmpty(code) ? code : code.Trim(); UsedRecordQuery query = new UsedRecordQuery(); query.PageInfo.PageIndex = pageIndex; query.PageInfo.PageSize = 10; query.Code = code; query.CustomerSysNo = this.CurrUser.UserSysNo; var result = GiftCardFacade.QueryUsedRecord(query); return(View(result)); }
/// <summary> /// 礼品卡消费记录 /// </summary> /// <param name="query"></param> /// <returns></returns> public static QueryResult <GiftCardUseInfo> QueryUsedRecord(UsedRecordQuery filter) { CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("GiftCard_QueryUsedRecord"); using (DynamicQuerySqlBuilder sqlBuilder = new DynamicQuerySqlBuilder(command.CommandText, command, filter.ConvertToPaging(), "SO.[SysNo] DESC")) { sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "GC.Code", DbType.String, "@Code", QueryConditionOperatorType.Equal, filter.Code); command.CommandText = sqlBuilder.BuildQuerySql(); command.SetParameterValue("@CustomerSysNo", filter.CustomerSysNo); command.SetParameterValue("@ActionType", "SO"); var newsList = command.ExecuteEntityList <GiftCardUseInfo>(); var totalCount = Convert.ToInt32(command.GetParameterValue("@TotalCount")); QueryResult <GiftCardUseInfo> result = new QueryResult <GiftCardUseInfo>(); result.ResultList = newsList; result.PageInfo = filter.ConvertToPageInfo(totalCount); return(result); } }
/// <summary> /// 礼品卡消费记录 /// </summary> /// <param name="query"></param> /// <returns></returns> public static QueryResult <GiftCardUseInfo> QueryUsedRecord(UsedRecordQuery query) { return(GiftCardDA.QueryUsedRecord(query)); }