protected void pay_Click(object sender, EventArgs e) { pay.Visible = true; BankAccount bankaccount = new BankAccount(); bool lowaccbal = bankaccount.verifypayment(Session["cusid"].ToString(), Convert.ToInt16(roomnumber.Value), 1);// 1 for room reservatio verification if (lowaccbal == true) { roomavailable.Visible = false; insufficient.Visible = true; return; } else if (lowaccbal == false) { Pay pay = new Pay(); pay.confirmpay(Session["cusid"].ToString(), Convert.ToInt16(roomnumber.Value), 1); Reservations reservation = new Reservations() { cindate = Convert.ToDateTime(reservationdate.Value), cusid = Session["cusid"].ToString(), roomno = Convert.ToInt16(roomnumber.Value), rstatus = 0 }; reservation.addreservation(reservation); reserved.Visible = true; } pay.Enabled = false; }
private void button3_Click(object sender, EventArgs e) { if (Pay.Exists(startLbl.Text, endLbl.Text, UserID)) { MessageBox.Show("A pay slip has already been saved !", "Exists", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (string.IsNullOrEmpty(paidCbx.Text)) { MessageBox.Show("Has the payment been made !", "Paid", MessageBoxButtons.OK, MessageBoxIcon.Question); paidCbx.BackColor = Color.Red; return; } if (MessageBox.Show("YES or No?", "Confirm submission ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { Pay i = new Pay(Guid.NewGuid().ToString(), Convert.ToDateTime(DateTime.Now.Date).ToString("yyyy-MM-dd"), noLbl.Text, UserID, methodCbx.Text, startLbl.Text, endLbl.Text, Convert.ToInt32(weekLbl.Text), Convert.ToDouble(rateLbl.Text), Convert.ToDouble(hourTxt.Text), Convert.ToDouble(totalPayTxt.Text), Convert.ToDouble(overtimeTxt.Text), Convert.ToDouble(rateHalfTxt.Text), Convert.ToDouble(overPayTxt.Text), Convert.ToDouble(totalDeductionTxt.Text), Convert.ToDouble(totalPayTxt.Text), paidCbx.Text, DateTime.Now.ToString("dd-MM-yyyy H:m:s"), Helper.CompanyID); MySQL.Insert(i); string Query = ""; if (paidCbx.Text == "Yes") { Query = "Update schedule SET status = 'Paid' WHERE (`date` >= '" + fromDate + "' AND `date` <= '" + toDate + "') AND UserID ='" + UserID + "'"; } else { Query = "Update schedule SET status = 'Pending' WHERE (`date` >= '" + fromDate + "' AND `date` <= '" + toDate + "') AND UserID ='" + UserID + "'"; } MySQL.Query(Query); MessageBox.Show("Information Saved"); Helper.Log(Helper.UserName, "Created pay Slip " + userCbx.Text + " " + DateTime.Now); this.Close(); } }
protected void Page_Load(object sender, EventArgs e) { Stream Come = Request.InputStream; byte[] ComeByte = new byte[Come.Length]; Come.Read(ComeByte, 0, (int)Come.Length); string InputStr = Encoding.UTF8.GetString(ComeByte); if (string.IsNullOrEmpty(InputStr)) { return; } try { /*填写PayPal的sandbox地址或者正式地址*/ Pay _Pay = new Pay("https://www.sandbox.paypal.com/cgi-bin/webscr"); /*必须要验证通过,才是可靠的IPN消息。*/ if (_Pay.IPNVierfy(InputStr)) { Dictionary <string, string> GroupIpnMessage = _Pay.GroupIpnMessage(InputStr); /*执行数据库操作/或其他操作....*/ } else { /*IPN消息验证不通过...*/ } } catch (Exception ex) { throw ex; } }
// GET: Pays/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pay pay = db.Pays.Find(id); var payDetailsView = new PayDetailsView() { PayId = pay.PayId, Certificated = pay.Certificated, Date = pay.Date, Provider = pay.Provider, ProviderId = pay.ProviderId, Sales = pay.Sales }; payDetailsView.AvailableSales = db.Sales.Where(s => s.ProductInStock.ProviderId == pay.ProviderId && s.SaleState == SaleState.PendingLiquidate) .ToList(); if (pay == null) { return(HttpNotFound()); } return(View(payDetailsView)); }
public async Task <IActionResult> GetPay(int?id) { Pay pay = new Pay(); var order = await _context.Orders .Include(o => o.Car) .Include(o => o.Driver) .FirstOrDefaultAsync(m => m.OrderID == id); pay.Date = order.OrderDate; pay.Model = order.Car.FullName; pay.Name = order.Driver.FullName; pay.Price = (int)order.Price; System.Xml.Serialization.XmlSerializer xml = new System.Xml.Serialization.XmlSerializer(typeof(Pay)); var stream = new System.IO.MemoryStream(); xml.Serialize(stream, pay); stream.Flush(); var data = stream.GetBuffer(); stream.Close(); string name = order.OrderDate.Date.Month.ToString() + " " + order.OrderDate.Date.Day.ToString() + "_" + order.OrderID; return(File(data, "application/xhtml+xml", name + ".xml")); }
/// <summary> /// 扫码支付模式一生成二维码 /// </summary> /// <param name="id">订单号</param> public void NativePayOne(string id) { SortedDictionary <string, object> orderParams = new SortedDictionary <string, object>(); orderParams.Add("appid", ApiModel.AppID); //公众帐号id orderParams.Add("mch_id", ApiModel.MchID); //商户号 orderParams.Add("time_stamp", Common.GetTimeStamp()); //时间戳 orderParams.Add("nonce_str", Common.GetNonceStr()); //随机字符串 orderParams.Add("product_id", id); //商品订单号 orderParams.Add("sign", Pay.GetSign(orderParams, ApiModel.MchAPISecret)); //签名 //预支付URL var url = Pay.GetPayUrlForNativeOne(orderParams); //初始化二维码生成工具 QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; qrCodeEncoder.QRCodeVersion = 0; qrCodeEncoder.QRCodeScale = 4; //将字符串生成二维码图片 Bitmap image = qrCodeEncoder.Encode(url, Encoding.Default); //保存为PNG到内存流 MemoryStream ms = new MemoryStream(); image.Save(ms, ImageFormat.Png); //输出二维码图片 Response.BinaryWrite(ms.GetBuffer()); Response.End(); }
public ActionResult DeleteConfirmed(int id) { Pay pay = db.Pays.Find(id); db.Pays.Remove(pay); try { db.SaveChanges(); } catch (Exception ex) { if (ex.InnerException != null && ex.InnerException.InnerException != null && ex.InnerException.InnerException.Message.Contains("REFERENCE")) { ViewBag.Error = "The pay can not be deleted because it has related sales"; } else { ViewBag.Error = ex.Message; } return(View(pay)); } return(RedirectToAction("Index")); }
public async Task <IActionResult> Edit(int id, [Bind("id,payee,money,bank,payDay,payMonth,insdate")] Pay pay) { if (id != pay.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pay); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PayExists(pay.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pay)); }
public IHttpActionResult Payment_Info(Pay payment) { if (User.Identity.IsAuthenticated == true) { var _insert = new Pay { Amount = payment.Amount, Total_Price = payment.Total_Price, TG_id = payment.TG_id, Price = payment.Price, Pay_method = payment.Pay_method, Status = "Unpaid", Cart_date = DateTime.Now }; var a = db.Pay.Add(_insert); db.SaveChanges(); return(Ok(a.id)); } else { return(Ok("")); //return Ok("<html><script>alert('Please use after Login.'); window.top.location.href = '/Home/Login';</script></html>"); } }
public void Pay() { Console.WriteLine("\t\tHacer pago de la infracción:"); Pay pay = new Pay(); pay.PayBill(); }
public async Task <IActionResult> Edit(int id, [Bind("ID,LastUpdatedDate,Year,GrossMonthlyIncome,GrossYearlyIncome,TaxableMonthlyGross,NetMonthly,NetYearly,Name")] Pay pay) { if (id != pay.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pay); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PayExists(pay.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pay)); }
public async Task <IActionResult> Edit(int id, Pay pay) { if (id != pay.Id) { return(NotFound()); } if (ModelState.IsValid) { try { pay.Paid += pay.owe; pay.Update_at = DateTime.Now; _context.Update(pay); HttpContext.Session.SetString("SuccessMessage", "Cập nhật thành công"); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PayExists(pay.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdRepair"] = new SelectList(_context.Repairs, "Id", "Id", pay.IdRepair); return(View(pay)); }
/// <summary> /// 修改 /// </summary> /// <param name="model"></param> /// <returns></returns> public WebResult <bool> Update_Pay(Pay model) { if (model == null || !model.Name.IsNotNullOrEmpty() ) { return(Result(false, ErrorCode.sys_param_format_error)); } using (DbRepository entities = new DbRepository()) { var oldEntity = entities.Pay.Find(model.ID); if (oldEntity != null) { if (entities.Pay.AsNoTracking().Where(x => x.Name.Equals(model.Name) && x.StoreId.Equals(model.StoreId) && !x.ID.Equals(model.ID)).Any()) { return(Result(false, ErrorCode.datadatabase_name_had)); } if (entities.Pay.AsNoTracking().Where(x => x.NO.Equals(model.NO) && x.StoreId.Equals(model.StoreId) && !x.ID.Equals(model.ID)).Any()) { return(Result(false, ErrorCode.datadatabase_no_had)); } oldEntity.RealMoney = model.RealMoney; oldEntity.NO = model.NO; oldEntity.Name = model.Name; oldEntity.StoreId = model.StoreId; oldEntity.UpdatedTime = DateTime.Now; } else { return(Result(false, ErrorCode.sys_param_format_error)); } return(entities.SaveChanges() > 0 ? Result(true) : Result(false, ErrorCode.sys_fail)); } }
public void TestElementWithParams() { var elem = new Pay( Pay.InputEnum.Dtmf, new Uri("https://example.com"), new Uri("https://example.com"), Pay.StatusCallbackMethodEnum.Get, 1, 1, true, "postal_code", "payment_connector", Pay.TokenTypeEnum.OneTime, "charge_amount", Pay.CurrencyEnum.Usd, "description", Promoter.ListOfOne(Pay.ValidCardTypesEnum.Visa), Pay.LanguageEnum.DeDe ); Assert.AreEqual( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + "<Pay input=\"dtmf\" action=\"https://example.com\" statusCallback=\"https://example.com\" statusCallbackMethod=\"GET\" timeout=\"1\" maxAttempts=\"1\" securityCode=\"true\" postalCode=\"postal_code\" paymentConnector=\"payment_connector\" tokenType=\"one-time\" chargeAmount=\"charge_amount\" currency=\"usd\" description=\"description\" validCardTypes=\"visa\" language=\"de-DE\"></Pay>", elem.ToString() ); }
public void CertificateState() { //Setup var provider = new Provider() { PersonId = 1, Name = "Carlos", LastName = "Mambrake", }; var pay = new Pay() { Date = DateTime.Now, Provider = provider, ProviderId = 1, Certificated = false, }; var payManager = new PayManager(dataServiceMock.Object); var salesList = payManager.GetPendingToLiquidateSales(provider); pay.SaleList = salesList; //Act payManager.CertificatePay(pay); //Asserts dataServiceMock.Verify(m => m.Update <Pay>(pay), Times.Exactly(1)); dataServiceMock.Verify(m => m.Update <Sale>(It.IsAny <Sale>()), Times.Exactly(2)); Assert.IsTrue(pay.Certificated); Assert.AreEqual(SaleState.Certificated, sales.ElementAt(0).SaleState); Assert.AreEqual(SaleState.Certificated, sales.ElementAt(1).SaleState); }
public int AddRemarks(Pay pay) { db.Pay.Add(pay); int result = db.SaveChanges(); return(result); }
private void clearControls() { sale = new Sale(); sale.UserId = User.instance.Id; pay = new Pay(); pay.UserId = User.instance.Id; sale.Quantity = 1; panelVenta.Enabled = true; panelClient.Enabled = true; cboProduct.SelectedIndex = -1; txtPrice.Text = "0"; txtQuantity.Text = "1"; txtWeight.Text = "0"; txtTotal.Text = "0"; txtClient.Text = string.Empty; txtObservations.Text = string.Empty; txtSumPays.Text = "0"; txtDifPays.Text = "0"; btnPrint.Enabled = false; lvwPays.Items.Clear(); btnAddPay.Enabled = true; btnAddSale.Enabled = true; btnAddSale.Tag = 0; lvwPays.Tag = 0; }
public async Task <ActionResult> Pay([FromBody] Pay pay) { Invoice invoice = await _context.Invoices.Where(x => x.id == pay.Invoice_id).FirstOrDefaultAsync(); if (invoice.Total >= pay.amount && (invoice.Balance + pay.amount) <= invoice.Total) { Payment payment = new Payment() { Total = pay.amount }; await _context.AddAsync(payment); invoice.Payments = invoice.Payments == null ? new List <Payment>(): invoice.Payments; invoice.Payments.Add(payment); invoice.Balance = invoice.Balance + pay.amount; _context.Entry(invoice).State = EntityState.Modified; await _context.SaveChangesAsync(); return(Ok()); } else { if (invoice.Balance == invoice.Total) { return(BadRequest("Invoices can't be overpaid")); } } return(BadRequest("The amount is greater than the total")); }
async Task <Subscribe> HandleSimulatePayAsync(Pay pay, TradeResultModel model) { string userId = pay.Bill.UserId; if (userId != _adminSettings.Id) { return(null); } if (!model.Payed) { return(null); } if (pay.HasMoney) { return(null); //不處理重複發送的資料 } pay.Money = Convert.ToDecimal(model.Amount); pay.PayedDate = model.PayedDate.ToDatetimeOrNull(); pay.TradeNo = model.TradeNo; pay.TradeData = model.Data; pay.Removed = false; await _paysService.UpdateAsync(pay); if (pay.Bill.Removed) { pay.Bill.Removed = false; await _billsService.UpdateAsync(pay.Bill); } return(await OnPayedAsync(pay)); }
public async Task <bool> Pay(Guid idAccount, double amount) { var account = _accountService.GetAccountById(idAccount).Result; var bank = _bankService.GetBankById(account.IdBank); if (account.Invalid && bank.Invalid) { return(false); } Pay pay = new Pay(amount, DateTime.Now, account, bank); if (PayMade(pay) is false) { return(false); } var updatedAccount = await _accountService.UpdateAccount(account); if (UpdateMade(updatedAccount) is false) { return(false); } var bankStatement = new BankStatement(Enum.GetName(typeof(TransactionType), TransactionType.Pay), DateTime.Now, amount, account.Balance, account.Id, account.IdOwner); var insertedBankStatement = await _bankStatementService.RegisterBankStatement(bankStatement); return(updatedAccount && insertedBankStatement); }
public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,CreditNum,ExpireMonth,ExpireYear,OwnName,IdNum,CW")] Pay pay) { if (id != pay.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pay); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PayExists(pay.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pay)); }
/// <summary> /// 删除 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int Delete(BaseEntity p_Entity) { try { Pay MasterEntity = (Pay)p_Entity; if (MasterEntity.ID == 0) { return(0); } //删除主表数据 string Sql = ""; Sql = "DELETE FROM Finance_Pay WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID); //执行 int AffectedRows = 0; if (!this.sqlTransFlag) { AffectedRows = this.ExecuteNonQuery(Sql); } else { AffectedRows = sqlTrans.ExecuteNonQuery(Sql); } return(AffectedRows); } catch (BaseException E) { throw new BaseException(E.Message, E); } catch (Exception E) { throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBDelete), E); } }
/// <summary> /// Creates the sample by square XML document. /// </summary> /// <param name="configuration">The configuration for external generator (<see cref="BySquareExternalEncoder"/>).</param> private BySquareXmlDocuments CreateSampleBySquareXmlDocument(ExternalGeneratorSettings configuration) { var account1 = new BankAccount { IBAN = "SK2911000000005902208743", BIC = "TATRSKBX" }; var account2 = new BankAccount { IBAN = "SK2011000000002619521810", BIC = "TATRSKBX" }; var payment = new Payment(account1, account2) { Amount = 10, PaymentNote = "poznamka", OriginatorsReferenceInformation = "reference" }; var pay = new Pay(payment); var bySquareXmlDocuments = new BySquareXmlDocuments(pay) { Username = configuration.Username, Password = configuration.Password, ServiceId = configuration.ServiceId, ServiceUserId = configuration.ServiceUserId, }; return(bySquareXmlDocuments); }
public async Task <bool> StoreNewPayAsync(int EmployeeId, Pay Pay) { Pay.EmployeeId = EmployeeId; _context.Pays.Add(Pay); return((await _context.SaveChangesAsync()) > 0); }
private void btnPay_Click(object sender, RoutedEventArgs e) { if (TableInfo.lstOrder.Count < 0) { return; } Pay Pay = Pay.Card; if (!(bool)btnCard.IsChecked) { Pay = Pay.Money; } string Title = "결제확인"; App.TableViewModel.Order(TableInfo.Number); MessageBoxResult messageBoxResult = MessageBox.Show(Pay + "\n" + TableInfo.Orders, Title, MessageBoxButton.YesNo); if ((int)messageBoxResult == (int)MessageBoxResult.Yes) { App.FoodViewModel.Add(TableInfo.lstOrder, Pay); this.Visibility = Visibility.Collapsed; App.TableViewModel.TableInfoClear(TableInfo.Number); } return; }
public bool Update(Pay entity) { try { var model = db.Pay.Find(entity.ID); model.Name = entity.Name; model.WebCode = entity.WebCode; model.EmailPay = entity.EmailPay; model.AccessCode = entity.AccessCode; model.GuidePay = entity.GuidePay; model.CodeAuthencation = entity.CodeAuthencation; model.CodeRepeat = entity.CodeRepeat; model.AIPUserName = entity.AIPUserName; model.AIPPassword = entity.AIPPassword; model.AIPSignature = entity.AIPSignature; model.AIPKey = entity.AIPKey; model.Currency = entity.Currency; model.Terminalld = entity.Terminalld; model.MerchantAccount = entity.MerchantAccount; model.HashCode = entity.HashCode; model.Disable = entity.Disable; model.Enable = entity.Enable; model.Visitor = entity.Visitor; model.Status = entity.Status; db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
/// <summary> /// 增加 /// </summary> /// <param name="model"></param> /// <returns></returns> public WebResult <bool> Add_Pay(Pay model) { if (model == null || !model.Name.IsNotNullOrEmpty() ) { return(Result(false, ErrorCode.sys_param_format_error)); } using (DbRepository entities = new DbRepository()) { var query = entities.Store.AsQueryable(); if (entities.Pay.AsNoTracking().Where(x => x.Name.Equals(model.Name) && x.StoreId.Equals(model.StoreId)).Any()) { return(Result(false, ErrorCode.datadatabase_name_had)); } if (entities.Pay.AsNoTracking().Where(x => x.NO.Equals(model.NO) && x.StoreId.Equals(model.StoreId)).Any()) { return(Result(false, ErrorCode.datadatabase_no_had)); } model.ID = Guid.NewGuid().ToString("N"); model.CompanyId = Client.LoginUser.CompanyId; model.UserId = Client.LoginUser.ID; model.CreatedTime = DateTime.Now; model.UpdatedTime = DateTime.Now; model.Flag = (long)GlobalFlag.Normal; entities.Pay.Add(model); return(entities.SaveChanges() > 0 ? Result(true) : Result(false, ErrorCode.sys_fail)); } }
public async Task <IActionResult> Edit(string id, [Bind("PayBand,BasicSalary")] Pay pay) { if (id != pay.PayBand) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pay); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PayExists(pay.PayBand)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pay)); }
public void SupprPays(Pay a) { using (var db = new MarcassinEntities1()) { Pay b = db.Pays.Find(a.id_Pays); db.Pays.Remove(b); db.SaveChanges(); } }
public ActionResult DeleteConfirmed(int id) { Pay pay = db.Pays.Find(id); db.Pays.Remove(pay); db.SaveChanges(); return(RedirectToAction("Index")); }
//------------------------------------------------------------------------- public static Pay Instant() { if (mPay == null) { mPay = new Pay(); } GameObject openiab_msg_receiver = GameObject.Find(OPENIAB_EVENT_RECEIVER); if (openiab_msg_receiver == null) { openiab_msg_receiver = new GameObject(OPENIAB_EVENT_RECEIVER); openiab_msg_receiver.AddComponent<OpenIABEventManager>(); GameObject.DontDestroyOnLoad(openiab_msg_receiver); } return mPay; }