Exemplo n.º 1
0
        public static WithdrawalsDTO GetById(int id)
        {
            WithdrawalsDTO withdrawalsDTO = new WithdrawalsDTO();
            db             DB             = new db();
            var            withdrawal     = DB.Withdrawing.FirstOrDefault(w => w.Id == id);

            withdrawalsDTO = WithdrawalsConvert.DALtoDTO(withdrawal);
            return(withdrawalsDTO);
        }
Exemplo n.º 2
0
        public static List <WithdrawalsDTO> GetAll()
        {
            List <WithdrawalsDTO> withdrawalsDTOs = new List <WithdrawalsDTO>();
            db DB = new db();
            List <withdrawing> withdrawals = DB.Withdrawing.ToList();

            foreach (withdrawing withdrawal in withdrawals)
            {
                withdrawalsDTOs.Add(WithdrawalsConvert.DALtoDTO(withdrawal));
            }
            return(withdrawalsDTOs);
        }
Exemplo n.º 3
0
        public static List <WithdrawalsDTO> GetByUser(int userId)
        {
            List <WithdrawalsDTO> withdrawalsDTOs = new List <WithdrawalsDTO>();
            db DB = new db();
            List <withdrawing> withdrawals = DB.Withdrawing.Where(w => w.UserId == userId).ToList();

            foreach (withdrawing withdrawal in withdrawals)
            {
                WithdrawalsDTO withdrawalDTO = WithdrawalsConvert.DALtoDTO(withdrawal);
                withdrawalDTO.Fund = DB.Funds.FirstOrDefault(f => f.FundId == withdrawal.FundId).fund_name;
                withdrawalsDTOs.Add(withdrawalDTO);
            }
            return(withdrawalsDTOs);
        }
Exemplo n.º 4
0
        public static List <WithdrawalsDTO> GetByFund(string FundId)
        {
            List <WithdrawalsDTO> withdrawalsDTOs = new List <WithdrawalsDTO>();
            db DB = new db();
            List <withdrawing> withdrawals = DB.Withdrawing.Where(w => w.FundId == FundId).ToList();

            foreach (withdrawing withdrawal in withdrawals)
            {
                WithdrawalsDTO withdrawalDTO = WithdrawalsConvert.DALtoDTO(withdrawal);

                //  User_in_fund  User= DB.User_in_fund.FirstOrDefault(u => u.userID == withdrawal.UserId);
                // withdrawalDTO.User = UserBL.Get_user_byFund(FundId, withdrawal.UserId);
                withdrawalsDTOs.Add(withdrawalDTO);
            }
            return(withdrawalsDTOs);
        }