public static void RemoveAnimal(Animal animal) { var animals = context.Animals.ToList(); context.GetTable <Animal>().DeleteOnSubmit(animal); context.SubmitChanges(); }
public static Table <USState> GetStates() { HumaneSocietyDataContext db = new HumaneSocietyDataContext("c:/Documents/HumaneSociety/HumaneSociety/HumaneSociety.dbml"); Table <USState> states = db.GetTable <USState>(); return(states); }
public static Table <Client> RetrieveClients() { HumaneSocietyDataContext db = new HumaneSocietyDataContext("c:/Documents/HumaneSociety/HumaneSociety/HumaneSociety.dbml"); Table <Client> clients = db.GetTable <Client>(); return(clients); }
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); }
public static void RemoveAnimal(Animal animal) { db.GetTable <Animal>().DeleteOnSubmit(animal); db.SubmitChanges(); }