Exemplo n.º 1
0
        public static void RemoveAnimal(Animal animal)
        {
            var animals = context.Animals.ToList();

            context.GetTable <Animal>().DeleteOnSubmit(animal);
            context.SubmitChanges();
        }
Exemplo n.º 2
0
        public static Table <USState> GetStates()
        {
            HumaneSocietyDataContext db     = new HumaneSocietyDataContext("c:/Documents/HumaneSociety/HumaneSociety/HumaneSociety.dbml");
            Table <USState>          states = db.GetTable <USState>();

            return(states);
        }
Exemplo n.º 3
0
        public static Table <Client> RetrieveClients()
        {
            HumaneSocietyDataContext db      = new HumaneSocietyDataContext("c:/Documents/HumaneSociety/HumaneSociety/HumaneSociety.dbml");
            Table <Client>           clients = db.GetTable <Client>();

            return(clients);
        }
Exemplo n.º 4
0
        public static Client GetClient(string userName, string password)
        {
            HumaneSocietyDataContext db      = new HumaneSocietyDataContext("c:/Documents/HumaneSociety/HumaneSociety/HumaneSociety.dbml");
            Table <Client>           clients = db.GetTable <Client>();
            var getClient = db.Clients.Where(c => c.userName == userName).Select(c => c).FirstOrDefault();

            try
            {
                if (password == getClient.pass)
                {
                    return(getClient);
                }
            }

            catch (Exception e)
            {
                UserInterface.DisplayExceptionMessage(e);
            }
            return(getClient);
        }
Exemplo n.º 5
0
 public static void RemoveAnimal(Animal animal)
 {
     db.GetTable <Animal>().DeleteOnSubmit(animal);
     db.SubmitChanges();
 }