Пример #1
0
        public string GetCusByMail(string email)
        {
            DBShopDataContext db  = new DBShopDataContext();
            customer          cus = db.customers.FirstOrDefault(x => x.email.Equals(email));

            cus.bills.Clear();
            return(cus.ParserJSon());
        }
Пример #2
0
        public string login(string email, string password)
        {
            customer          us     = new customer();
            DBShopDataContext db     = new DBShopDataContext();
            List <customer>   Listus = db.customers.ToList();

            foreach (customer k in Listus)
            {
                if (String.Compare(k.email, email, true) == 0 && String.Compare(k.password, password, true) == 0)
                {
                    us.id       = k.id;
                    us.password = k.password;
                    us.email    = k.email;
                }
            }
            return(us.ParserJSon());
        }