public static void OverwriteCardboardProfiles(PPDataContext dbFrom, PPDataContext dbTo, IProcessingCallback callback)
 {
     foreach (CardboardProfile cp in dbFrom.CardboardProfiles)
     {
         if (CardboardProfile.HasByName(dbTo, cp.Name))
         {
             if (null != callback)
             {
                 callback.Info(string.Format("Cardboard profile {0} already exists. Skipping...", cp.Name));
             }
             CardboardProfile cardboardProf = CardboardProfile.GetByName(dbTo, cp.Name);
             cardboardProf.Code      = cp.Code;
             cardboardProf.Thickness = cp.Thickness;
             dbTo.SubmitChanges();
         }
         else
         {
             if (null != callback)
             {
                 callback.Info(string.Format("Creating carboard profile {0}...", cp.Name));
             }
             CardboardProfile.CreateNew(dbTo, cp.Name, cp.Code, cp.Thickness);
         }
     }
 }
 public static void MergeCardboardProfiles(PPDataContext dbFrom, PPDataContext dbTo, List <string> listCardboardProfiles, IProcessingCallback callback)
 {
     foreach (string cpName in listCardboardProfiles)
     {
         CardboardProfile cp = CardboardProfile.GetByName(dbFrom, cpName);
         if (null != cp)
         {
             if (CardboardProfile.HasByName(dbTo, cp.Name))
             {
                 if (null != callback)
                 {
                     callback.Info(string.Format("Cardboard profile {0} already exists. Skipping...", cp.Name));
                 }
             }
             else if (CardboardProfile.HasByCode(dbTo, cp.Code))
             {
                 if (null != callback)
                 {
                     callback.Info(string.Format("Cardboard profile with code {0} already exists. Skipping...", cp.Code));
                 }
             }
             else
             {
                 if (null != callback)
                 {
                     callback.Info(string.Format("Creating carboard profile {0}...", cp.Name));
                 }
                 CardboardProfile.CreateNew(dbTo, cp.Name, cp.Code, cp.Thickness);
             }
         }
     }
 }
 public static void MergeCardboardProfiles(PPDataContext dbFrom, PPDataContext dbTo, IProcessingCallback callback)
 {
     foreach (CardboardProfile cp in dbFrom.CardboardProfiles)
     {
         if (CardboardProfile.HasByName(dbTo, cp.Name))
         {
             if (null != callback)
             {
                 callback.Info(string.Format("Cardboard profile {0} already exists. Skipping...", cp.Name));
             }
         }
         else
         {
             if (null != callback)
             {
                 callback.Info(string.Format("Creating carboard profile {0}...", cp.Name));
             }
             CardboardProfile.CreateNew(dbTo, cp.Name, cp.Code, cp.Thickness);
         }
     }
 }