Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using Microsoft.Practices.Prism.Commands;
- using System.Windows;
- using ImportExcel.Services;
- using ImportExcel.Models;
- using System;
- using System.Threading.Tasks;
- namespace ImportExcel.ViewModels
- {
- public class MainWindowViewModel : BaseViewModel
- {
- #region Declarations
- private string filesToBeReadFolderPath;
- private string folderPathForGeneratedFile;
- private DelegateCommand<object> openFolderBrowserCommand;
- private DelegateCommand<object> generateXmlFileCommand;
- private DelegateCommand<object> clearCommand;
- #endregion
- #region Initialization
- public MainWindowViewModel()
- {
- filesToBeReadFolderPath = string.Empty;
- folderPathForGeneratedFile = string.Empty;
- }
- #endregion
- #region Properties
- public string FilesToBeReadFolderPath
- {
- get
- {
- return filesToBeReadFolderPath;
- }
- set
- {
- if (value == filesToBeReadFolderPath)
- return;
- filesToBeReadFolderPath = value;
- OnPropertyChanged("FilesToBeReadFolderPath");
- RefreshCommands();
- }
- }
- public string FolderPathForGeneratedFile
- {
- get
- {
- return folderPathForGeneratedFile;
- }
- set
- {
- if (value == folderPathForGeneratedFile)
- return;
- folderPathForGeneratedFile = value;
- OnPropertyChanged("FolderPathForGeneratedFile");
- RefreshCommands();
- }
- }
- #endregion
- #region Commands
- public DelegateCommand<object> OpenFolderBrowserCommand
- {
- get
- {
- if (openFolderBrowserCommand == null)
- openFolderBrowserCommand = new DelegateCommand<object>(OpenFolderBrowser);
- return openFolderBrowserCommand;
- }
- }
- public DelegateCommand<object> GenerateXmlFileCommand
- {
- get
- {
- if (generateXmlFileCommand == null)
- generateXmlFileCommand = new DelegateCommand<object>(GenerateXmlFile, CanGenerateXmlFile);
- return generateXmlFileCommand;
- }
- }
- public DelegateCommand<object> ClearCommand
- {
- get
- {
- if (clearCommand == null)
- clearCommand = new DelegateCommand<object>(Clear, CanClear);
- return clearCommand;
- }
- }
- #endregion
- #region Methods
- private void RefreshCommands()
- {
- GenerateXmlFileCommand.RaiseCanExecuteChanged();
- ClearCommand.RaiseCanExecuteChanged();
- }
- private void OpenFolderBrowser(object folderBrowserPurpose)
- {
- System.Windows.Forms.FolderBrowserDialog d = new System.Windows.Forms.FolderBrowserDialog();
- if ((FolderBrowserPurpose)folderBrowserPurpose == FolderBrowserPurpose.Get)
- {
- d.Description = "Избертете папка в която се намират файловете";
- d.ShowNewFolderButton = false;
- }
- else if ((FolderBrowserPurpose)folderBrowserPurpose == FolderBrowserPurpose.Save)
- {
- d.Description = "Изберете място където да се запише генерирания файл";
- d.ShowNewFolderButton = true;
- }
- if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- if ((FolderBrowserPurpose)folderBrowserPurpose == FolderBrowserPurpose.Get)
- FilesToBeReadFolderPath = d.SelectedPath;
- else if ((FolderBrowserPurpose)folderBrowserPurpose == FolderBrowserPurpose.Save)
- FolderPathForGeneratedFile = d.SelectedPath;
- }
- }
- private void GenerateXmlFile(object obj)
- {
- string fullFilePath = FolderPathForGeneratedFile + "\\TransferData.xml";
- List<string> filesInDirectory = Directory.GetFiles(FolderPathForGeneratedFile).ToList();
- if (filesInDirectory.Contains(fullFilePath))
- {
- if (MessageBox.Show("В избраната директория съществува файл със същото име! Желаете ли да бъде презаместен?", "Внимание!", MessageBoxButton.YesNo, MessageBoxImage.Information) != MessageBoxResult.Yes)
- return;
- }
- ShellSystemService.OnMouseBusy(true);
- #region Multithreading
- //IEnumerable<ImportedAccounting> importedAccountings = null;
- //Task importedAccountingTask = Task.Run(() => importedAccountings = ImportFromExcel.AccountingReports(FilesToBeReadFolderPath));
- //IEnumerable<Provider> providers = null;
- //Task providersTask = Task.Run(() => providers = ImportFromExcel.Providers(FilesToBeReadFolderPath));
- //IEnumerable<Client> clients = null;
- //Task clientsTask = Task.Run(() => clients = ImportFromExcel.Clients(FilesToBeReadFolderPath));
- //IEnumerable<Purchase> purchases = null;
- //Task purchasesTask = Task.Run(() => purchases = ImportFromExcel.VATPurchases(FilesToBeReadFolderPath));
- //IEnumerable<Sale> sales = null;
- //Task salesTask = Task.Run(() => sales = ImportFromExcel.VATSales(FilesToBeReadFolderPath));
- //IEnumerable<PurchaseCode> purchaseCodes = null;
- //Task purchaseCodesTask = Task.Run(() => purchaseCodes = ImportFromExcel.PurchaseCodes(FilesToBeReadFolderPath));
- //IEnumerable<SaleCode> saleCodes = null;
- //Task saleCodesTask = Task.Run(() => saleCodes = ImportFromExcel.SaleCodes(FilesToBeReadFolderPath));
- //IEnumerable<TransactionProviders> transactionProviders = null;
- //Task transactionProvidersTask = Task.Run(() => transactionProviders = ImportFromExcel.TransactionProviders(FilesToBeReadFolderPath));
- //IEnumerable<TransactionClients> transactionClients = null;
- //Task transactionClientsTask = Task.Run(() => transactionClients = ImportFromExcel.TranscationClients(FilesToBeReadFolderPath));
- //IDictionary<string, AccountPayroll> payrolls = null;
- //Task payrollsTask = Task.Run(() => payrolls = ImportFromExcel.Payrolls(FilesToBeReadFolderPath));
- //Task.WaitAll(new Task[] { importedAccountingTask, providersTask, clientsTask, purchasesTask, salesTask, purchaseCodesTask,
- //saleCodesTask, transactionProvidersTask, transactionClientsTask, payrollsTask});
- #endregion //Multithreading
- #region OneThread
- IEnumerable<ImportedAccounting> importedAccountings = ImportFromExcel.AccountingReports(FilesToBeReadFolderPath);
- IEnumerable<Provider> providers = ImportFromExcel.Providers(FilesToBeReadFolderPath);
- IEnumerable<Client> clients = ImportFromExcel.Clients(FilesToBeReadFolderPath);
- IEnumerable<Purchase> purchases = ImportFromExcel.VATPurchases(FilesToBeReadFolderPath);
- IEnumerable<Sale> sales = ImportFromExcel.VATSales(FilesToBeReadFolderPath);
- IEnumerable<PurchaseCode> purchaseCodes = ImportFromExcel.PurchaseCodes(FilesToBeReadFolderPath);
- IEnumerable<SaleCode> saleCodes = ImportFromExcel.SaleCodes(FilesToBeReadFolderPath);
- IEnumerable<TransactionProviders> transactionProviders = ImportFromExcel.TransactionProviders(FilesToBeReadFolderPath);
- IEnumerable<TransactionClients> transactionClients = ImportFromExcel.TranscationClients(FilesToBeReadFolderPath);
- IDictionary<string, AccountPayroll> payrolls = ImportFromExcel.Payrolls(FilesToBeReadFolderPath);
- #endregion //OneThread
- List<Company> importedCompanies = ImportedCompanies(providers, clients);
- TransferData data = DataToExport(importedAccountings, providers, clients, purchases, sales, purchaseCodes, saleCodes,
- transactionProviders, transactionClients, payrolls);
- ExportToXmlService.Export(data, fullFilePath);
- ShellSystemService.OnMouseBusy(false);
- }
- private bool ValidateAccountings(List<Accounting> solidAccountings)
- {
- if (solidAccountings == null || solidAccountings.Count == 0)
- {
- }
- List<string> invalidAccountingsNums = new List<string>();
- foreach (Accounting acc in solidAccountings)
- {
- }
- if (invalidAccountingsNums.Count > 0)
- {
- StringBuilder invalidAcc = new StringBuilder();
- for (int i = 0; i <= invalidAccountingsNums.Count; i++)
- {
- invalidAcc.Append(i + ". " + invalidAccountingsNums[i] + "\n");
- }
- return MessageBox.Show("Операции с номера: \n" + invalidAcc + "\n" + "са с невалидни суми! Желаете ли да продължи експорта?"
- , "Внимание!"
- , MessageBoxButton.YesNo
- , MessageBoxImage.Question) == MessageBoxResult.Yes;
- }
- return true;
- }
- private void ShowInvalidFilesPrompt()
- {
- }
- private bool CanGenerateXmlFile(object arg)
- {
- return FolderPathForGeneratedFile != string.Empty && FilesToBeReadFolderPath != string.Empty;
- }
- private void Clear(object obj)
- {
- FilesToBeReadFolderPath = string.Empty;
- FolderPathForGeneratedFile = string.Empty;
- }
- private bool CanClear(object arg)
- {
- return true;
- }
- private List<Company> ImportedCompanies(IEnumerable<Provider> providers, IEnumerable<Client> clients)
- {
- List<Company> importedCompanies = new List<Company>();
- foreach (Provider provider in providers)
- {
- Company currentCompany = new Company();
- currentCompany.Identificator = provider.ProviderNumber;
- currentCompany.Name = provider.Name;
- Address currentCompanyAddress = new Address();
- currentCompanyAddress.Location = provider.Address;
- currentCompany.Addresses = new List<Address>();
- currentCompany.Addresses.Add(currentCompanyAddress);
- currentCompany.Bulstat = provider.UIC;
- currentCompany.VatNumber = provider.INbyVAT;
- currentCompany.Email = provider.Email;
- currentCompany.Type = CompanyType.Supplier;
- importedCompanies.Add(currentCompany);
- }
- foreach (Client client in clients)
- {
- Company currentCompany = new Company();
- currentCompany.Identificator = client.ClientNumber;
- currentCompany.Name = client.Name;
- Address currentCompanyAddress = new Address();
- currentCompanyAddress.City = client.Address;
- currentCompany.Addresses = new List<Address>();
- currentCompany.Addresses.Add(currentCompanyAddress);
- currentCompany.Bulstat = client.UIC;
- currentCompany.VatNumber = client.INbyVAT;
- currentCompany.Email = client.Email;
- currentCompany.Type = CompanyType.Customer;
- importedCompanies.Add(currentCompany);
- }
- return importedCompanies;
- }
- private TransferData DataToExport(IEnumerable<ImportedAccounting> importedAccountings, IEnumerable<Provider> providers,
- IEnumerable<Client> clients, IEnumerable<Purchase> purchases, IEnumerable<Sale> sales, IEnumerable<PurchaseCode> purchaseCodes,
- IEnumerable<SaleCode> saleCodes, IEnumerable<TransactionProviders> transactionProviders, IEnumerable<TransactionClients> transactionClients,
- IDictionary<string, AccountPayroll> payrolls)
- {
- TransferData data = new TransferData();
- data.Accountings = new List<Accounting>();
- List<Accounting> allAccountings = new List<Accounting>();
- string currentAccountingNumber = string.Empty;
- string currentCompanyBulstat = string.Empty;
- List<Company> allComapnies = ImportedCompanies(providers, clients);
- Accounting currentAccounting = new Accounting();
- List<AccountingDetail> currentDetails = new List<AccountingDetail>();
- var watch = System.Diagnostics.Stopwatch.StartNew();
- for (int i = 0; i < 10000; i++)
- {
- ImportedAccounting currentElement = importedAccountings.ElementAt(i);
- try
- {
- if (currentAccountingNumber == currentElement.Number)
- {
- allAccountings.Remove(currentAccounting);
- AccountingDetail currentDetail = new AccountingDetail();
- Account currentAccount = new Account();
- if (payrolls.ContainsKey(currentElement.FinancialAccount))
- {
- currentAccount.Number = payrolls[currentElement.FinancialAccount]?.Code;
- currentAccount.Description = payrolls[currentElement.FinancialAccount]?.Name;
- }
- if (currentDetails.Any(x => x.Account.Number == currentAccount.Number))
- {
- currentDetail = currentAccounting.AccountingDetails.FirstOrDefault(x => x.AccountNumber == currentAccount.Number);
- if (currentElement.Currency != "BGN")
- {
- AccountingCurrencyDetail currentCurrencyDetail = new AccountingCurrencyDetail();
- currentCurrencyDetail.Currency = currentElement.Currency;
- currentCurrencyDetail.CurrencyAmount = Math.Abs(currentElement.CurrencyAmount);
- if (currentElement.CurrencyAmount != 0)
- {
- currentCurrencyDetail.ExchangeRate = Math.Round(currentElement.Amount / currentElement.CurrencyAmount, 5);
- }
- else
- {
- currentCurrencyDetail.ExchangeRate = 1;
- }
- currentCurrencyDetail.FixedRate = Math.Round(currentElement.FixedRate,5);
- if (currentDetail.AccountingCurrencyDetail != null)
- currentDetail.AccountingCurrencyDetail.CurrencyAmount += currentCurrencyDetail.CurrencyAmount;
- else
- currentDetail.AccountingCurrencyDetail = currentCurrencyDetail;
- }
- currentDetails.FirstOrDefault(x => x.Account.Number == currentAccount.Number).Amount += Math.Abs(currentElement.Amount);
- }
- else
- {
- currentDetail.Account = currentAccount;
- currentDetail.AccountNumber = currentDetail.Account.Number;
- currentDetail.AccountDescription = currentDetail.Account.Description;
- currentDetail.Direction = currentElement.Direction;
- if (currentElement.Currency != "BGN")
- {
- AccountingCurrencyDetail currentCurrencyDetail = new AccountingCurrencyDetail();
- currentCurrencyDetail.Currency = currentElement.Currency;
- currentCurrencyDetail.CurrencyAmount = Math.Abs(currentElement.CurrencyAmount);
- if (currentElement.CurrencyAmount != 0)
- {
- currentCurrencyDetail.ExchangeRate = Math.Round(currentElement.Amount / currentElement.CurrencyAmount, 5);
- }
- else
- {
- currentCurrencyDetail.ExchangeRate = 1;
- }
- currentCurrencyDetail.FixedRate = Math.Round(currentElement.FixedRate, 5);
- if (currentDetail.AccountingCurrencyDetail != null)
- currentDetail.AccountingCurrencyDetail.CurrencyAmount += currentCurrencyDetail.CurrencyAmount;
- else
- currentDetail.AccountingCurrencyDetail = currentCurrencyDetail;
- }
- currentDetail.Amount = Math.Abs(currentElement.Amount);
- //TODO should add currentDetail.VatTerm
- currentDetails.Add(currentDetail);
- currentAccounting.AccountingDetails = currentDetails;
- }
- }
- else
- {
- currentDetails = new List<AccountingDetail>();
- currentAccountingNumber = currentElement.Number;
- currentAccounting = new Accounting();
- currentAccounting.Number = importedAccountings.ElementAt(i).Number;
- currentAccounting.AccountingDate = currentElement.AccountingDate;
- Document currentDocument = new Document();
- TransactionClients currentTransactionClient = transactionClients.FirstOrDefault(x => x.AccountingOperationNumber == currentAccounting.Number);
- TransactionProviders currentTransactionProvider = transactionProviders.FirstOrDefault(x => x.AccountingOperationNumber == currentAccounting.Number);
- DateTime currentDocumentDate = new DateTime();
- string currentViesMonthCode = string.Empty;
- if (currentTransactionClient != null)
- {
- Sale currentSale = sales.FirstOrDefault(x => x.DocumentNumber == currentTransactionClient.Invoice);
- if (currentSale != null)
- {
- if (DateTime.TryParse(currentSale.DocumentDate, out currentDocumentDate))
- {
- if (currentDocumentDate == DateTime.MinValue)
- {
- currentDocument.Date = currentAccounting.AccountingDate;
- }
- else
- {
- currentDocument.Date = currentDocumentDate;
- }
- }
- currentDocument.Number = currentSale.DocumentNumber;
- currentCompanyBulstat = currentSale.PartnerBulstat;
- currentViesMonthCode = currentSale.Code;
- }
- string currentViewMonth = saleCodes.FirstOrDefault(x => x.Code == currentViesMonthCode)?.Name;
- DateTime currentViewMonthTemp = new DateTime();
- DateTime.TryParse(currentViewMonth, out currentViewMonthTemp);
- if (currentViewMonthTemp != DateTime.MinValue)
- currentAccounting.ViesMonth = currentViewMonthTemp;
- else
- currentAccounting.ViesMonth = currentAccounting.AccountingDate;
- Company currentCompany = allComapnies.FirstOrDefault(x => x.VatNumber == currentCompanyBulstat);
- if (currentCompany != null)
- {
- currentAccounting.Company = currentCompany;
- }
- currentAccounting.Term = currentElement.Description;
- AccountingDetail currentDetail = new AccountingDetail();
- Account currentAccount = new Account();
- currentAccount.Number = payrolls.FirstOrDefault(x => x.Key == currentElement.FinancialAccount).Value.Code;
- currentAccount.Description = payrolls.FirstOrDefault(x => x.Key == currentElement.FinancialAccount).Value.Name;
- currentDocument.DocumentType = DocumentType(currentAccounting.Number, currentDetail.Direction);
- currentAccounting.Document = currentDocument;
- currentDetail.Account = currentAccount;
- currentDetail.AccountNumber = currentDetail.Account.Number;
- currentDetail.AccountDescription = currentDetail.Account.Description;
- currentDetail.Direction = currentElement.Direction;
- if (currentElement.Currency != "BGN")
- {
- AccountingCurrencyDetail currentCurrencyDetail = new AccountingCurrencyDetail();
- currentCurrencyDetail.Currency = currentElement.Currency;
- currentCurrencyDetail.CurrencyAmount = Math.Abs(currentElement.CurrencyAmount);
- if (currentElement.CurrencyAmount != 0)
- {
- currentCurrencyDetail.ExchangeRate = Math.Round(currentElement.Amount / currentElement.CurrencyAmount, 5);
- }
- else
- {
- currentCurrencyDetail.ExchangeRate = 1;
- }
- currentCurrencyDetail.FixedRate = Math.Round(currentElement.FixedRate, 5);
- currentDetail.AccountingCurrencyDetail = currentCurrencyDetail;
- }
- currentDetail.Amount = Math.Abs(currentElement.Amount);
- //TODO should add currentDetail.VatTerm
- if (currentDetail != null)
- {
- currentDetails.Add(currentDetail);
- }
- if (currentAccounting.AccountingDetails == null)
- {
- currentAccounting.AccountingDetails = new List<AccountingDetail>();
- }
- currentAccounting.AccountingDetails = currentDetails;
- }
- else if (currentTransactionProvider != null)
- {
- string currentTransactionProviders = transactionProviders.FirstOrDefault(x => x.AccountingOperationNumber == currentAccounting.Number).Invoice;
- Purchase currentPurchase = purchases.FirstOrDefault(x => x.DocumentNumber == currentTransactionProviders);
- if (currentPurchase != null)
- {
- if (DateTime.TryParse(currentPurchase.DocumentDate, out currentDocumentDate))
- {
- if (currentDocumentDate == DateTime.MinValue)
- {
- currentDocument.Date = currentAccounting.AccountingDate;
- }
- else
- {
- currentDocument.Date = currentDocumentDate;
- }
- }
- currentDocument.Number = currentPurchase.DocumentNumber;
- int currentDocumentType = 0;
- int.TryParse(currentPurchase.DocumentType, out currentDocumentType);
- currentDocument.DocumentType = currentDocumentType;
- currentCompanyBulstat = currentPurchase.PartnerBulstat;
- currentViesMonthCode = currentPurchase.Code;
- }
- string currentViewMonth = saleCodes.FirstOrDefault(x => x.Code == currentViesMonthCode)?.Name;
- DateTime currentViewMonthTemp = new DateTime();
- DateTime.TryParse(currentViewMonth, out currentViewMonthTemp);
- if (currentViewMonthTemp != DateTime.MinValue)
- currentAccounting.ViesMonth = currentViewMonthTemp;
- else
- currentAccounting.ViesMonth = currentAccounting.AccountingDate;
- Company currentCompany = allComapnies.FirstOrDefault(x => x.VatNumber == currentCompanyBulstat);
- if (currentCompany != null)
- {
- currentAccounting.Company = currentCompany;
- }
- currentAccounting.Term = currentElement.Description;
- AccountingDetail currentDetail = new AccountingDetail();
- Account currentAccount = new Account();
- currentAccount.Number = payrolls.FirstOrDefault(x => x.Key == currentElement.FinancialAccount).Value.Code;
- currentAccount.Description = payrolls.FirstOrDefault(x => x.Key == currentElement.FinancialAccount).Value.Name;
- currentDocument.DocumentType = DocumentType(currentAccounting.Number, currentDetail.Direction);
- currentAccounting.Document = currentDocument;
- currentDetail.Account = currentAccount;
- currentDetail.AccountNumber = currentDetail.Account.Number;
- currentDetail.AccountDescription = currentDetail.Account.Description;
- currentDetail.Direction = currentElement.Direction;
- if (currentElement.Currency != "BGN")
- {
- AccountingCurrencyDetail currentCurrencyDetail = new AccountingCurrencyDetail();
- currentCurrencyDetail.Currency = currentElement.Currency;
- currentCurrencyDetail.CurrencyAmount = Math.Abs(currentElement.CurrencyAmount);
- if (currentElement.CurrencyAmount != 0)
- {
- currentCurrencyDetail.ExchangeRate = Math.Round(currentElement.Amount / currentElement.CurrencyAmount, 5);
- }
- else
- {
- currentCurrencyDetail.ExchangeRate = 1;
- }
- currentCurrencyDetail.FixedRate = Math.Round(currentElement.FixedRate, 5);
- currentDetail.AccountingCurrencyDetail = currentCurrencyDetail;
- }
- currentDetail.Amount = Math.Abs(currentElement.Amount);
- //TODO should add currentDetail.VatTerm
- if (currentDetail != null)
- {
- currentDetails.Add(currentDetail);
- }
- if (currentAccounting.AccountingDetails == null)
- {
- currentAccounting.AccountingDetails = new List<AccountingDetail>();
- }
- currentAccounting.AccountingDetails = currentDetails;
- }
- else
- {
- string currentViewMonth = saleCodes.FirstOrDefault(x => x.Code == currentViesMonthCode)?.Name;
- DateTime currentViewMonthTemp = new DateTime();
- DateTime.TryParse(currentViewMonth, out currentViewMonthTemp);
- if (currentViewMonthTemp != DateTime.MinValue)
- currentAccounting.ViesMonth = currentViewMonthTemp;
- else
- currentAccounting.ViesMonth = currentAccounting.AccountingDate;
- currentAccounting.Term = currentElement.Description;
- AccountingDetail currentDetail = new AccountingDetail();
- Account currentAccount = new Account();
- currentAccount.Number = payrolls.FirstOrDefault(x => x.Key == currentElement.FinancialAccount).Value.Code;
- currentAccount.Description = payrolls.FirstOrDefault(x => x.Key == currentElement.FinancialAccount).Value.Name;
- currentDocument.Date = currentAccounting.AccountingDate;
- currentDocument.DocumentType = DocumentType(currentAccounting.Number, currentDetail.Direction);
- currentAccounting.Document = currentDocument;
- currentDetail.Account = currentAccount;
- currentDetail.AccountNumber = currentDetail.Account.Number;
- currentDetail.AccountDescription = currentDetail.Account.Description;
- currentDetail.Direction = currentElement.Direction;
- currentDetail.Amount = Math.Abs(currentElement.CurrencyAmount);
- //TODO should add currentDetail.VatTerm
- if (currentDetail != null)
- {
- currentDetails.Add(currentDetail);
- }
- if (currentAccounting.AccountingDetails == null)
- {
- currentAccounting.AccountingDetails = new List<AccountingDetail>();
- }
- currentAccounting.AccountingDetails = currentDetails;
- }
- }
- }
- catch (NullReferenceException ex)
- {
- }
- finally
- {
- if (currentAccounting != null)
- allAccountings.Add(currentAccounting);
- }
- }
- watch.Stop();
- var elapsedMs = watch.ElapsedMilliseconds;
- data.Accountings = allAccountings;
- return data;
- }
- private int DocumentType(string number, OperationDirection operationDirection)
- {
- string code = number.Substring(0, 2);
- switch (code)
- {
- case "IR":
- return 1;
- case "RE":
- return 10;
- case "ПО":
- return 15;
- case "CV":
- if (operationDirection == OperationDirection.Credit)
- {
- return 9;
- }
- else
- {
- return 8;
- }
- case "BO":
- return 11;
- case "GL":
- return 10;
- case "SI":
- return 1;
- case "FI":
- return 1;
- case "SC":
- if (operationDirection == OperationDirection.Credit)
- {
- return 3;
- }
- else
- {
- return 2;
- }
- case "PR":
- return 10;
- case "FA":
- return 10;
- default:
- return -1;
- }
- }
- #endregion
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement