You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

66 lines
2.2 KiB

using Common;
using Common.Model;
using Common.Model.Inbound;
using Repository.Inbound;
using System.Collections.Generic;
namespace Business.Inbound
{
public interface IInboundBusiness
{
JsonRxResponse BankAccounts(string userId);
JsonRxResponse TranactionHistory(DateFilterParams search, string userId);
JsonRxResponse TranactionDetail(string tranId, string userId);
JsonRxResponse DeleteInboundAccount(string account, string userId);
}
public class InboundBusiness : IInboundBusiness
{
public IInboundRepository repository;
public InboundBusiness(IInboundRepository _repository)
{
repository = _repository;
}
public JsonRxResponse BankAccounts(string userId)
{
var ls = repository.GetBankAccounts(userId);
if (ls.Count > 0)
{
return new JsonRxResponse { ErrorCode = "0", Msg = "Success", Data = ls };
}
return new JsonRxResponse { ErrorCode = "1", Msg = "Could not get the banks accounts." };
}
public JsonRxResponse TranactionHistory(DateFilterParams search, string userId)
{
IList<TranHistory> ls = new List<TranHistory>();
ls = repository.GetTransactionHistory(search, userId);
return new JsonRxResponse { ErrorCode = "0", Msg = "Success", Data = ls };
}
public JsonRxResponse TranactionDetail(string tranId, string userId)
{
var ls = repository.GetTransactionDetail(tranId, userId);
if (ls != null)
{
return new JsonRxResponse { ErrorCode = "0", Msg = "Success", Data = ls };
}
return new JsonRxResponse { ErrorCode = "1", Msg = "Could not get the transaction detail." };
}
public JsonRxResponse DeleteInboundAccount(string account, string userId)
{
var ls = repository.DeleteInboundAccount(account, userId);
if (ls != null)
{
return new JsonRxResponse { ErrorCode = ls.ResponseCode, Msg = ls.Msg, Data = ls };
}
return new JsonRxResponse { ErrorCode = "1", Msg = ls.Msg };
}
}
}