public static DataTable FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDate
            (int channelId, int clientId, DateTime startDateTime, DateTime enddateTime, DataType dataType, string sortFieldName, bool isDesc, int pageIndex, int pageSize, out int recordCount)
        {
            if (channelId == 0)
            {
                throw new ArgumentException(" channelId not allow 0.");
            }

            SPChannelWrapper channelWrapper = SPChannelWrapper.FindById(channelId);

            List <SPPaymentInfoWrapper> spPaymentInfoWrappers = ConvertToWrapperList(businessProxy.FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDate(channelId, clientId,
                                                                                                                                                           startDateTime,
                                                                                                                                                           enddateTime, dataType,
                                                                                                                                                           sortFieldName, isDesc,
                                                                                                                                                           pageIndex, pageSize,
                                                                                                                                                           out recordCount));

            DataTable channelRecordTable = channelWrapper.BuildChannelRecordTable();

            for (int i = 0; i < spPaymentInfoWrappers.Count; i++)
            {
                DataRow dr = channelRecordTable.NewRow();

                dr.BeginEdit();

                dr["RecordID"]       = spPaymentInfoWrappers[i].Id;
                dr["CreateDate"]     = spPaymentInfoWrappers[i].CreateDate;
                dr["Province"]       = spPaymentInfoWrappers[i].Province;
                dr["City"]           = spPaymentInfoWrappers[i].City;
                dr["SycnRetryTimes"] = spPaymentInfoWrappers[i].SycnRetryTimes;
                dr["IsSycnData"]     = spPaymentInfoWrappers[i].IsSycnData;
                dr["SucesssToSend"]  = spPaymentInfoWrappers[i].SucesssToSend;

                if (!string.IsNullOrEmpty(spPaymentInfoWrappers[i].SSycnDataUrl))
                {
                    dr["SendUrl"] = spPaymentInfoWrappers[i].SSycnDataUrl;
                }
                else
                {
                    if (spPaymentInfoWrappers[i].IsSycnData.HasValue && spPaymentInfoWrappers[i].IsSycnData.Value)
                    {
                        dr["SendUrl"] = spPaymentInfoWrappers[i].ReBuildUrl();
                    }
                }

                foreach (string field in SPChannelWrapper.fields)
                {
                    dr[field] = spPaymentInfoWrappers[i].GetMappingValue(field);
                }

                dr.EndEdit();

                channelRecordTable.Rows.Add(dr);
            }

            channelRecordTable.AcceptChanges();

            return(channelRecordTable);
        }
Example #2
0
        public static DataTable FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDateNoIntercept(int channelId, int clientId, DateTime startDateTime, DateTime enddateTime, string sortFieldName, bool isDesc, int pageIndex, int pageSize, out int recordCount)
        {
            if (channelId == 0)
            {
                throw new ArgumentException(" channelId not allow 0.");
            }

            SPChannelWrapper channelWrapper = SPChannelWrapper.FindById(channelId);

            List <SPPaymentInfoWrapper> spPaymentInfoWrappers = ConvertToWrapperList(businessProxy.FindAllByOrderByAndCleintIDAndChanneLIDAndDateNoIntercept(channelId, clientId,
                                                                                                                                                             startDateTime,
                                                                                                                                                             enddateTime,
                                                                                                                                                             sortFieldName, isDesc,
                                                                                                                                                             pageIndex, pageSize,
                                                                                                                                                             out recordCount));

            DataTable channelRecordTable = channelWrapper.BuildChannelRecordTable();

            for (int i = 0; i < spPaymentInfoWrappers.Count; i++)
            {
                DataRow dr = channelRecordTable.NewRow();

                dr.BeginEdit();

                dr["RecordID"]   = spPaymentInfoWrappers[i].Id;
                dr["CreateDate"] = spPaymentInfoWrappers[i].CreateDate;

                foreach (string field in SPChannelWrapper.fields)
                {
                    dr[field] = spPaymentInfoWrappers[i].GetMappingValue(field);
                }

                dr.EndEdit();

                channelRecordTable.Rows.Add(dr);
            }

            channelRecordTable.AcceptChanges();

            return(channelRecordTable);
        }