public static DepositDetails GetById(int id) { DepositDetails depositDetails = new DepositDetails(); try { DB db = new SuperGmachEntities(); Deposit deposit = db.Deposits.FirstOrDefault(d => d.DepositId == id); depositDetails = DepositConvert.DALtoDepositDetails(deposit); } catch (Exception e) { throw e; } return(depositDetails); }
public static List <DepositDetails> GetList() { List <DepositDetails> deposits = new List <DepositDetails>(); try { DB db = new SuperGmachEntities(); foreach (var deposit in db.Deposits) { deposits.Add(DepositConvert.DALtoDepositDetails(deposit)); } } catch (Exception e) { throw e; } return(deposits); }
public static List <DepositDetails> GetByFundId(string FundId) { List <DepositDetails> deposits = new List <DepositDetails>(); try { DB db = new SuperGmachEntities(); List <Deposit> deposits_DAL = db.Deposits.Where(d => d.FundId == FundId).ToList(); foreach (var deposit in deposits_DAL) { deposits.Add(DepositConvert.DALtoDepositDetails(deposit)); } } catch (Exception e) { throw e; } return(deposits); }