• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Payment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Payment的典型用法代码示例。如果您正苦于以下问题:C# Payment类的具体用法?C# Payment怎么用?C# Payment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Payment类属于命名空间,在下文中一共展示了Payment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
            }
        }
开发者ID:zhuqinliang,项目名称:Client,代码行数:38,代码来源:OtherOrder.cs


示例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();
        }
开发者ID:FantasticFiasco,项目名称:sandbox,代码行数:30,代码来源:Program.cs


示例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());
        }
开发者ID:unipag,项目名称:unipag-net,代码行数:29,代码来源:PaymentTests.cs


示例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);
     }
 }
开发者ID:nampn,项目名称:ODental,代码行数:26,代码来源:PaymentCrud.cs


示例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);
            }
        }
开发者ID:datasoftsolutions,项目名称:freshbooks-api,代码行数:30,代码来源:PaymentTest.cs


示例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));
        }
开发者ID:HristoHristov,项目名称:OOP,代码行数:29,代码来源:MainMethod.cs


示例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();
            }
        }
开发者ID:zhuqinliang,项目名称:Client,代码行数:37,代码来源:CashPayment.cs


示例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;
        }
开发者ID:vault60,项目名称:DotNetProjects,代码行数:33,代码来源:PaymentAPI.cs


示例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;
                }
            }
        }
开发者ID:vault60,项目名称:DotNetProjects,代码行数:26,代码来源:PaymentAPI.cs


示例11: PaymentDto

 public PaymentDto(Payment payment)
 {
     _PaymentID = payment.ID;
     _BookingID = payment.BookingID;
     _PaymentTypeId = payment.PaymentTypeId;
     _ResponseMessage = payment.ResponseMessage;
 }
开发者ID:senolakkas,项目名称:ferrybooking,代码行数:7,代码来源:PaymentDto.cs


示例12: Clone

    public object Clone()
    {
        Payment payment = new Payment();
        payment.ProductName = this.ProductName;
        payment.Price = this.Price;

        return payment;
    }
开发者ID:shnogeorgiev,项目名称:Software-University-Courses,代码行数:8,代码来源:Payment.cs


示例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;
 }
开发者ID:NickLarsen,项目名称:RegPointApi.NET,代码行数:8,代码来源:PaymentTests.cs


示例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;
 }
开发者ID:MariaDucu,项目名称:uCRM,代码行数:9,代码来源:Order.cs


示例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);
        }
开发者ID:asanyaga,项目名称:BuildTest,代码行数:9,代码来源:PaymentNoteEnvelopeBuilder.cs


示例16: pollingTest

    public void pollingTest()
    {
        // Enable this if you do not want to use Annotations
        // service.registerPollingListener();

        Payment payment = new Payment();
        payment.Status=ETransactionStatus.AUDITED;

        proxy.Write(payment);
    }
开发者ID:Gigaspaces,项目名称:xapnet-tutorial,代码行数:10,代码来源:EventTest.cs


示例17: notifyTest

    public void notifyTest()
    {
        // Enable this if you do not want to use Annotations
        // service.registerNotifierListener();

        Payment payment = new Payment();
        payment.Status=ETransactionStatus.CANCELLED;

        proxy.Write(payment);
    }
开发者ID:Gigaspaces,项目名称:xapnet-tutorial,代码行数:10,代码来源:EventTest.cs


