private void SaveBackupEntranceGuardCardInfo(List <EntranceGuardCard> Eclst) { EntranceGuardCardInfoBackupList backUpList = new EntranceGuardCardInfoBackupList(); backUpList.EcList = new List <EntranceGuardCardInfoBackup>(); foreach (var item in Eclst) { EntranceGuardCardInfoBackup Ec = new EntranceGuardCardInfoBackup(); if (item.Abutment_Id != null) { Ec.Abutment_Id = (int)item.Abutment_Id; } else { Ec.Abutment_Id = -1; } Ec.Code = item.Code; Ec.State = item.State; backUpList.EcList.Add(Ec); } string initFile = InitPaths.GetBackupEntranceGuardCardInfo(); XmlSerializeHelper.Save(backUpList, initFile, Encoding.UTF8); }
private void InitEntranceGuardCard() { Log.Info(LogTags.DbInit, "导入门禁卡信息"); //string basePath = AppDomain.CurrentDomain.BaseDirectory; string filePath = InitPaths.GetBackupEntranceGuardCardInfo(); bool value = EntranceGuardCardBackupHelper.ImportEntranceGuardCardInfoFromFile(filePath, _bll); Log.Info(LogTags.DbInit, string.Format("导入门禁卡信息结果:{0}", value)); }