protected void TestImportResultPostprocess(IObjectSpace os, fmCSAImportResult result) { foreach (fmCSAStatementAccount sa in result.StatementOfAccounts) { TestStatementAccountPostProcess(os, sa); } }
private void ProcessAction_Execute(object sender, SimpleActionExecuteEventArgs e) { if (View == null || View.CurrentObject == null || View.CurrentObject as fmCSATaskImporter == null) { return; } fmCSATaskImporter taskImporter = View.CurrentObject as fmCSATaskImporter; fmCSAImportResult importResult = fmCSAStatementAccountImportLogic.ImportProcess(this.ObjectSpace, taskImporter); if (importResult != null) { string DetailViewId = Frame.Application.FindDetailViewId(importResult.GetType()); IObjectSpace objectSpace = Frame.Application.CreateObjectSpace(); BaseObject passedObj = objectSpace.GetObject <BaseObject>(importResult); TargetWindow openMode = TargetWindow.NewWindow; DetailView dv = Frame.Application.CreateDetailView(objectSpace, DetailViewId, true, passedObj); ShowViewParameters svp = new ShowViewParameters() { CreatedView = dv, TargetWindow = openMode, Context = TemplateContext.View, CreateAllControllers = true }; e.ShowViewParameters.Assign(svp); } else { throw new Exception("Statement of accounts has not been created"); } }
public void TestImportSBRF() { IObjectSpace os; using (os = Application.CreateObjectSpace()) { fmCSAImportResult result = ImportSBRF(os); os.CommitChanges(); // Assert.AreEqual(result.ResultCode, 1); Assert.AreEqual(result.StatementOfAccounts.Count, 6); } }
public void TestImportFailAccount() { IObjectSpace os; using (os = Application.CreateObjectSpace()) { crmBank bank = BankGet(os, "044525187", "ВТБ"); // Stream stream = GetTestDataStream("fmSAImportTest01.txt"); fmCSATaskImporterFile task = ImportTaskGet(os, bank, "VTB", "fmSAImportTest01.txt"); os.CommitChanges(); fmCSAImportResult result = task.ExecuteTask(GetTestDataStream("fmSAImportTest01.txt")); // Assert.AreEqual(result.ResultCode, -1); } }
protected fmCSAImportResult ImportNMB(IObjectSpace os) { crmBank bank = BankGet(os, "044579852", "НМБ"); fmCSATaskImporterFile task = ImportTaskGet(os, bank, "NMB", "fmSAImportTest03.txt"); crmCLegalPerson pers = LegalPersonGet(os, "2518", "НПО машиностроения", "5012039795", "509950001"); crmBankAccount acc; acc = BankAccountGet(os, bank, "40502810000000000007", pers.Person); acc.PrefferedParty = pers.Party; os.CommitChanges(); fmCSAImportResult result = task.ExecuteTask(GetTestDataStream("fmSAImportTest03.txt")); return(result); }
public void TestImportResultProcessActionEVF() { IObjectSpace os; using (os = Application.CreateObjectSpace()) { fmCSAImportResult result = ImportEVF(os); os.CommitChanges(); fmCDocRCBImportResultViewController controller = new fmCDocRCBImportResultViewController(); controller.SetView(Application.CreateDetailView(os, result)); controller.ProcessAction.DoExecute(); Assert.AreEqual(result.ResultCode, 3); TestImportResultPostprocess(os, result); } }
private void ProcessAction_Execute(object sender, SimpleActionExecuteEventArgs e) { if (View == null || View.CurrentObject == null) { return; } fmCSAImportResult result = View.CurrentObject as fmCSAImportResult; if (result == null) { return; } if (result.TaskImporter == null) { return; } fmCSAStatementAccountImportLogic.PostProcess(this.ObjectSpace, result.TaskImporter, result); this.ObjectSpace.CommitChanges(); }
protected fmCSAImportResult ImportVTB(IObjectSpace os) { crmBank bank = BankGet(os, "044525187", "ВТБ"); fmCSATaskImporterFile task = ImportTaskGet(os, bank, "VTB", "fmSAImportTest01.txt"); crmCLegalPerson pers = LegalPersonGet(os, "2518", "НПО машиностроения", "5012039795", "509950001"); crmBankAccount acc; acc = BankAccountGet(os, bank, "40702840500030002016", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702840200030002015", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702810400030003459", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702978400030001542", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702978100030001541", pers.Person); acc.PrefferedParty = pers.Party; os.CommitChanges(); fmCSAImportResult result = task.ExecuteTask(GetTestDataStream("fmSAImportTest01.txt")); return(result); }
protected fmCSAImportResult ImportEVF(IObjectSpace os) { crmBank bank = BankGet(os, "044525204", "Еврофинанс"); fmCSATaskImporterFile task = ImportTaskGet(os, bank, "EVF", "fmSAImportTest04.txt"); crmCLegalPerson pers = LegalPersonGet(os, "2518", "НПО машиностроения", "5012039795", "509950001"); crmBankAccount acc; acc = BankAccountGet(os, bank, "40702810000002651190", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702840500002651039", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702840500002651181", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702840600002651191", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702978200002651188", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40702978300002651198", pers.Person); acc.PrefferedParty = pers.Party; os.CommitChanges(); fmCSAImportResult result = task.ExecuteTask(GetTestDataStream("fmSAImportTest04.txt")); return(result); }
protected fmCSAImportResult ImportSBRF(IObjectSpace os) { crmBank bank = BankGet(os, "044525225", "Сбербанк"); fmCSATaskImporterFile task = ImportTaskGet(os, bank, "SBRF", "fmSAImportTest02.txt"); crmCLegalPerson pers = LegalPersonGet(os, "2518", "НПО машиностроения", "5012039795", "509950001"); crmBankAccount acc; acc = BankAccountGet(os, bank, "40502810240040102530", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40502810940040105316", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40502840440040202530", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40502840540040102530", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40502978040040202530", pers.Person); acc.PrefferedParty = pers.Party; acc = BankAccountGet(os, bank, "40502978140040102530", pers.Person); acc.PrefferedParty = pers.Party; os.CommitChanges(); fmCSAImportResult result = task.ExecuteTask(GetTestDataStream("fmSAImportTest02.txt")); return(result); }