/// <summary> /// 退票申请 /// </summary> /// <param name="out_trade_no"></param> /// <returns></returns> private bool sendReturnTicketMessage(string out_trade_no) { PaymentDao pDao = new PaymentDao(); try { PaymentDataResults paymentDataResults = pDao.getPayData(out_trade_no); double refundFee = Math.Round(Convert.ToDouble(paymentDataResults.billPrice) * 0.8, 2); WxJsonResult wxJsonResult = TemplateApi.SendTemplateMessage(Global.APPID, paymentDataResults.openId, Global.ReturnTicketTemplate, new { keyword1 = new { value = paymentDataResults.billid }, keyword2 = new { value = refundFee }, keyword3 = new { value = paymentDataResults.refundTime }, keyword4 = new { value = "退票申请中,等待商家处理" }, keyword5 = new { value = "退款说明" } }, paymentDataResults.formId, "/pages/orderList/orderList?num=1", "keyword3.DATA"); return(true); } catch (Exception ex) { return(false); } }
public ActionResult PaymentsHistorySearch(string profileId) { if (profileId == null || profileId.Equals("")) { return(View("Error")); } List <Payment> payments = null; try { payments = new PaymentDao().PaymentsSearch(profileId, "MemberCode"); if (payments != null && payments.Count > 0) { ViewBag.Message = "You are editing " + payments[0].MemberName; ViewData["SearchResult"] = payments; } } catch (Exception e) { ViewBag.Message = e.Message; return(View("Error")); } return(View("PaymentHistory")); }
public static int SavePayment(PaymentViewModel paymentVM) { Payment p = Mapper.Map(paymentVM); var result = new PaymentDao().Save(p); return(result); }
/// <summary> /// 待支付 /// </summary> /// <param name="out_trade_no"></param> /// <returns></returns> private bool sendToBePayMessage(string out_trade_no) { PaymentDao pDao = new PaymentDao(); try { PaymentDataResults paymentDataResults = pDao.getPayData(out_trade_no); WxJsonResult wxJsonResult = TemplateApi.SendTemplateMessage(Global.APPID, paymentDataResults.openId, Global.ToBePayTemplate, new { keyword1 = new { value = paymentDataResults.billid }, keyword2 = new { value = paymentDataResults.billPrice }, keyword3 = new { value = paymentDataResults.billValue }, keyword4 = new { value = paymentDataResults.bookingTime }, keyword5 = new { value = "待支付" }, keyword6 = new { value = "船票已预订,请在10分钟内付款,否则船票会被回收!" } }, paymentDataResults.formId, "/pages/orderList/orderList?num=0", "keyword3.DATA"); return(true); } catch (Exception ex) { return(false); } }
public ActionResult MemberLastPaymentReport() { List <MemberPayment> membersLastPaidList = new PaymentDao().MemberLastPaymentReport(); ViewData["SearchResult"] = membersLastPaidList; //ViewBag.Message = Convert.ToInt32(selectedMonth); return(View("MemberLastPaymentReport")); }
public void Delete(Payment payment) { Require.NotNull(payment, "payment"); if (payment.PaymentStatus == PaymentStatus.Accecpted) { throw new InvalidOperationException("Die Zahlung wurde bereits akzeptiert und gebucht."); } PaymentDao.Delete(payment); }
public void byDay() { lsvGeneralReport.Items.Clear(); //in ReceiptDao r = new ReceiptDao(); var incomes = r.GetReceiptList(); IDictionary <DateTime, double> list = new Dictionary <DateTime, double>(); list.Add(incomes[0].PrintDate.Date, incomes[0].Total + incomes[0].AdditionalFee); for (int i = 1; i < incomes.Count; i++) { if (!list.ContainsKey(incomes[i].PrintDate.Date)) { list.Add(incomes[i].PrintDate.Date, incomes[i].Total + incomes[i].AdditionalFee); } else { list[incomes[i].PrintDate.Date] += incomes[i].Total + incomes[i].AdditionalFee; } } //out PaymentDao p = new PaymentDao(); var outcomes = p.GetPaymentList(); IDictionary <DateTime, double> list1 = new Dictionary <DateTime, double>(); list1.Add(outcomes[0].PayDate.Date, outcomes[0].TotalFee); for (int i = 1; i < outcomes.Count; i++) { if (!list1.ContainsKey(outcomes[i].PayDate.Date)) { list1.Add(outcomes[i].PayDate.Date, outcomes[i].TotalFee); } else { list1[outcomes[i].PayDate.Date] += outcomes[i].TotalFee; } } foreach (KeyValuePair <DateTime, double> kvp in list) { string[] row = { kvp.Key.ToString(), kvp.Value.ToString(), "", (kvp.Value - 0).ToString() }; ListViewItem item = new ListViewItem(row); lsvGeneralReport.Items.Add(item); foreach (KeyValuePair <DateTime, double> kvp1 in list1) { if (kvp1.Key.Date == kvp.Key.Date) { string[] rows = { kvp.Key.ToString(), kvp.Value.ToString(), kvp1.Value.ToString(), (kvp.Value - kvp1.Value).ToString() }; item = new ListViewItem(rows); lsvGeneralReport.Items.RemoveAt(lsvGeneralReport.Items.Count - 1); lsvGeneralReport.Items.Add(item); } } } }
public ActionResult ReceiptsListReport() { string selectedMonth = this.Request.QueryString["monthId"]; if (selectedMonth == null || "".Equals(selectedMonth)) { selectedMonth = DateTime.Now.Month.ToString(); } List <SysReceipts> memberPayments = new PaymentDao().ReceiptsListReport(Convert.ToInt32(selectedMonth)); ViewData["SearchResult"] = memberPayments; ViewBag.Message = Convert.ToInt32(selectedMonth); return(View("ReceiptsListReport")); }
private string createBill(string openId, PaymentParam paymentParam) { PaymentDao pDao = new PaymentDao(); string pre = DateTime.Now.ToString("yyyyMMddHHmm"); string billId = pre + "XC" + TenPayV3Util.BuildRandomStr(4); if (pDao.saveOrder(openId, billId, paymentParam)) { return(billId); } else { throw new ApiException(CodeMessage.InitOrderError, "InitOrderError"); } }
public ActionResult MemberDayWiseCollectionReport() { List <PaymentReport> memberPayments = null; string selectedPaymentDate = this.Request.QueryString["PaymentDate"]; string displayDate = selectedPaymentDate; if (string.IsNullOrEmpty(selectedPaymentDate)) { selectedPaymentDate = DateTime.Now.ToString(); displayDate = DateTime.Now.ToString("dd/MM/yyyy"); } memberPayments = new PaymentDao().MemberCollectionReport(Convert.ToDateTime(selectedPaymentDate)); ViewData["SearchResult"] = memberPayments; ViewBag.Message = displayDate; return(View("MemberCollectionsReport")); }
/// <summary> /// 调用支付 /// </summary> /// <param name="baseApi"></param> /// <returns></returns> public object Do_PaymentDone(BaseApi baseApi) { PaymentDoneParam param = JsonConvert.DeserializeObject <PaymentDoneParam>(baseApi.param.ToString()); if (param == null) { throw new ApiException(CodeMessage.InvalidParam, "InvalidParam"); } if (param.payId == null || param.payId == "") { throw new ApiException(CodeMessage.InterfaceValueError, "InterfaceValueError"); } if (param.billId == null || param.billId == "") { throw new ApiException(CodeMessage.InterfaceValueError, "InterfaceValueError"); } string openId = Utils.GetOpenID(baseApi.token); PaymentDao pDao = new PaymentDao(); if (pDao.updateOrderForPay(param.billId, param.payId)) { string SetPayIdResult = SetPayId(Global.XCPOSCODE, param.billId, param.payId); WebBillIdResult web1 = JsonConvert.DeserializeObject <WebBillIdResult>(SetPayIdResult); if (web1.MESSAGE[0].IS_SUCCESS == "TRUE") { string PayTicketDoneResult = PayTicketDone(Global.XCPOSCODE, param.billId, param.payId).Replace("\"Msg\":]", "\"Msg\":[]"); WebBillIdResult web2 = JsonConvert.DeserializeObject <WebBillIdResult>(PayTicketDoneResult); if (web2.MESSAGE[0].IS_SUCCESS == "TRUE") { pDao.insertPayLog(param.billId, param.payId, "0", openId, "携程支付完成-成功"); } else { pDao.insertPayLog(param.billId, param.payId, "0", openId, "携程支付失败-确认付款失败"); } } else { pDao.insertPayLog(param.billId, param.payId, "0", openId, "携程支付失败-同步设置支付单号失败"); } } else { pDao.insertPayLog(param.billId, param.payId, "0", openId, "携程支付失败-修改订单状态失败"); } return(""); }
public PaymentDTO GetPaynemtById(int id) { try { var data = new PaymentDao().GetById(id); return(new PaymentDTO() { ID = data.ID, PaymentName = data.PaymentName }); } catch (Exception e) { Console.WriteLine(e); return(null); } }
public ActionResult MemberPayment(Payment payment) { if (!ModelState.IsValid) { return(View("Error")); } PaymentDao paymentDao = new PaymentDao(); try { paymentDao.InsertMemberPayments(payment); ViewBag.Message = "Thank you for payment " + payment.MemberName; } catch (Exception e) { ViewBag.Message = e.Message; return(View("Error")); } return(View("PaymentHistory")); }
public void byMonth() { lsvGeneralReport.Items.Clear(); ReceiptDao r = new ReceiptDao(); PaymentDao p = new PaymentDao(); var incomes = r.GetReceiptList(); for (int i = 1; i <= 12; i++) { if (i >= 10) { string[] rows = { "Tháng " + i, "" + r.GetByMonth(i.ToString()), "" + p.GetByMonth(i.ToString()), (r.GetByMonth(i.ToString()) - p.GetByMonth(i.ToString())).ToString() }; ListViewItem item = new ListViewItem(rows); lsvGeneralReport.Items.Add(item); } else { string[] rowss = { "Tháng " + i, "" + r.GetByMonth("0" + i.ToString()), "" + p.GetByMonth("0" + i.ToString()), (r.GetByMonth("0" + i.ToString()) - p.GetByMonth("0" + i.ToString())).ToString() }; var item = new ListViewItem(rowss); lsvGeneralReport.Items.Add(item); } } }
public static PaymentController GetPaymentController() { var paymentDao = new PaymentDao(() => new PaymentsReadDbContext(PaymentsReadDbContext.SchemaName)); return(new PaymentController(ConferenceHelper.BuildCommandBus(), paymentDao)); }
/// <summary> /// Ruft alle offenen Zahlungen für einen Nutzer ab. /// </summary> /// <param name="pageRequest"></param> /// <param name="user"></param> /// <returns></returns> public IPage <Payment> FindPendingPaymentsByUser(IPageable pageRequest, User user) { return(PaymentDao.FindPendingPaymentsByUser(pageRequest, user)); }
public ActionResult Report() { List <PaymentViewModel> paymentsList = new PaymentDao().GetAllPayments(); return(View(paymentsList)); }
public static PaymentViewModel GetPayment(DateTime dateOfPayment, string description, decimal sum, decimal balance) { var result = new PaymentDao().GetPayment(dateOfPayment, description, sum, balance); return(Mapper.Map(result)); }
public void SetUp() { paymentDao = new PaymentDao(); }