public void NewCollection(signcollection clt)
 {
     using (database content = new database())
     {
         content.signcollection.Add(clt);
         content.SaveChanges();
     }
 }
 public void UpdateAdministrator(administrator admin)
 {
     using (database content = new database())
     {
         administrator a = content.administrator.FirstOrDefault(i => i.username == admin.username);
         a.password = admin.password;
         content.SaveChanges();
     }
 }
        public int NewOrganisation(organisation org)
        {
            using (database content = new database())
            {
                content.organisation.Add(org);
                content.SaveChanges();

                organisation newOrg = content.organisation.OrderByDescending(i => i.id).FirstOrDefault();
                return(newOrg.id);
            }
        }
 public void UpdateOrganisation(organisation org)
 {
     using (database content = new database())
     {
         organisation ori = content.organisation.FirstOrDefault(i => i.id == org.id);
         if (ori != null)
         {
             ori.name    = org.name;
             ori.email   = org.email;
             ori.address = org.address;
             ori.tel     = org.tel;
             content.SaveChanges();
         }
     }
 }
 public void UpdateSignCollection(signcollection sc)
 {
     using (database content = new database())
     {
         signcollection ori = content.signcollection.FirstOrDefault(i => i.collectionId == sc.collectionId);
         if (ori != null)
         {
             ori.password           = sc.password;
             ori.name               = sc.name;
             ori.contactPerson      = sc.contactPerson;
             ori.contactPersonEmail = sc.contactPersonEmail;
             ori.contactPersonTel   = sc.contactPersonTel;
             ori.contactPersonTitle = sc.contactPersonTitle;
             content.SaveChanges();
         }
     }
 }