示例#1
0
        public IHttpActionResult SearchPaymentRecord(PaymentSearchRequest model)
        {
            GetRecordListResponse <PaymentRecordResponse> response = new GetRecordListResponse <PaymentRecordResponse>()
            {
                IsSuccess      = true,
                MessageCode    = (int)ApiBaseErrorCode.API_SUCCESS,
                MessageContent = ApiBaseErrorCode.API_SUCCESS.ToString()
            };

            if (string.IsNullOrWhiteSpace(model.ParkingCode))
            {
                response.IsSuccess      = false;
                response.MessageCode    = (int)ApiBaseErrorCode.API_PARAM_ERROR;
                response.MessageContent = "车场编码不能为空,请检查";
                return(Ok(response));
            }
            GetRecordListResponse <PaymentRecordResponse> opengatereasonlistmodel = _reportManager.SearchPaymentRecord(model);

            if (opengatereasonlistmodel != null)
            {
                response = opengatereasonlistmodel;
            }
            else
            {
                response.IsSuccess      = false;
                response.MessageCode    = (int)ApiPersonnelErrorCode.API_DATA_NULL_ERROR;
                response.MessageContent = ApiPersonnelErrorCode.API_DATA_NULL_ERROR.ToString();
            }
            return(Ok(response));
        }
示例#2
0
        public async Task <ResponseList <PaymentResponse> > Search(PaymentSearchRequest request)
        {
            var payments = await _uow.Payments.Search(request?.OnlyActive);

            var response = payments.Select(x => _mapService.MapPayment(x)).ToList();

            return(new ResponseList <PaymentResponse>(ResponseStatus.Ok, response));
        }
示例#3
0
        /// <summary>
        /// 查询缴费记录(报表)
        /// </summary>
        /// <param name="parkCode"></param>
        /// <returns></returns>
        public GetRecordListResponse <PaymentRecordResponse> SearchPaymentRecord(PaymentSearchRequest model)
        {
            GetRecordListResponse <PaymentRecordResponse> responseModel = null;
            RequestFujicaReportStatistical requestFujica = new RequestFujicaReportStatistical();
            //请求方法
            string servername = "SearchRecord/SearchPaymentRecord";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["Id"] = model.Id;
            dicParam["ParkingRecordCode"]  = model.ParkingRecordCode;
            dicParam["ParkingCode"]        = model.ParkingCode;
            dicParam["LicensePlate"]       = model.LicensePlate;
            dicParam["CarType"]            = model.CarType;
            dicParam["DealNo"]             = model.DealNo;
            dicParam["UserCode"]           = model.UserCode;
            dicParam["OpenId"]             = model.OpenId;
            dicParam["PhoneNumber"]        = model.PhoneNumber;
            dicParam["Subject"]            = model.Subject;
            dicParam["TollOperator"]       = model.TollOperator;
            dicParam["InvoiceCode"]        = model.InvoiceCode;
            dicParam["InvoiceState"]       = model.InvoiceState;
            dicParam["PaymentType"]        = model.PaymentType;
            dicParam["OrderType"]          = model.OrderType;
            dicParam["AdmissionStartDate"] = model.AdmissionStartDate;
            dicParam["AdmissionEndDate"]   = model.AdmissionEndDate;
            dicParam["BillingStartTime"]   = model.BillingStartTime;
            dicParam["BillingDeadline"]    = model.BillingDeadline;
            dicParam["PaymentStartDate"]   = model.PaymentStartDate;
            dicParam["PaymentEndDate"]     = model.PaymentEndDate;
            dicParam["InvoiceStartTime"]   = model.InvoiceStartTime;
            dicParam["InvoiceEndTime"]     = model.InvoiceEndTime;
            dicParam["NextToken"]          = model.NextToken; //就是第一次查询,需要制定当前页  页大小 ,需要下一页的时候,直接给这个nexttoken就可以了
            dicParam["PageIndex"]          = model.PageIndex;
            dicParam["PageSize"]           = model.PageSize;
            dicParam["Sort"]      = model.Sort;
            dicParam["FieldSort"] = model.FieldSort;
            bool falg = requestFujica.RequestFujicaReport(servername, dicParam);

            if (falg)
            {
                string fujicaResult = requestFujica.FujicaResult;
                if (!string.IsNullOrEmpty(fujicaResult))
                {
                    //解析返回参数json字符串
                    GetRecordListResponse <PaymentRecordResponse> response = m_serializer.Deserialize <GetRecordListResponse <PaymentRecordResponse> >(fujicaResult);
                    //List<MCoupon> ls = m_serializer.Deserialize<List<MCoupon>>(dicFujicaResult["CouponList"].ToString());
                    //responseModel.CouponList = ls;
                    responseModel = response;
                }
            }
            return(responseModel);
        }
        public List <Data.Model.Payments> Get(PaymentSearchRequest req)
        {
            var query = _context.Payments.AsQueryable();

            if (req.scheduleID.HasValue)
            {
                query = query.Where(p => p.ScheduleID == req.scheduleID);
            }
            var list = query.ToList();

            return(_mapper.Map <List <Data.Model.Payments> >(list));
        }
        private async void BtnSearch_Click(object sender, EventArgs e)
        {
            PaymentSearchRequest request = new PaymentSearchRequest
            {
                FirstName = txtFirstName.Text,
                LastName  = txtLastName.Text,
                Treatment = txtTreatment.Text,
            };

            if (checkBoxDate.Checked)
            {
                request.DateFrom = null;
                request.DateTo   = null;
            }
            else
            {
                request.DateFrom = dtpFrom.Value.Date;
                request.DateTo   = dtpTo.Value.Date;
                if (request.DateTo.Value.Date < request.DateFrom.Value.Date)
                {
                    MessageBox.Show("Date To field must be greater than field Date From");
                    return;
                }
            }

            var result = await _paymentService.GetAll <List <Payment> >(request);

            List <frmPaymentsDataVM> payments = new List <frmPaymentsDataVM>();

            foreach (var item in result)
            {
                frmPaymentsDataVM payment = new frmPaymentsDataVM
                {
                    PaymentID = item.PaymentID,
                    FirstName = item.User.FirstName,
                    LastName  = item.User.LastName,
                    Treatment = item.Treatment.Name,
                    Amount    = item.Amount.ToString(),
                    Date      = item.Date.ToString("MM/dd/yyyy")
                };
                payments.Add(payment);
            }
            dgvPayments.AutoGenerateColumns = false;
            dgvPayments.DataSource          = payments;
            if (payments.Count == 0)
            {
                MessageBox.Show("There are not results for this search", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
示例#6
0
        private async void BtnSearch_Click(object sender, EventArgs e)
        {
            var objId = cmbClient.SelectedValue;
            if (int.TryParse(objId.ToString(), out int id))
            {
                userId = id;
            }

            PaymentSearchRequest request = new PaymentSearchRequest
            {
                UserId = userId
            };

            dgvPayments.DataSource = await _apiService.GetAll<List<Model.Payment>>(request);
        }
示例#7
0
        public async Task <IHttpActionResult> Search([FromUri] PaymentSearchRequest request)
        {
            var response = await _paymentService.Search(request);

            return(new CreateResult(response));
        }
 public List <Data.Model.Payments> Get([FromQuery] PaymentSearchRequest req)
 {
     return(_service.Get(req));
 }