protected void savePaymentToDatabase(string email, string tx)
        {
            decimal paymentAmt = (decimal)Session["TotalExpense"];

            ParticipantsTransactionsClient client = new ParticipantsTransactionsClient();
            List<ParticipantTransaction> transList = new List<ParticipantTransaction>();

            DataSet dsCarts = Carts.LoadCart(email);
            foreach (DataRow dr in dsCarts.Tables[0].Rows)
            {
                ParticipantTransaction t = new ParticipantTransaction();
                t.Amount = decimal.Parse(dr["price"].ToString());
                t.Email = email;
                t.EventID = int.Parse(dr["Event_ID"].ToString());
                t.TransactionDateTime = DateTime.Now;
                t.TransactionID = tx;
                t.Remarks = "";
                transList.Add(t);
            }

            client.SaveTransaction(tx, transList.ToArray());
            Carts.DeleteUserCart(email);
            client.Close();
            MailHandler.sendPaymentReceivedMail(email, tx, paymentAmt);
        }
示例#2
0
 private void retPastTransaction(DateTime start, DateTime end)
 {
     ParticipantsTransactionsClient ptClient = new ParticipantsTransactionsClient();
     try
     {
         List<ParticipantTransaction> trans =
             ptClient.ViewParticipantsTransactions(ParticipantEmail(), start, end).ToList<ParticipantTransaction>();
         gvPastTransaction.DataSource = trans;
         gvPastTransaction.DataBind();
     }
     catch (Exception)
     {
         Alert.Show("Error Retreiving Past Transaction!");
     }
     finally
     {
         ptClient.Close();
     }
 }