示例#1
0
        public DalPost GetPostUser(DalUser user)
        {
            DalPost UserLoginPost = null;

            using (Shop shop = new Shop())
            {
                User tmpUser = shop.Users.Where(x => x.Id == user.Id).First();
                UserLoginPost = EntityConvertToDTO.PostToDalPost(tmpUser.Post);
            };
            return(UserLoginPost);
        }
示例#2
0
        public List <DalCpuFromShop> GetListCpu()
        {
            var GetList = new List <DalCpuFromShop>();

            using (Shop shop = new Shop())
            {
                var tmplist = shop.ItemFromShops.Where(x => x is CpuFromShop).Select(x => (x as CpuFromShop)).ToList();
                GetList = tmplist.Select(x => EntityConvertToDTO.CpuToDalCpuShop(x)).ToList();
            };

            return(GetList);
        }
示例#3
0
        public DalUser GetUser(string login, string password)
        {
            DalUser GetUser = null;

            using (Shop shop = new Shop())
            {
                User tmpuser = shop.Users.Where(x => x.Login.Equals(login) &&
                                                x.Password.Equals(password)).
                               FirstOrDefault();
                if (tmpuser != null)
                {
                    GetUser = EntityConvertToDTO.UserToDalUser(tmpuser);
                }
            };
            return(GetUser);
        }