Ejemplo n.º 1
0
 public TransactionHistoryModel GetTransactionHistoryByJobId(int jobid)
 {
     //unitOfWork.StartTransaction();
     TransactionHistoryRepository repo = new TransactionHistoryRepository(unitOfWork);
     TransactionHistoryModel transactionHistoryModel = new TransactionHistoryModel();
     //UserLocationModel userLocationModel = new UserLocationModel();
     TransactionHistory transactionHistory = new TransactionHistory();
     AutoMapper.Mapper.Map(transactionHistoryModel, transactionHistory);
     transactionHistory = repo.GetAll().Where(x => x.JobId == jobid && !string.IsNullOrEmpty(x.CustomerEmail)).FirstOrDefault();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(transactionHistory, transactionHistoryModel);
     return transactionHistoryModel;
 }
Ejemplo n.º 2
0
 public TransactionHistoryModel GetTransactionHistoryByCartId(int id)
 {
     //unitOfWork.StartTransaction();
     TransactionHistoryRepository repo = new TransactionHistoryRepository(unitOfWork);
     TransactionHistoryModel transactionHistoryModel = new TransactionHistoryModel();
     //UserLocationModel userLocationModel = new UserLocationModel();
     TransactionHistory transactionHistory = new TransactionHistory();
     AutoMapper.Mapper.Map(transactionHistoryModel, transactionHistory);
     transactionHistory = repo.GetAll().Where(x => x.CartId == id).FirstOrDefault();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(transactionHistory, transactionHistoryModel);
     return transactionHistoryModel;
 }
Ejemplo n.º 3
0
 public TransactionHistoryModel FindTransactionHistoryByMerchantRegrence(string merchantRegrence)
 {
     //unitOfWork.StartTransaction();
     TransactionHistoryRepository repo = new TransactionHistoryRepository(unitOfWork);
     TransactionHistoryModel transactionHistoryModel = new TransactionHistoryModel();
     //UserLocationModel userLocationModel = new UserLocationModel();
     TransactionHistory transactionHistory = new TransactionHistory();
      AutoMapper.Mapper.Map(transactionHistoryModel, transactionHistory);
     transactionHistory = repo.GetAll().Where(x => x.MerchantReference == merchantRegrence).SingleOrDefault();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(transactionHistory, transactionHistoryModel);
     return transactionHistoryModel;
 }
Ejemplo n.º 4
0
        public TransactionHistoryModel UpdateTransactionHistory(TransactionHistoryModel transactionHistoryModel)
        {
            //unitOfWork.StartTransaction();
            TransactionHistoryRepository repo = new TransactionHistoryRepository(unitOfWork);
            //UserLocationModel userLocationModel = new UserLocationModel();
            TransactionHistory transactionHistory = new TransactionHistory();

            transactionHistory = repo.GetAll().Where(x => x.CartId == transactionHistoryModel.CartId).SingleOrDefault();

            transactionHistoryModel.CartId = transactionHistory.CartId;
            AutoMapper.Mapper.Map(transactionHistoryModel, transactionHistory);
            repo.Update(transactionHistory);
            //unitOfWork.Commit();
            AutoMapper.Mapper.Map(transactionHistory, transactionHistoryModel);
            return transactionHistoryModel;
        }
Ejemplo n.º 5
0
 public TransactionHistoryModel InsertTransactionHistory(TransactionHistoryModel transactionHistoryModel)
 {
     //unitOfWork.StartTransaction();
     TransactionHistoryRepository repo = new TransactionHistoryRepository(unitOfWork);
     //UserLocationModel userLocationModel = new UserLocationModel();
     TransactionHistory transactionHistory = new TransactionHistory();
     AutoMapper.Mapper.Map(transactionHistoryModel, transactionHistory);
     transactionHistory = repo.Insert(transactionHistory);
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(transactionHistory, transactionHistoryModel);
     return transactionHistoryModel;
 }