public List <StatementModel> GetStatement(long Accountno) { TransactionDataAccess tranDac = new TransactionDataAccess(); DataSet ds = tranDac.Read(Accountno); List <StatementModel> Transactionlist = new List <StatementModel>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { StatementModel uobj = new StatementModel(); uobj.TransactionId = Convert.ToInt32(ds.Tables[0].Rows[i]["transaction_id"].ToString()); uobj.DebitAccount = Convert.ToInt64(ds.Tables[0].Rows[i]["debit_account_no"].ToString()); uobj.CreditAccount = Convert.ToInt64(ds.Tables[0].Rows[i]["credit_account_no"].ToString()); uobj.DebitAccountBalance = Convert.ToInt64(ds.Tables[0].Rows[i]["debit_account_balance"].ToString()); uobj.CreditAccountBalance = Convert.ToInt64(ds.Tables[0].Rows[i]["credit_account_balance"].ToString()); uobj.Amount = Convert.ToInt32(ds.Tables[0].Rows[i]["amount"].ToString()); uobj.TransactionDate = ds.Tables[0].Rows[i]["transaction_date_time"].ToString(); Transactionlist.Add(uobj); } TransactionDataAccess.sqlCon.Close(); return(Transactionlist); }
public string GetMsgContent(int transactionID) { using (TransactionDataAccess transactionDA = new TransactionDataAccess()) { return(transactionDA.GetMsgContent(transactionID)); } }
public void LoadRecurringList_ListWithRecurringTransaction() { var dbHelper = new SqliteConnectionCreator(new WindowsSqliteConnectionFactory()); var transactionDataAccess = new TransactionDataAccess(dbHelper); var recTransactionDataAccess = new RecurringTransactionDataAccess(dbHelper); var repository = new TransactionRepository(transactionDataAccess, recTransactionDataAccess); transactionDataAccess.SaveItem(new FinancialTransaction {Amount = 999, IsRecurring = false}); transactionDataAccess.SaveItem(new FinancialTransaction { Amount = 123, IsRecurring = true, RecurringTransaction = new RecurringTransaction {IsEndless = true} }); repository.Load(); var result = repository.LoadRecurringList().ToList(); result.Count.ShouldBe(1); result.First().Id.ShouldBe(2); result.First().RecurringTransaction.Id.ShouldBe(1); }
public int GetMsgNumbers(string getTeaNumber) { using (TransactionDataAccess transactionDA = new TransactionDataAccess()) { return(transactionDA.GetMsgNumbers(getTeaNumber)); } }
public DataSet TranSearch(string getNumber, string sendFrom, string content, string title, string timeType, string readType) { using (TransactionDataAccess transactionDA = new TransactionDataAccess()) { return(transactionDA.TranSearch(getNumber, sendFrom, content, title, timeType, readType)); } }
public void DeleteTransaction(int tranID) { using (TransactionDataAccess transactionDA = new TransactionDataAccess()) { transactionDA.DeleteTransaction(tranID); } }
public DataSet GetTeaInfoListForTran(string getDept, string getDuty, string getName, string getNumber) { using (TransactionDataAccess transactionDA = new TransactionDataAccess()) { return(transactionDA.GetTeaInfoListForTran(getDept, getDuty, getName, getNumber)); } }
public DataSet GetTransactionByTNumber(string TNumber) { using (TransactionDataAccess transactionDA = new TransactionDataAccess()) { return(transactionDA.GetTransactionByTNumber(TNumber)); } }
public TransactionService() { if (TransactionService.transactionDataAccess == null) { TransactionService.transactionDataAccess = new TransactionDataAccess(); } }
public ActionResult PartialTransactionReport(DateTime?startDate, DateTime?endDate) { var minStartDate = startDate == null ? startDate : CustomHelper.ConvertToMinDate(startDate); var maxEndDate = endDate == null ? endDate : CustomHelper.ConvertToMaxDate(endDate); var viewModel = new TransactionDataAccess().GetTransactions(minStartDate, maxEndDate); return(PartialView("_partialTransactionReport", viewModel)); }
public int InsertTransaction(string sendFrom, string sendTo, DateTime sendDate, string content, string sendTitle) { using (TransactionDataAccess transactionDA = new TransactionDataAccess()) { return(transactionDA.InsertTransaction(sendFrom, sendTo, sendDate, content, sendTitle)); } }
public TransactionController() { string dataFilePath = Path.Combine(Directory.GetCurrentDirectory(), "Data", "transactions.csv"); CsvDataAccessStrategy dataAccess = new CsvDataAccessStrategy(dataFilePath); CsvDataParserStrategy <ITransaction> parser = new CsvDataParserStrategy <ITransaction>(';'); TransactionDataAccess = new TransactionDataAccess(parser, dataAccess); }
public IActionResult Post([FromBody] TransactionModel dataViewModel) { var model = dataViewModel; model.ID = DateTime.UtcNow.Ticks.ToString(); model.CreatedOn = DateTime.UtcNow; model.ModifiedOn = DateTime.UtcNow; model.TransactionState = TransactionState.PROCESSING; var transactionDA = new TransactionDataAccess(); transactionDA.SaveToDatabase(model); return(Ok("Done")); }
public ActionResult Payment(string shipName, string mobile, string address, string email) { var order = new Transaction(); order.CreatedDate = DateTime.Now; order.User_Address = address; order.User_Phone = mobile; order.User_Name = shipName; order.User_Email = email; try { var id = new TransactionDataAccess().Insert(order); var cart = (List <CartItem>)Session[CartSession]; var detailDataAccess = new OrderDataAccess(); double total = 0; foreach (var item in cart) { var orderDetail = new Order(); orderDetail.ProductID = item.Product.ProductID; orderDetail.TransactionID = id; orderDetail.OrderID = id; orderDetail.Quantity = item.Quantity; orderDetail.Price = item.Product.Price; orderDetail.Name = item.Product.Name; detailDataAccess.Insert(orderDetail); total += (item.Product.Price.GetValueOrDefault(0) * item.Quantity); } string content = System.IO.File.ReadAllText(Server.MapPath("~/assets/client/template/neworder.html")); content = content.Replace("{{CustomerName}}", shipName); content = content.Replace("{{Phone}}", mobile); content = content.Replace("{{Email}}", email); content = content.Replace("{{Address}}", address); content = content.Replace("{{Total}}", total.ToString("N0")); var toEmail = ConfigurationManager.AppSettings["ToEmailAddress"].ToString(); new MailHelper().SendMail(email, "Đơn hàng mới từ ShopHoa", content); new MailHelper().SendMail(toEmail, "Đơn hàng mới từ ShopHoa", content); } catch (Exception ex) { //ghi log return(Redirect("/loi-thanh-toan")); } return(Redirect("/hoan-thanh")); }
public void TransactionDataAccess_CrudTransaction() { var transactionDataAccess = new TransactionDataAccess(); const double firstAmount = 76.30; const double secondAmount = 22.90; var transaction = new FinancialTransaction { ChargedAccount = new Account { Id = 4 }, Amount = firstAmount, Date = DateTime.Today, Note = "this is a note!!!", Cleared = false }; transactionDataAccess.Save(transaction); var list = transactionDataAccess.LoadList(); Assert.AreEqual(1, list.Count); Assert.AreEqual(firstAmount, list.First().Amount); transaction.Amount = secondAmount; transactionDataAccess.Save(transaction); transactionDataAccess.LoadList(); list = transactionDataAccess.LoadList(); Assert.AreEqual(1, list.Count); Assert.AreEqual(secondAmount, list.First().Amount); transactionDataAccess.Delete(transaction); transactionDataAccess.LoadList(); list = transactionDataAccess.LoadList(); Assert.IsFalse(list.Any()); }
public void TransactionDataAccess_CrudTransaction() { var transactionDataAccess = new TransactionDataAccess(new SqliteConnectionCreator(new WindowsSqliteConnectionFactory())); const double firstAmount = 76.30; const double secondAmount = 22.90; var transaction = new FinancialTransaction { ChargedAccount = new Account {Id = 4}, Amount = firstAmount, Date = DateTime.Today, Note = "this is a note!!!", IsCleared = false }; transactionDataAccess.SaveItem(transaction); var list = transactionDataAccess.LoadList(); Assert.Equal(1, list.Count); Assert.Equal(firstAmount, list.First().Amount); transaction.Amount = secondAmount; transactionDataAccess.SaveItem(transaction); transactionDataAccess.LoadList(); list = transactionDataAccess.LoadList(); Assert.Equal(1, list.Count); Assert.Equal(secondAmount, list.First().Amount); transactionDataAccess.DeleteItem(transaction); transactionDataAccess.LoadList(); list = transactionDataAccess.LoadList(); Assert.False(list.Any()); }
public void TransactionDataAccess_CrudTransaction() { var transactionDataAccess = new TransactionDataAccess(new DbHelper(new SQLitePlatformWinRT(), new TestDatabasePath())); const double firstAmount = 76.30; const double secondAmount = 22.90; var transaction = new FinancialTransaction { ChargedAccount = new Account {Id = 4}, Amount = firstAmount, Date = DateTime.Today, Note = "this is a note!!!", Cleared = false }; transactionDataAccess.Save(transaction); var list = transactionDataAccess.LoadList(); Assert.AreEqual(1, list.Count); Assert.AreEqual(firstAmount, list.First().Amount); transaction.Amount = secondAmount; transactionDataAccess.Save(transaction); transactionDataAccess.LoadList(); list = transactionDataAccess.LoadList(); Assert.AreEqual(1, list.Count); Assert.AreEqual(secondAmount, list.First().Amount); transactionDataAccess.Delete(transaction); transactionDataAccess.LoadList(); list = transactionDataAccess.LoadList(); Assert.IsFalse(list.Any()); }
public void TransactionDataAccess_CrudTransactionWithoutAccount() { var transactionDataAccess = new TransactionDataAccess(); const double firstAmount = 76.30; const double secondAmount = 22.90; var transaction = new FinancialTransaction { Amount = firstAmount, Date = DateTime.Today, Note = "this is a note!!!", Cleared = false }; transactionDataAccess.Save(transaction); var list = transactionDataAccess.LoadList(); Assert.AreEqual(1, list.Count); Assert.AreEqual(firstAmount, list.First().Amount); transaction.Amount = secondAmount; transactionDataAccess.Save(transaction); transactionDataAccess.LoadList(); list = transactionDataAccess.LoadList(); Assert.AreEqual(1, list.Count); Assert.AreEqual(secondAmount, list.First().Amount); transactionDataAccess.Delete(transaction); transactionDataAccess.LoadList(); list = transactionDataAccess.LoadList(); Assert.IsFalse(list.Any()); }
public void SendMoney(long debit, long credit, int amount) { TransactionDataAccess tranDA = new TransactionDataAccess(); tranDA.InsertDetails(debit, credit, amount); }
public TransactionForm() { InitializeComponent(); transactionDataAccess = new TransactionDataAccess(); }
public ItemManager() { itemDataAccess = new ItemDataAccess(); transactionDataAccess = new TransactionDataAccess(); }
public TransactionService() { this.TransactionDataAccess = new TransactionDataAccess(); }
public void SaveTransaction_ChargedAccountSet_AccountIdAssociated() { var transactionDataAccess = new TransactionDataAccess(new SqliteConnectionCreator(new WindowsSqliteConnectionFactory())); var transaction = new FinancialTransaction { ChargedAccount = new Account {Id = 4}, Amount = 76.30, Date = DateTime.Today, Note = "this is a note!!!", IsCleared = false }; transactionDataAccess.SaveItem(transaction); transaction.ChargedAccountId.ShouldBe(4); }
public ProcessTransactionLogic() { _transactionDA = new TransactionDataAccess(); _loyaltyCardDataAccess = new LoyaltyCardDataAccess(); }