public TransactionService(TransactionDao transactionDao, TransactionTypeDao transactionTypeDao, AccountDao accountDao, ILogger <TransactionService> logger) { _transactionDao = transactionDao; _transactionTypeDao = transactionTypeDao; _accountDao = accountDao; _logger = logger; }
public List <Transaction> findMemberTransactions(Member member) { TransactionDao transactionDao = new TransactionDao(db); List <Transaction> transactions = transactionDao.findWonAndPaidTransactions(member.MemberID); return(transactions); }
public ActionResult Payment(string name, string phone, string address, string email) { var tran = new Transaction(); tran.userName = name; tran.userPhone = phone; tran.userAddress = address; tran.userMail = email; try { var id = new TransactionDao().Insert(tran); var cart = (List <CartItem>)Session[CartSession]; var orderDao = new OrderDao(); foreach (var item in cart) { var order = new Oder(); order.productId = item.Product.productId; order.tranId = id; order.price = item.Product.price; order.quatity = item.Quantity; order.size = item.Size; order.createDay = DateTime.Now; orderDao.Insert(order); } } catch (Exception ex) { return(Redirect("/loi-thanh-toan")); } return(Redirect("/hoan-thanh")); }
// GET: Admin/Transaction public ActionResult Index(int page = 1, int pageSize = 10) { var dao = new TransactionDao(); var model = dao.ListAllPagding(page, pageSize); return(View(model)); }
public void SetNetworkEndpointTransactionInfo(string transactionId, string networkId, EndpointVersionType networkEndpointVersion, string networkEndpointUrl, string networkFlowName, string networkFlowOperation, string endpointUsername) { TransactionDao.SetNetworkEndpointTransactionInfo(transactionId, networkId, networkEndpointVersion, networkEndpointUrl, networkFlowName, networkFlowOperation, endpointUsername); }
public ActionResult Edit(int id) { SetUser(); SetMethod(); var trans = new TransactionDao().GetById(id); return(View(trans)); }
public static List <TransactionDto> GetAllTransaction() { if (allTransaction == null || allTransaction.Count == 0) { allTransaction = TransactionDao.GetAll(); } return(allTransaction); }
public static int Insert(TransactionDto dto) { int id = TransactionDao.Insert(dto); dto.TransactionId = id; allTransaction.Add(dto); allTransaction.OrderBy(n => n.TransactionId); return(id); }
public void TransactionDao_Read() { TransactionDao dao = new TransactionDao(); var result = dao.Read(); foreach (var item in result) { Debug.WriteLine(item.ToString()); } }
public IHttpActionResult GetTransactions(Guid accountId = default(Guid)) { if (accountId == default(Guid)) { return(BadRequest()); } var transactionDao = new TransactionDao(); return(Ok(transactionDao.GetAllTransactionsForAccount(accountId))); }
public static int Update(TransactionDto dto) { TransactionDto oldDto = allTransaction.FirstOrDefault(n => n.TransactionId == dto.TransactionId); if (oldDto != null) { allTransaction.Remove(oldDto); } allTransaction.Add(dto); allTransaction.OrderBy(n => n.TransactionId); return(TransactionDao.Update(dto)); }
public void ReadTransaction() { TransactionDao bankManagerDAO = new TransactionDao(); var res = bankManagerDAO.Read(); foreach (var item in res) { Debug.WriteLine(item.ToString()); } }
public ActionResult Edit(Transaction trans) { var dao = new TransactionDao(); bool result = dao.UpdateTransaction(trans); if (result) { return(RedirectToAction("Index", "Transaction")); } else { ModelState.AddModelError("", "Khong them duoc"); } return(View("Index", "Home")); }
public ActionResult CreateProduct(Transaction trans) { var dao = new TransactionDao(); int id = dao.InsertTransaction(trans); if (id > 0) { return(RedirectToAction("Index", "Transaction")); } else { ModelState.AddModelError("", "Khong them san pham thanh cong"); } return(View("Index", "Home")); }
public void TransactionDao_Update() { TransactionDto dto = new TransactionDto(); dto.SenderId = "ericcart"; dto.ReceiverId = "stanmarsh"; dto.TransactionAmount = 10000; dto.TransactionType = TransactionType.ClientToClientTransaction; dto.TransactionTime = DateTime.Now; dto.EntityStatus = EntityStatusType.IsActive; dto.CreatedTime = DateTime.Now; dto.Id = "123"; TransactionDao dao = new TransactionDao(); string result = dao.Update(dto); Assert.IsTrue(dto.Id == result); }
public void TransactionDao_Create() { TransactionDao transactionDao = new TransactionDao(); string idToSet = "2001"; string result = transactionDao.Create(new TransactionDto() { SenderId = "ericcart", ReceiverId = "stanmarsh", TransactionAmount = 666, TransactionType = TransactionType.ClientToClientTransaction, TransactionTime = DateTime.Now, EntityStatus = EntityStatusType.IsActive, CreatedTime = DateTime.Now, Id = idToSet }); Assert.IsTrue(result == idToSet); }
public void TransactionDao_Create() { TransactionDao transactionDao = new TransactionDao(); string idToSet = Guid.NewGuid().ToString(); string result = transactionDao.Create(new TransactionDto() { SenderId = "Zeus", ReceiverId = "Drow Ranger", TransactionAmount = 6200, TransactionType = TransactionType.ClientToClientTransaction, TransactionTime = DateTime.Now, EntityStatus = EntityStatusType.IsActive, CreatedTime = DateTime.Now, Id = idToSet }); Assert.IsTrue(result == idToSet); }
public void TransactionDao_Update() { TransactionDao transactionDao = new TransactionDao(); string idToSet = Guid.NewGuid().ToString(); var transactionDto = new TransactionDto() { SenderId = "Zeus", ReceiverId = "Drow Ranger", TransactionAmount = 6200, TransactionType = TransactionType.ClientToClientTransaction, TransactionTime = DateTime.Now, EntityStatus = EntityStatusType.IsActive, CreatedTime = DateTime.Now, Id = idToSet }; string result = transactionDao.Create(transactionDto); transactionDto.EntityStatus = EntityStatusType.IsBlocked; transactionDao.Update(transactionDto); Assert.IsTrue(transactionDao.Read(transactionDto.Id).EntityStatus == EntityStatusType.IsBlocked); }
private void BtnQuery_Click(object sender, EventArgs e) { OrderInfoVo vo = new OrderInfoVo(); vo.OrderID = GenrateIDUtil.GenerateOrderID(); vo.Price = Convert.ToDouble(this.textPrice.Text); vo.Tax = Convert.ToDouble(this.textGst.Text); vo.TotalPrice = Convert.ToDouble(this.textTotal.Text); vo.PriceType = this.comboType.Text; vo.EndTime = DateTime.Now; vo.CompanyId = SystemConst.companyId; if (TransactionDao.DealOrder(vo, selectedVoList, this.comboType.Text)) { //删除临时订单 foreach (TempOrderVo tempVo in selectedVoList) { DeleteDao.DeleteByID(tempVo.Id, typeof(TempOrderVo)); } //会员消费记录 if (!string.IsNullOrWhiteSpace(this.textMemberId.Text)) { MemberConsumeVo consumeVo = new MemberConsumeVo(); string consumeId = GenrateIDUtil.GenerateConsumeID(); consumeVo.Id = consumeId; consumeVo.MId = this.textMemberId.Text; consumeVo.MName = SelectDao.GetMemberNameByID(this.textMemberId.Text); consumeVo.Amount = double.Parse(this.textTotal.Text); consumeVo.ConsumeTime = DateTime.Now; consumeVo.CompanyId = SystemConst.companyId; InsertDao.InsertData(consumeVo); } XtraMessageBox.Show("买单成功!"); EventBus.PublishEvent("StaffWorkStatusChange"); } else { XtraMessageBox.Show("买单失败!"); } }
private void TransferTo202_Click(object sender, EventArgs e) { int StationID = Convert.ToInt32(lounge_site.SelectedValue); logger.Debug(String.Format("Begin transfer data from site>", lounge_site.Text)); TransactionDao dao = new TransactionDao(); String cri = "where date(create_date) = date('" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + "') and LoungePlace=" + StationID + " order by update_date desc"; List <ModelTransaction> lists = dao.Select61(cri, StationID); int result = 0; if (lists.Count > 0) { foreach (ModelTransaction m in lists) { result += (dao.Insert(m, StationID))? result++:0; } } logger.Debug(String.Format("Result of transafer total{0} success{1} record(s)", lists.Count, result)); }
public void TransactionDao_Delete() { TransactionDao bankManagerDAO = new TransactionDao(); var transactionDto = new TransactionDto() { SenderId = "Zeus", ReceiverId = "Drow Ranger", TransactionAmount = 6200, TransactionType = TransactionType.ClientToClientTransaction, TransactionTime = DateTime.Now, EntityStatus = EntityStatusType.IsActive, CreatedTime = DateTime.Now, Id = Guid.NewGuid().ToString() }; bankManagerDAO.Create(transactionDto); bankManagerDAO.Remove(transactionDto.Id); Assert.IsNull(bankManagerDAO.Read(transactionDto.Id)); }
private void BtnOrder_Click(object sender, EventArgs e) { List <TempOrderVo> tempVoList = (List <TempOrderVo>) this.gridView1.DataSource; if (tempVoList == null || tempVoList.Count == 0) { XtraMessageBox.Show("请选择服务项目!"); return; } if (!TransactionDao.SendTempOrder(tempVoList)) { XtraMessageBox.Show("下单失败!"); return; } this.btnCancelOrder1.Enabled = true; this.btnOrder.Enabled = false; this._rommVo.RoomStatus = "占用"; EventBus.PublishEvent("StaffWorkStatusChange"); XtraMessageBox.Show("下单成功!"); this.DialogResult = DialogResult.OK; }
public static void transfer2Server() { int total = 0; int success = 0; TransactionDao dao = new TransactionDao(); int StationID = Convert.ToInt16(ManageLOG.getValueFromRegistry(Configurations.AppRegName, "StationID")); String cri = " Where t.LoungePlace=" + StationID; List <ModelTransaction> lists = dao.SelectOffine(cri + " order by t.update_date desc", StationID); if (lists != null) { total = lists.Count; logger.Debug("# Start Transfer data to server."); logger.Debug("Local transaction have " + lists.Count + " records."); if (lists.Count > 0) { StringBuilder sb = new StringBuilder(); foreach (ModelTransaction model in lists) { bool result = dao.Insert(model, StationID); if (result) { logger.Debug("Local transaction have " + lists.Count + " records."); //Delete local data when transfer to ser success. if (dao.DeleteOffline(model, StationID)) { success++; } } } } logger.Debug("# Summary=> Total transfer total: " + total + " success: " + success + " fail: " + (total - success)); logger.Debug("# End Transfer data to server."); } }
public void TransactionDao_Delete() { TransactionDao dao = new TransactionDao(); dao.Remove("1"); }
private void B_UPLOAD_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; int StationID = Convert.ToInt32(ManageLOG.getValueFromRegistry("WiFi Management", "StationID")); //----------------Create folder String folderName = @"C:\BangkokAirways\reports\" + DateTime.Now.ToString("yyyyMMdd") + "\\"; String fileName = folderName + @"\Report_" + StationID + "_" + DateTime.Now.ToString("yyyyMMddHHmm") + ".txt"; DirectoryInfo di = new DirectoryInfo(@"" + folderName); if (!di.Exists) { di.Create(); } //ถ้าไม่พบ Folder ก็ทำการสร้างมันขึ้นมา //----------------Create File ManageLOG mangeLog = new ManageLOG(); mangeLog.fileName = fileName; mangeLog.folderName = folderName; TransactionDao tranDao = new TransactionDao(); String cri = "where date(create_date) = date('" + DateTime.Now.ToString("yyyy-MM-dd") + "') and LoungePlace=" + StationID + " order by update_date desc"; List <ModelTransaction> lists = tranDao.Select(cri, StationID); int seq = 1; String header = "No,Username,Type,GenDate,GroupName,Duration,PassengerName,FromCity,ToCity,AirlineCode,FlightNo,DateOfFlight,SeatNo,LoungePlace,LoungeType,LoungeArea,Owner,Begin_Date,Status,Remark,AccessCode,Remark2,LastUpdate,LastUpdateBy"; mangeLog.WriteLog(header); foreach (ModelTransaction transaction in lists) { mangeLog.WriteLog( seq + "," + "-," + transaction.type + "," + transaction.create_date_custom + "," + transaction.group_idName + "," + transaction.duration + "," + transaction.passenger_name + "," + transaction.from_city + "," + transaction.to_city + "," + transaction.airline_code + "," + transaction.flight_no + "," + transaction.date_of_flight_custom + "," + transaction.seat_no + "," + transaction.LoungeSite + "," + transaction.LoungeName + "," + transaction.LoungeAreaName + "," + transaction.create_byName + "," + transaction.begin_date_custom + "," + transaction.status + "," + transaction.remark + "," + transaction.ath_id + "," + transaction.remakr2 + "," + transaction.update_date_custom + "," + transaction.update_byName ); seq++; } ; //----------------Ftp File CustomUtils util = new CustomUtils(); util.ftpServerIP = ftpServerIP.Text; util.ftpUserID = ftpUserID.Text; util.ftpPassword = ftpPassword.Text; Boolean result = util.Upload(fileName); Cursor = Cursors.Default; if (result) { MessageBox.Show("อัพโหลดเรียบร้อยแล้ว"); } }
public FinanceService() { _transactionDao = new TransactionDao(); }
public static bool Delete(TransactionDto dto) { return(TransactionDao.Delete(dto.TransactionId)); }
public TransactionManager(WalletDao walletDao, AddressDao addressDao, TransactionDao TxDao) { this.WalletDao = walletDao; this.AddressDao = addressDao; this.TransactionDao = TxDao; }
public Transaction AddTransaction(NewTransaction newTransaction) { var transactionDao = new TransactionDao(); return(transactionDao.InsertTransaction(newTransaction)); }
public BTCTransactionManager(TransactionDao txDao) { this.TransactionDao = txDao; }