Beispiel #1
0
        /// <summary>
        /// Finds an existing registration based upon the specified guid.
        /// </summary>
        /// <param name="guid"></param>
        /// <param name="createIfNecessary">Set to true to create a new registration if one doesn't exist.</param>
        /// <returns></returns>
        public static Registration FindExisting(String guid, Boolean createIfNecessary)
        {
            RegistrationDao dao = new RegistrationDao();
            Registration registration = dao.FindByGuid(guid);
            if ((createIfNecessary) && (registration == null))
            {
                registration = new Registration();
                registration.Guid = guid;
                registration.Created = UtcDateTime.Now;
            }

            return registration;
        }
Beispiel #2
0
 /// <summary>
 /// Saves or updates the registration
 /// </summary>
 /// <param name="registration"></param>
 public static void Save(Registration registration)
 {
     RegistrationDao dao = new RegistrationDao();
     using (Transaction tx = new Transaction())
     {
         dao.Save(registration);
         tx.Commit();
     }
 }
Beispiel #3
0
 public static Registration Load(string guid)
 {
     RegistrationDao dao = new RegistrationDao();
     return dao.FindByGuid(guid);
 }
Beispiel #4
0
 private static void Delete(Registration registration)
 {
     RegistrationDao dao = new RegistrationDao();
     using (Transaction tx = new Transaction())
     {
         dao.DeleteObject(registration);
         tx.Commit();
     }
 }