示例18: btnSure_Click

        private void btnSure_Click(object sender, EventArgs e)
        {
            if (this.cboPayment.SelectedIndex < 0)
            {
                MessageBox.Show("請先選擇收費模組!");
                return;
            }

            if (this.cboSemester.Text == "")
            {
                MessageBox.Show("請先選擇學期別!");
                return;
            }

            if (this.txtPayment.Text == "")
            {
                MessageBox.Show("請先填入收費名稱!");
                return;
            }

            //讀取系統中所有的收費模組(日期設定)。
            List<Payment> pays = Payment.GetAll();
            if (pays.Count > 0)
            {
                foreach (Payment pay in pays)
                    if (pay.SchoolYear == this.intSchoolYear.Value && pay.Semester == (this.cboSemester.Text == "上學期" ? 1 : 2))
                    {
                        if (this.txtPayment.Text == pay.Name)
                        {
                            MessageBox.Show("此學期此收費名稱已存在!");
                            return;
                        }
                    }
            }

            //新增收費,這個收費是每次收費都要新增一個,例如:第一季車費、第二季車費....。
            Payment BusPayment = new Payment(txtPayment.Text, intSchoolYear.Value, cboSemester.Text == "上學期" ? 1 : 2);

            //設定收費的預設繳款到期日,如果在計算收費時沒有額外指定,就會使用這裡的設定。
            //DefaultExpiration 是關鍵字,程式會抓這個 Key,所以是固定不變的。
            //demoPayment.Extensions.Add(DateTime.Parse(((Payment)cboPayment.SelectedItem).Extensions["DefaultExpiration"]));
            BusPayment.Extensions.Add("DefaultExpiration", dtDueDate.Value.ToShortDateString());

            //BarcodeConfiguration 屬性是 Payment 的「條碼計算設定」,所以是一定要指定的
            //在畫面上就是「銀行設定」裡面的項目,可以透過 BarcodeConfiguration 類別列出與取得
            //使用者在銀行設定裡的所有設定項目,通常可能設計成讓使用者可以選擇要用那個設定。
            //demoPayment.BarcodeConfiguration = GetBarcodeConfiguration();
            //demoPayment.BarcodeConfiguration = ((BarcodeConfiguration)cboPayment.SelectedItem).BarcodeConfiguration;
            BusPayment.BarcodeConfiguration = cboPayment.SelectedItem as BarcodeConfiguration;

            //將此收費新增到資料庫中,回傳的 Payment 物件會包含新增後的 UID。
            BusPayment = Payment.Insert(BusPayment);

            this.Close();
        }
开发者ID:kobeaaron110,项目名称:mdhs,代码行数:55,代码来源:PaymentSetup.cs


示例19: btnOrder_Click

    protected void btnOrder_Click(object sender, EventArgs e)
    {
        // validate payment info
        if (ValidatePayment())
        {
            // get the cart
            CartsComponent cComp = new CartsComponent();
            Cart c = cComp.GetCartByUserName(Request.Cookies["userName"].Value);

            // get the user
            UsersComponent users = new UsersComponent();
            BLL.User u = users.GetUserByName(Request.Cookies["userName"].Value);

            // get the catalog
            CatalogComponent catalog = new CatalogComponent();
            Item it = catalog.GetItemById(c.CatalogId);

            // create a payment
            PaymentsComponent pmts = new PaymentsComponent();
            Payment pmt = new Payment();
            pmt.CardholderName = txtName.Text;
            pmt.CardNumber = txtNumber.Text;
            pmt.CardType = ddlType.SelectedValue;
            // make expiration date
            int month = Convert.ToInt32(ddlMonth.SelectedValue);
            int year = Convert.ToInt32(ddlYear.SelectedValue);
            int day = DateTime.DaysInMonth(year, month);
            DateTime dt = Convert.ToDateTime(month + "-" + day + "-" + year);
            pmt.CardExpiration = dt;
            // save the payment
            int pmtId = pmts.InsertPayment(pmt);

            // create the order
            OrdersComponent orders = new OrdersComponent();
            Order o = new Order();
            o.CatalogId = c.CatalogId;
            o.ClientId = u.ClientId;
            o.Details = c.Details;
            o.PaymentId = pmtId;
            o.Price = it.Price;
            o.OrderDate = DateTime.Now;
            // save the order
            int orderId = orders.InsertOrder(o);

            // delete the cart
            cComp.DeleteCart(c);

            // display results to user
            lblOrderNum.Text = Convert.ToString(orderId);
            pnlCC.Visible = false;
            pnlSuccess.Visible = true;
            pnlTopLabels.Visible = false;
        }
    }
开发者ID:AnnieJ54,项目名称:wsc-website-team-b,代码行数:54,代码来源:order.aspx.cs


示例20: GetDummyPayments

        private IEnumerable<Payment> GetDummyPayments()
        {
            List<Payment> payments = new List<Payment> ();
            for (int n = 0; n < 2; n++) {
                var payment = new Payment (Profile.Current, Profile.Current, 200f, "DKK", DateTime.Now);
                payment.Expenses.AddRange (GetDummyExpenses (ExpenseStatus.Paid));
                payments.Add (payment);
            }

            return payments;
        }
开发者ID:sh4na,项目名称:snuggle,代码行数:11,代码来源:ExpensesView.cs



注:本文中的Payment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PaymentMethod类代码示例发布时间:2022-05-24
下一篇:
C# PayloadData类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap