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); } } } }