public static void LoadReestersFromCity(string mailexRootDir) { if (string.IsNullOrEmpty(mailexRootDir)) { throw new System.ApplicationException("Не задан корневой каталог АРМ \"Обмен реестрами\""); } MailExConfiguration mailExConfig = new MailExConfiguration(mailexRootDir); LoadReestersFromCity(mailExConfig); }
public static void LoadReestersFromCity(MailExConfiguration mailExConfig) { PayPaymentSystem paymentSystem = PayPaymentSystem.FindAll().FindByProperty("Name", "Система \"Город\""); string valueByName = Setting.GetValueByName("Взаимодействие с системой \"Город\"", "Код услуги"); if (string.IsNullOrEmpty(valueByName)) { throw new System.ApplicationException("Не найдена константа кода услуги для системы \"Город\""); } string[] strArray = valueByName.Split((char[]) new char[] { ' ', ',', ';' }, System.StringSplitOptions.RemoveEmptyEntries); System.Collections.Generic.List<int> allowedServices = new System.Collections.Generic.List<int>(); string[] strArray2 = strArray; for (int i = 0; i < strArray2.Length; i = (int) (i + 1)) { string str2 = strArray2[i]; int num = System.Convert.ToInt32(str2); if (num > 0) { allowedServices.Add(num); } } foreach (Reester248 reester in mailExConfig.GetReesters(new ReesterType[] { ReesterType.OUT_CASHPAY, ReesterType.OUT_CASHLESS, ReesterType.OUT_STORNO }, allowedServices, sourceFileName => !new System.IO.FileInfo(sourceFileName).get_Name().StartsWith("Z"))) { try { SaveCityReesterToDatabase(reester, paymentSystem, AIS.SN.Model.DomainObjects.Organization.Null); System.IO.FileInfo info = new System.IO.FileInfo(reester.FileName); info.MoveTo(info.Directory + @"\Z_" + info.get_Name()); } catch (System.Exception exception) { throw new System.ApplicationException("Не удалось сохранить файл реестра " + reester.FileName, exception); } } }