private void LoadPaymentsByStudent(object selected) { PaymentModule module = new PaymentModule(); listBox2.Items.Clear(); module.LoadConsultPaymentsByStudent(selected, listBox2); }
public void VideoToSkiPaymentTest() { PaymentModule product = new PaymentModule(new VideoToSki()); bool result = product.PayForTheProduct(0.0); Assert.Equals(result, true); }
public void LoadLabels() { PaymentModule module = new PaymentModule(); labelTitle.Text = module.Name; labelDescription.Text = module.Description; }
public void UpgradeToMembershipPaymentTest() { PaymentModule product = new PaymentModule(new UpgradeToMembership()); bool result = product.PayForTheProduct(0.0); Assert.Equals(result, true); }
public void BookPaymentTest() { //generate a duplicate packing slip for royalty department PaymentModule product = new PaymentModule(new Book()); bool result = product.PayForTheProduct(0.0); Assert.Equals(result, true); }
public void PhysicalProductPaymentTest() { //generate a packing slip for shipping PaymentModule product = new PaymentModule(new PhysicalProduct()); bool result = product.PayForTheProduct(0.0); Assert.Equals(result, true); }
public HttpResponseMessage SavePostPayment(PaymentModule paymentModule) { var paymentResponse = _iPaymentsCore.PostSavePayment(paymentModule); var output = new OutputResponse() { IsSuccess = paymentResponse }; HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, output); return(response); }
private void saveButton_Click(object sender, EventArgs e) { if (IsListSelected()) { PaymentModule module = new PaymentModule(); Object selected = (Object)listStudents.SelectedItem; try { module.AddSubscription(selected, (int)numericMaxYear.Value, (int)numericUpDownMonth.Value); MessageBox.Show("Se ha pagado la subscripcion con exito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); GoBackMenu(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void saveButton_Click(object sender, EventArgs e) { if (IsListSelected()) { PaymentModule module = new PaymentModule(); Object selStudent = (Object)listStudents.SelectedItem; Object selActivity = (Object)listActivities.SelectedItem; try { module.AddNewActivityPayment(selActivity, selStudent); MessageBox.Show("Se ha pagado la actividad con exito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); GoBackMenu(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
public bool UpdatePostPaymentDetails(PaymentModule transactionDetail) { using (var db = new ObickeEntities()) { using (var transaction = db.Database.BeginTransaction()) { try { //if OrderId is already exists, update the other inputs var existsModel = db.TransactionDetails.Where(a => a.OrderId == transactionDetail.OrderId).FirstOrDefault(); if (existsModel != null) { existsModel.BankName = transactionDetail.BankName; existsModel.BankTxnId = transactionDetail.BankTxnId; existsModel.Currency = transactionDetail.Currency; existsModel.GatewayName = transactionDetail.GatewayName; existsModel.IsCompleted = transactionDetail.IsCompleted; existsModel.PaymentCompletedDateTime = DateTime.Now; existsModel.PaymentMode = transactionDetail.PaymentMode; existsModel.ResponseCode = transactionDetail.ResponseCode; existsModel.ResponseMsg = transactionDetail.ResponseMsg; existsModel.TxnAmount = transactionDetail.TxnAmount; existsModel.TxnDate = DateTime.Now; existsModel.TxnId = transactionDetail.TxnId; existsModel.TxnStatus = transactionDetail.TxnStatus; db.SaveChanges(); } transaction.Commit(); return(true); } catch (Exception Ex) { string msg = Ex.ToString(); transaction.Rollback(); return(false); } } } }
public RequiredBasedOnModuleAttribute(PaymentModule module) { _module = module; }
public bool PostSavePayment(PaymentModule paymentModule) { return(_iPayments.UpdatePostPaymentDetails(paymentModule)); }
public bool PreSavePayment(PaymentModule paymentModule) { return(_iPayments.SavePrePaymentDetails(paymentModule)); }
public bool SavePrePaymentDetails(PaymentModule transactionDetail) { using (var db = new ObickeEntities()) { using (var transaction = db.Database.BeginTransaction()) { try { //if OrderId is already exists, update the other inputs var existsModel = db.TransactionDetails.Where(a => a.OrderId == transactionDetail.OrderId).FirstOrDefault(); if (existsModel != null) { existsModel.BankName = transactionDetail.BankName; existsModel.BankTxnId = transactionDetail.BankTxnId; existsModel.Currency = transactionDetail.Currency; existsModel.CustomerId = transactionDetail.CustomerId; existsModel.EmailId = transactionDetail.EmailId; existsModel.GatewayName = transactionDetail.GatewayName; existsModel.IsCompleted = transactionDetail.IsCompleted; existsModel.MobileNo = transactionDetail.MobileNo; existsModel.PaymentCompletedDateTime = DateTime.Now; existsModel.PaymentInitiatedDateTime = DateTime.Now; existsModel.PaymentMode = transactionDetail.PaymentMode; existsModel.ResponseCode = transactionDetail.ResponseCode; existsModel.ResponseMsg = transactionDetail.ResponseMsg; existsModel.TxnAmount = transactionDetail.TxnAmount; existsModel.TxnDate = DateTime.Now; existsModel.TxnId = transactionDetail.TxnId; existsModel.TxnStatus = transactionDetail.TxnStatus; existsModel.UserName = transactionDetail.UserName; db.SaveChanges(); } else { //Save new entry var transactionsModel = new TransactionDetail() { BankName = transactionDetail.BankName, BankTxnId = transactionDetail.BankTxnId, Currency = transactionDetail.Currency, CustomerId = transactionDetail.CustomerId, EmailId = transactionDetail.EmailId, GatewayName = transactionDetail.GatewayName, IsCompleted = transactionDetail.IsCompleted, MobileNo = transactionDetail.MobileNo, OrderId = transactionDetail.OrderId, PaymentCompletedDateTime = DateTime.Now, PaymentInitiatedDateTime = DateTime.Now, PaymentMode = transactionDetail.PaymentMode, ResponseCode = transactionDetail.ResponseCode, ResponseMsg = transactionDetail.ResponseMsg, TxnAmount = transactionDetail.TxnAmount, TxnDate = DateTime.Now, TxnId = transactionDetail.TxnId, TxnStatus = transactionDetail.TxnStatus, UserName = transactionDetail.UserName }; db.TransactionDetails.Add(transactionsModel); db.SaveChanges(); } transaction.Commit(); return(true); } catch (Exception Ex) { string msg = Ex.ToString(); transaction.Rollback(); return(false); } } } }