protected override void PopulateTables()
        {
            var testCustomer1 = new StibContact { ID = Guid.NewGuid(), Voornaam = "Stuart", Achternaam = "Clemens", Kamptype = "Jongste Kamp", Vraag = "een vraag" };
            var testCustomer2 = new StibContact { ID = Guid.NewGuid(), Voornaam = "Raymond", Achternaam = "Clemens", Kamptype = "Oudste Kamp", Vraag = "een vraag" };

            GetTable<StibContact>().Add(testCustomer1);
            GetTable<StibContact>().Add(testCustomer2);
        }
Example #2
0
        private bool IsValidStibContact(StibContact stibContact)
        {
            bool isValid = true;

            if(stibContact.Achternaam.Length==0)
                isValid = false;

            if(stibContact.Voornaam.Length==0)
                isValid = false;

            if(stibContact.Vraag.Length==0)
                isValid = false;

            if(stibContact.ID==Guid.Empty)
                isValid = false;

            return isValid;
        }
Example #3
0
        public Boolean SaveContact(StibContact stibContact)
        {
            StibContactDataContext db = new StibContactDataContext();
            stibContact.ID = Guid.NewGuid();

            if (!IsValidStibContact(stibContact))
                throw new InvalidContactInfoException("Er is niet voldoende informatie om de contactinfo op te slaan.");

            db.StibContacts.InsertOnSubmit(stibContact);
            try
            {
                db.SubmitChanges();
                return true;
            }
            catch
            {
                return false;
            }
        }
 partial void DeleteStibContact(StibContact instance);
 partial void UpdateStibContact(StibContact instance);
 partial void InsertStibContact(StibContact instance);
Example #7
0
            internal StibContact Create()
            {
                StibContact stibContact = new StibContact();

                stibContact.ID = Guid.NewGuid();
                stibContact.Kamptype = String.Empty;
                stibContact.Voornaam = String.Empty;
                stibContact.Tussenvoegsel = String.Empty;
                stibContact.Achternaam = String.Empty;
                stibContact.Vraag = String.Empty;

                return stibContact;
            }