本文整理汇总了C#中Payment类的典型用法代码示例。如果您正苦于以下问题:C# Payment类的具体用法?C# Payment怎么用?C# Payment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Payment类属于命名空间,在下文中一共展示了Payment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button_ok
// <summary>
/// 确认提交方法
/// </summary>
public void button_ok()
{
if (this.TxtDiscount.Text != null)
{
string price_fixed = double.Parse(this.TxtDiscount.Text).ToString("0.00");
Member mb = new Member();
mb = (Member)this.Owner;
mb.KeyPreview = true;
mb.panelChildren.Controls.Remove(this);
mb.panelInfor.Visible = true;
mb.lbTitle.Text = "支付信息";
if (PassValue.payments.Count != 0 && PassValue.payments.Where(payment => payment.method == "other").FirstOrDefault() != null)
{
mb.lbReceiveActual.Text = (mb.Price_Recive + double.Parse(price_fixed) - double.Parse(PassValue.payments.Where(payment => payment.method == "other").FirstOrDefault().amount)).ToString("0.00");
PassValue.payments.Remove(PassValue.payments.Where(payment => payment.method == "other").FirstOrDefault());
}
else
{
mb.lbReceiveActual.Text = (mb.Price_Recive + double.Parse(price_fixed)).ToString("0.00");
}
//银联卡支付
Payment pm = new Payment();
pm.amount = double.Parse(this.TxtDiscount.Text).ToString("0.00");
pm.method = "other";
Reasons rs = new Reasons();
rs.description = this.lbReasons.Text;
rs.id = reasonid[0];
pm.reason = rs;
PassValue.payments.Add(pm);
mb.panelChildren.Visible = true;
Form_Esc();
}
}
示例2: SubmitPayment
public ActionResult SubmitPayment(int id, double hours)
{
if (Request.HttpMethod == "POST")
{
Appointment app = svc.getAppointmentById(id);
Payment p = new Payment();
p.doctor = app.doctor;
p.type = "appointment";
p.hours = hours;
p.pay_rate = 10;
p.for_text = app.patient;
p.pay_date = DateTime.Now;
PaymentProviderService paysvc = new PaymentProviderService();
paysvc.makePayment(p);
Bill b = new Bill();
b.patient = app.patient;
b.bill_total = p.pay_rate * p.hours;
b.for_text = "appointment: " + p.doctor;
b.bill_date = DateTime.Now;
BillingProviderService billsvc = new BillingProviderService();
billsvc.addBill(b);
svc.cancelAppointment(id, false);
}
return RedirectToAction("Index");
}
开发者ID:sivarajankumar,项目名称:hospital-management-system-csce431-awsomenbinary,代码行数:29,代码来源:AppointmentController.cs
示例3: Main
public static void Main()
{
var payment1 = new Payment { AmountToPay = 25.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment2 = new Payment { AmountToPay = 5.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment3 = new Payment { AmountToPay = 2.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment4 = new Payment { AmountToPay = 17.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment5 = new Payment { AmountToPay = 300.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment6 = new Payment { AmountToPay = 350.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment7 = new Payment { AmountToPay = 295.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment8 = new Payment { AmountToPay = 5625.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment9 = new Payment { AmountToPay = 5.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
var payment10 = new Payment { AmountToPay = 12.0m, CardNumber = "1234123412341234", Name = "Mr S Haunts" };
CreateQueue();
SendMessage(payment1);
SendMessage(payment2);
SendMessage(payment3);
SendMessage(payment4);
SendMessage(payment5);
SendMessage(payment6);
SendMessage(payment7);
SendMessage(payment8);
SendMessage(payment9);
SendMessage(payment10);
Recieve();
Console.ReadLine();
}
示例4: PaymentCreate
public void PaymentCreate()
{
var liqpayConnId = "111000064";
var payment = new Payment
{
Amount = 13,
Currency = "RUB",
Connection = liqpayConnId,
};
payment.Params["description"] = "yo, liqpay";
Assert.AreEqual(0, payment.AmountPaid);
Assert.AreEqual(0, payment.AmountRefunded);
Assert.False(payment.Paid);
Assert.False(payment.Refunded);
Assert.False(payment.Cancelled);
Assert.True(string.IsNullOrEmpty(payment.Id));
payment.Save();
Assert.False(string.IsNullOrEmpty(payment.Id));
var payment2 = Payment.Get(payment.Id);
Assert.AreEqual(13, payment2.Amount);
Assert.AreEqual("RUB", payment2.Currency);
Assert.AreEqual(liqpayConnId, payment2.Connection);
Assert.AreEqual("yo, liqpay", payment2.Params["description"].ToString());
Assert.That(payment2.Created, Is.EqualTo(DateTime.UtcNow).Within(5).Minutes);
Assert.That(payment2.Modified, Is.EqualTo(DateTime.UtcNow).Within(5).Minutes);
Assert.True(payment2.PaymentUrl.Contains("unipag"));
Assert.AreEqual(payment.ToString(), payment2.ToString());
}
示例5: Insert
///<summary>Inserts one Payment into the database. Returns the new priKey.</summary>
internal static long Insert(Payment payment)
{
if(DataConnection.DBtype==DatabaseType.Oracle) {
payment.PayNum=DbHelper.GetNextOracleKey("payment","PayNum");
int loopcount=0;
while(loopcount<100){
try {
return Insert(payment,true);
}
catch(Oracle.DataAccess.Client.OracleException ex){
if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
payment.PayNum++;
loopcount++;
}
else{
throw ex;
}
}
}
throw new ApplicationException("Insert failed. Could not generate primary key.");
}
else {
return Insert(payment,false);
}
}
示例6: UpdatePaymentTest
public void UpdatePaymentTest()
{
Payment rec = new Payment { ClientId = ClientId, Amount = 0.01, Type = "Check" };
PaymentIdentity id = Service.Create(new PaymentRequest { Payment = rec });
try
{
rec = Service.Get(id).Payment;
Assert.AreEqual(ClientId, rec.ClientId);
Service.Update(
new PaymentUpdateRequest
{
Payment =
new PaymentUpdate(rec)
{
Notes = "Nunit update test",
}
});
Payment fetched = Service.Get(id).Payment;
Assert.AreEqual(ClientId, rec.ClientId);
Assert.AreEqual("Nunit update test", fetched.Notes);
}
finally
{
Service.Delete(id);
}
}
示例7: Main
static void Main(string[] args)
{
Payment customer1FirstPayment = new Payment("Laptop Lenovo", 1234.50m);
Payment customer1SecondPayment = new Payment("Laptop HP", 2345.55m);
List<Payment> customer1ListPayment= new List<Payment>() { customer1FirstPayment, customer1SecondPayment };
Payment customer2FirstPayment = new Payment("Laptop Dell", 1234.50m);
List<Payment> customer2ListPayment = new List<Payment>() { customer1FirstPayment, customer1SecondPayment };
Payment custome2SecondPayment = new Payment("Laptop Asus", 2345.55m);
Customer customer1 = new Customer("Ivancho", "Kurtev", "Ivanov", "8767890987", "sdfdfsdf sdf sf as", "+3598 8777 7819", "[email protected]", customer2ListPayment, CustomerType.Regular);
Customer customer3 = new Customer("Ivelina", "Hristov", "Nikolova", "8767890987", "sdfdfsdf sdf sf as", "+3598 8777 7819", "[email protected]", customer2ListPayment, CustomerType.Regular);
Customer customer2 = new Customer("Ivancho", "Kurtev", "Ivanov", "8767890987", "sdfdfsdf sdf sf as", "+3598 8777 7819", "[email protected]", customer2ListPayment, CustomerType.Regular);
Console.WriteLine("customer2 == customer1 - {0}",customer2 == customer1);
Console.WriteLine("customer2 != customer1 - {0}", customer2 != customer1);
Console.WriteLine("customer2.Equals(customer1) - {0}\n", customer2.Equals(customer1));
Console.WriteLine("customer2 == customer3 - {0}", customer2 == customer3);
Console.WriteLine("customer2 != customer3 - {0}", customer2 != customer3);
Console.WriteLine("customer2.Equals(customer3) - {0}\n", customer2.Equals(customer3));
var customer4 = (Customer)customer2.Clone();
customer4.FirstName = "Petko";
Console.WriteLine(customer2);
Console.WriteLine("--------------------------------------------------------------------------");
Console.WriteLine(customer4);
Console.WriteLine(customer1.CompareTo(customer4));
}
示例8: button_ok
// <summary>
/// 确认提交方法
/// </summary>
public void button_ok()
{
if (!string.IsNullOrEmpty(this.TxtDiscount.Text))
{
string price_fixed = double.Parse(this.TxtDiscount.Text).ToString("0.00");
Member mb = new Member();
mb = (Member)this.Owner;
mb.KeyPreview = true;
mb.panelChildren.Controls.Remove(this);
mb.panelInfor.Visible = true;
mb.lbTitle.Text = "支付信息";
if (PassValue.payments.Count != 0 && PassValue.payments.Where(payment => payment.method == "cash").FirstOrDefault() != null)
{
mb.lbReceiveActual.Text = (mb.Price_Recive - double.Parse(PassValue.payments.Where(payment => payment.method == "cash").FirstOrDefault().amount) + double.Parse(price_fixed)).ToString("0.00");
PassValue.payments.Remove(PassValue.payments.Where(payment => payment.method == "cash").FirstOrDefault());
}
//现金支付
Payment pm = new Payment();
if (double.Parse(this.TxtDiscount.Text) <= double.Parse(this.lbReceiveShould.Text))
{
pm.amount = this.TxtDiscount.Text;
}
else
{
pm.amount = this.lbReceiveShould.Text;
}
pm.method = "cash";
PassValue.payments.Add(pm);
mb.lbReceiveActual.Text = (mb.Price_Recive + double.Parse(pm.amount)).ToString("0.00");
mb.panelChildren.Visible = true;
Form_Esc();
}
}
示例9: GetPayments
public static IList<Payment> GetPayments()
{
IList<Payment> paymentList = new List<Payment>();
using (ManagementEntity context = new ManagementEntity())
{
try
{
var queryPayments = from p in context.Payments select p;
foreach (var item in queryPayments)
{
Payment payment = new Payment();
payment.ID = item.Id;
payment.TicketID = item.TicketId;
payment.OrderID = item.OrderId;
payment.CustomerID = item.CustomerId;
payment.PaymentStatus = (e_PaymentStatus)item.Type;
payment.Amount = item.Amount;
payment.Date = (int)item.Date.ToBinary();
payment.Destination = item.Destination;
paymentList.Add(payment);
}
}
catch (InvalidOperationException ex)
{
throw ex;
}
}
return paymentList;
}
示例10: CreatePayment
public static void CreatePayment(Payment newPayment)
{
using (ManagementEntity context = new ManagementEntity())
{
try
{
Models.Management.Payment payment = new Models.Management.Payment
{
TicketId = newPayment.TicketID,
OrderId = newPayment.OrderID,
Type = (int)e_PaymentStatus.NotPaid,//default is not paid
Amount = newPayment.Amount,
Date = DateTime.UtcNow,
Destination = newPayment.Destination
};
context.Payments.AddObject(payment);
context.SaveChanges();
}
catch (InvalidOperationException ex)
{
throw ex;
}
}
}
示例11: PaymentDto
public PaymentDto(Payment payment)
{
_PaymentID = payment.ID;
_BookingID = payment.BookingID;
_PaymentTypeId = payment.PaymentTypeId;
_ResponseMessage = payment.ResponseMessage;
}
示例12: Clone
public object Clone()
{
Payment payment = new Payment();
payment.ProductName = this.ProductName;
payment.Price = this.Price;
return payment;
}
示例13: a_AddValid
public void a_AddValid()
{
var response = client.AddPayment(entity);
WasSuccessfulTest(response);
Assert.True(response.Data.id > 0);
Assert.True(response.Data.data_saved.id == response.Data.id);
entity = response.Data.data_saved;
}
示例14: Order
public Order(Guid _UserId, Dictionary<Guid, int> _Items, Payment _PayMethod, Delivery _Delivery)
: base(_UserId)
{
PayMethod = _PayMethod;
Delivery = _Delivery;
Status = 0;
SetTime = DateTime.Now;
Items = _Items;
}
示例15: ProcessPayment
protected override void ProcessPayment(Payment payment)
{
var command = InitCommand(new AddPaymentNoteLineItemCommand());
command.Amount = payment.Amount;
command.PaymentModeId = 0; //Always zero (copied from existing app)
command.LineItemSequenceNo = Commands.Count + 1;
Commands.Add(command);
}