public void EditPerson(int userId, string firstName, string lastName, string email, string address1, string address2, string postalCode, string city, int countryId, DateTime? birthDate)
        {
            using (DataAccessLayer dal = new EFDataAccessLayer())
            {
                dal.Open();
                using (TransactionScope tr = new TransactionScope())
                {
                    Person p = dal.PersonDAO.Read(userId);
                    p.FirstName = firstName;
                    p.LastName = lastName;
                    p.Email = email;
                    p.Address.Address1 = address1;
                    p.Address.Address2 = address2;
                    p.Address.City = city;
                    p.Address.Country_id = countryId;
                    p.Address.PostalCode = postalCode;
                    p.Birthdate = birthDate;

                    dal.PersonDAO.Update(p);

                    dal.SaveChanges();
                    tr.Complete();
                }
                dal.Close();
            }
        }
        public void EditOrganization(int id, string name, string url, byte[] image, string email, string address1, string address2, string postalCode, string city, int countryId, List<int> tags)
        {
            using (DataAccessLayer dal = new EFDataAccessLayer())
            {
                dal.Open();
                using (TransactionScope tr = new TransactionScope())
                {
                    Organization o = dal.OrganizationDAO.Read(id);
                    o.Name = name;
                    o.Url = url;
                    o.Email = email;
                    o.Address.Address1 = address1;
                    o.Address.Address2 = address2;
                    o.Address.City = city;
                    o.Address.PostalCode = postalCode;
                    o.Address.Country_id = countryId;
                    if (image != null) o.Image = image;

                    List<Tag> removeTags = new List<Tag>();

                    foreach (var tag in o.Tag)
                    {
                        if (tags.Contains(tag.Id)) tags.Remove(tag.Id);
                        else removeTags.Add(tag);
                    }

                    foreach (var tag in removeTags)
                    {
                        o.Tag.Remove(tag);
                    }

                    foreach (var tag in tags)
                    {
                        Tag t = dal.TagDAO.Read(tag);
                        o.Tag.Add(t);
                    }

                    dal.OrganizationDAO.Update(o);

                    dal.SaveChanges();

                    tr.Complete();
                }
                dal.Close();
            }
        }