Example #1
0
        public void UpdatePaymentSend(int id, bool isSendOk, string sendUrl, string responseMessage, int sycnRetryTimes)
        {
            SPRecordWrapper record = SPRecordWrapper.FindById(id);

            if (record == null)
            {
                return;
            }

            if (record.IsIntercept)
            {
                return;
            }

            if (isSendOk)
            {
                record.IsSycnSuccessed = isSendOk;
            }

            record.IsSycnToClient = true;

            record.SycnRetryTimes = sycnRetryTimes;

            SPRecordWrapper.Update(record);

            record.ExtendInfo.SSycnDataUrl           = sendUrl;
            record.ExtendInfo.SSycnDataFailedMessage = responseMessage;

            SPRecordExtendInfoWrapper.Update(record.ExtendInfo);
        }
Example #2
0
        public static void SendRequest(object request)
        {
            UrlSendTask sendTask = request as UrlSendTask;

            if (sendTask == null)
            {
                throw new AbandonedMutexException(" sendTask is null ");
            }


            try
            {
                bool requestOk = false;

                string errorMessage = string.Empty;

                requestOk = SendRequest(sendTask.SendDataUrl, 3000, sendTask.DataOkMessage, out errorMessage);

                if (requestOk)
                {
                    SPRecordWrapper.UpdateUrlSuccessSend(sendTask.RecordID, sendTask.SendDataUrl);
                }
                else
                {
                    SPRecordWrapper.UpdateUrlFailedSend(sendTask.RecordID, sendTask.SendDataUrl, errorMessage);
                }
            }
            catch (Exception ex)
            {
                SPRecordWrapper.UpdateUrlFailedSend(sendTask.RecordID, sendTask.SendDataUrl, ex.Message);
            }
        }
Example #3
0
        public bool CheckPaymentNeedSend(int id)
        {
            SPRecordWrapper record = SPRecordWrapper.FindById(id);

            if (record == null)
            {
                return(false);
            }

            if (record.IsIntercept)
            {
                return(false);
            }

            if (record.IsSycnSuccessed)
            {
                return(false);
            }

            if (record.SycnRetryTimes > 1)
            {
                return(false);
            }

            return(true);
        }
        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);
            RecordSortor    recordSortor    = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            storeData.DataSource = SPRecordWrapper.QueryRecordByPage(this.ChannelID, this.CodeID, this.ClientID, this.DataType, this.StartDate.Value, this.EndDate.Value, new List <QueryFilter>(), recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;
            storeData.DataBind();
        }
        //protected void storeSPChannel_Refresh(object sender, StoreRefreshDataEventArgs e)
        //{
        //    this.storeSPChannel.DataSource = SPChannelWrapper.FindAll();

        //    this.storeSPChannel.DataBind();
        //}


        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e,
                                                                                                         this.
                                                                                                         PagingToolBar1);

            ReportSearchCondition reportSearchCondition = GetReportSearchCondition(WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e));

            storeData.DataSource = SPRecordWrapper.QueryRecordByPage(reportSearchCondition.Channel, reportSearchCondition.Code, reportSearchCondition.Client, SPRecordWrapper.DayReportType_AllUp, reportSearchCondition.StartDate, reportSearchCondition.EndDate, reportSearchCondition.QueryFilters, reportSearchCondition.RecordSortor.OrderByColumnName, reportSearchCondition.RecordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;
            storeData.DataBind();
        }
        protected void ExportToExcel(object sender, EventArgs e)
        {
            RecordSortor recordSortor = new RecordSortor();

            recordSortor.OrderByColumnName = "";

            ReportSearchCondition reportSearchCondition = GetReportSearchCondition(recordSortor);

            List <SPRecordWrapper> dataSource = SPRecordWrapper.QueryRecord(reportSearchCondition.Channel, reportSearchCondition.Code, reportSearchCondition.Client, SPRecordWrapper.DayReportType_AllUp, reportSearchCondition.StartDate, reportSearchCondition.EndDate, reportSearchCondition.QueryFilters, reportSearchCondition.RecordSortor.OrderByColumnName, reportSearchCondition.RecordSortor.IsDesc);

            byte[] reportFile = ReportViewHelper.ExportListToExcel(this.rptvExport, dataSource, "DataSet1", "自定义数据导出报表");

            this.Response.Clear();
            this.Response.ContentType = "application/vnd.ms-excel";
            this.Response.AddHeader("Content-Disposition", "attachment; filename=submittedData.xls");
            this.Response.BinaryWrite(reportFile);
            this.Response.End();
        }
 public void AutoMatch(int channelID, int codeID, int clientID, string startDate, string endDate)
 {
     SPRecordWrapper.AutoMatch(channelID, codeID, clientID, DateTime.Parse(startDate), DateTime.Parse(endDate));
 }
        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            //storeData.DataSource = new List<SPRecordWrapper>();
            //storeData.DataBind();

            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e,
                                                                                                         this.
                                                                                                         PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            SPChannelWrapper channel = null;



            SPSClientWrapper client = this.Client;



            SPCodeWrapper code = null;

            if (this.cmbCode.SelectedItem != null)
            {
                code = SPCodeWrapper.FindById(Convert.ToInt32(this.cmbCode.SelectedItem.Value));
            }

            DateTime?startDate = null;

            if (this.dfStart.SelectedValue != null)
            {
                startDate = this.dfStart.SelectedDate;
            }

            DateTime?endDate = null;

            if (this.dfEnd.SelectedValue != null)
            {
                endDate = this.dfEnd.SelectedDate;
            }

            List <QueryFilter> queryFilters = new List <QueryFilter>();

            if (!string.IsNullOrEmpty(this.txtPhoneNumber.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MOBILE, this.txtPhoneNumber.Text.Trim(), FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtLinkID.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_LINKID, this.txtLinkID.Text.Trim(), FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtSpNumber.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_SPNUMBER, this.txtSpNumber.Text.Trim(), FilterFunction.StartsWith));
            }

            if (!string.IsNullOrEmpty(this.txtMo.Text.Trim()))
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MO, this.txtMo.Text.Trim(), FilterFunction.StartsWith));
            }


            queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISINTERCEPT, (false).ToString(), FilterFunction.EqualTo));


            queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSTATOK, (true).ToString(), FilterFunction.EqualTo));


            //if (this.cmbSycnStatus.SelectedItem != null && this.cmbSycnStatus.SelectedItem.Value != null)
            //{
            //    queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSYCNSUCCESSED, (this.cmbSycnStatus.SelectedItem.Value == "1").ToString(), FilterFunction.EqualTo));
            //}

            if (this.cmbProvince.SelectedItem != null && this.cmbProvince.SelectedItem.Value != null)
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_PROVINCE, this.cmbProvince.SelectedItem.Value.ToString(), FilterFunction.EqualTo));
            }

            if (this.cmbOperateType.SelectedItem != null && this.cmbOperateType.SelectedItem.Value != null)
            {
                queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_OPERATORTYPE, this.cmbOperateType.SelectedItem.Value.ToString(), FilterFunction.EqualTo));
            }

            storeData.DataSource = SPRecordWrapper.QueryRecordByPage(channel, code, client, SPRecordWrapper.DayReportType_AllUp, startDate, endDate, queryFilters, recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;
            storeData.DataBind();
        }