예제 #1
0
        ////מחזיר רשימת הפקדות לפי ת"ז
        //public static List<DepositDTO> GetDeposits(int userId)
        //{
        //    List<DepositDTO> deposits = new List<DepositDTO>();
        //    db.Deposits.Where(i => i.userId == userId).ToList().ForEach(w => deposits.Add(DepositCast.CastToDTO(w)));
        //    return deposits;
        //}


        public static List <DepositDTO> GetDeposits()
        {
            db = new controlPrintEntities();
            List <DepositDTO> deposits = new List <DepositDTO>();

            db.Deposits.ToList().ForEach(w => deposits.Add(DepositCast.CastToDTO(w)));

            deposits.ForEach(d => { User u2 = db.Users.Where(u => u.userId == d.userId).FirstOrDefault(); d.userName = u2.userName; d.userTz = u2.userTz; });
            return(deposits);
        }