public async Task Initialize() { _coreDriver = new CoreDriver(); await StoragePreparation.EstablishFolder_2012_07( TestFolderPath.CREATING_TRANSDATA_WITH_ENTRY_PATH , _coreDriver); }
/// <summary> /// constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="id"></param> /// <param name="type"></param> internal DocumentIndexItemWithBalance(CoreDriver coreDriver, MasterDataIdentity id, MasterDataType type) : base(coreDriver, id) { _type = type; _sum = new CurrencyAmount(); }
public static async Task <HeadEntity> CreateGLDoc(CoreDriver coreDriver, DateTime date) { HeadEntity headEntity = new HeadEntity(coreDriver, coreDriver.MdMgmt); headEntity.setPostingDate(date); headEntity.SetDocumentType(DocumentType.GL); headEntity.SetDocText(TestData.TEXT_GL_DOC); ItemEntity item1 = headEntity.CreateEntity(); item1.SetGLAccount(new MasterDataIdentity_GLAccount( TestData.GL_ACCOUNT_BANK)); item1.SetAmount(CreditDebitIndicator.CREDIT, TestData.AMOUNT_GL); ItemEntity item2 = headEntity.CreateEntity(); item2.SetGLAccount(new MasterDataIdentity_GLAccount( TestData.GL_ACCOUNT_CASH)); item2.SetAmount(CreditDebitIndicator.DEBIT, TestData.AMOUNT_GL); try { await headEntity.SaveAsync(true); } catch (Exception e) { Assert.Fail(e.ToString()); } return(headEntity); }
/// <summary> /// Construct /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <param name="id"></param> /// <param name="descp"></param> /// <exception cref="ArgumentNullException">argument is null</exception> protected MasterDataBase(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity id, String descp) { if (id == null) { throw new ArgumentNullException("Identity"); } if (coreDriver == null) { throw new ArgumentNullException("CoreDriver"); } if (management == null) { throw new ArgumentNullException("Management"); } if (descp == null) { throw new ArgumentNullException("Description"); } _coreDriver = coreDriver; _management = management; _identity = id; _descp = descp; }
public static void Take(TemplateManifest manifestObject) { _driver = new CoreDriver(Config.ChromeBrowserUserProfilePath); var chromeInstance = _driver.Driver; InitializeBrowser(chromeInstance); var elementQueries = new List <BlockElement>(); foreach (var block in manifestObject.blocks) { foreach (var item in block.items) { var blockItem = new BlockElement { Element = chromeInstance.FindElement(By.CssSelector(item.query)), FileName = item.thumbnail }; elementQueries.Add(blockItem); } } TakeScreenShots(chromeInstance, elementQueries); CloseBrowser(); }
/// <summary> /// constructor /// </summary> private DataCore() { _monthAdapter = new MonthAdapter(this); _reportAdatper = new ReportTypesAdapter(this); _costAdapter = new CostReportsAdapter(this); _coreDriver = new CoreDriver(); }
public static async Task <HeadEntity> CreateVendorDoc(CoreDriver coreDriver, DateTime date) { HeadEntity headEntity = new HeadEntity(coreDriver, coreDriver.MdMgmt); headEntity.setPostingDate(date); headEntity.SetDocumentType(DocumentType.VENDOR_INVOICE); headEntity.SetDocText(TestData.TEXT_VENDOR_DOC); ItemEntity item1 = headEntity.CreateEntity(); MasterDataIdentity_GLAccount rec_account = new MasterDataIdentity_GLAccount( TestData.GL_ACCOUNT_CASH); item1.SetVendor(new MasterDataIdentity(TestData.VENDOR_BUS), rec_account); item1.SetAmount(CreditDebitIndicator.CREDIT, TestData.AMOUNT_VENDOR); ItemEntity item2 = headEntity.CreateEntity(); item2.SetGLAccount(new MasterDataIdentity_GLAccount( TestData.GL_ACCOUNT_COST)); item2.SetAmount(CreditDebitIndicator.DEBIT, TestData.AMOUNT_VENDOR); item2.SetBusinessArea(new MasterDataIdentity( TestData.BUSINESS_AREA_WORK)); try { await headEntity.SaveAsync(true); } catch (Exception e) { Assert.Fail(e.ToString()); } return(headEntity); }
/// <summary> /// Constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="id"></param> internal DocumentIndexItem(CoreDriver coreDriver, MasterDataIdentity id) { _coreDriver = coreDriver; _id = id; _list = new List<HeadEntity>(); _amountList = new Dictionary<MonthIdentity, CurrencyAmount>(); }
/// <summary> /// /// constructor /// </summary> /// <param name="coreDriver"></param> public GLAccountEntry(CoreDriver coreDriver , MasterDataManagement mdMgmt) { _coreDriver = coreDriver; _mdMgmt = mdMgmt; _isSaved = false; }
/// <summary> /// Parse master data from XML /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="ArgumentNullException">Argument is null</exception> /// <exception cref="SystemException">Bug</exception> public override MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem) { XAttribute id = elem.Attribute(MasterDataUtils.XML_ID); XAttribute descp = elem.Attribute(MasterDataUtils.XML_DESCP); XAttribute criticalLevel = elem .Attribute(MasterDataUtils.XML_CRITICAL_LEVEL); // check attribute if (criticalLevel == null) { throw new MasterDataFileFormatException( MasterDataType.BUSINESS_AREA); } if (criticalLevel.Value.Length != 1 || (criticalLevel.Value[0] != (char)CriticalLevel.HIGH && criticalLevel.Value[0] != (char)CriticalLevel.MEDIUM && criticalLevel.Value[0] != (char)CriticalLevel.LOW)) { _coreDriver .logDebugInfo(this.GetType(), 154, "Format of critical level is error", MessageType.ERRO); throw new MasterDataFileFormatException( MasterDataType.BUSINESS_AREA); } CriticalLevel l = (CriticalLevel)criticalLevel.Value[0]; MasterDataIdentity identity; try { identity = new MasterDataIdentity(id.Value); } catch (Exception e) { _coreDriver .logDebugInfo(this.GetType(), 154, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException( MasterDataType.BUSINESS_AREA); } try { BusinessAreaMasterData businessArea = (BusinessAreaMasterData)this .CreateNewMasterDataBase(identity, descp.Value, l); _coreDriver.logDebugInfo( this.GetType(), 130, String.Format("Parse business area ({0}).", businessArea.Identity.ToString()), MessageType.INFO); return(businessArea); } catch (Exception e) { throw new SystemException(e); } }
/// <summary> /// Constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="id"></param> internal DocumentIndexItem(CoreDriver coreDriver, MasterDataIdentity id) { _coreDriver = coreDriver; _id = id; _list = new List <HeadEntity>(); _amountList = new Dictionary <MonthIdentity, CurrencyAmount>(); }
/// <summary> /// Constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <param name="id"></param> /// <param name="descp"></param> /// <param name="bankAccount"></param> /// <exception cref="ArgumentNullException">Argument is null.</exception> /// <exception cref="NoGLAccountGroupException">No such G\L account group exception</exception> public GLAccountMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity_GLAccount id, String descp, MasterDataIdentity bankAccount) : base(coreDriver, management, id, descp) { // check id and get group String groupId = id.ToString().Substring(0, 4); try { _group = GLAccountGroup.Parse(groupId); } catch (GLAccountGroupFormatException) { throw new NoGLAccountGroupException(groupId); } if (bankAccount == null) { _bankAccount = null; } else { MasterDataBase bankAccountId = _management.GetMasterData( bankAccount, MasterDataType.BANK_ACCOUNT); if (bankAccountId == null) { throw new MasterDataIdentityNotDefined(bankAccount, MasterDataType.BANK_ACCOUNT); } _bankAccount = bankAccountId.GetIdentity(); } // init amount _initAmount = new CurrencyAmount(); }
/// <summary> /// construct /// </summary> /// <param name="coreDriver"></param> /// <param name="mdMgmt"></param> public TransactionDataManagement(CoreDriver coreDriver, MasterDataManagement mdMgmt) : base(coreDriver) { _masterDataMgmt = mdMgmt; _list = new Dictionary <MonthIdentity, MonthLedger>(); _glAccBalCol = new GLAccountBalanceCollection(_coreDriver, _masterDataMgmt); }
/// <summary> /// construct /// </summary> /// <param name="coreDriver"></param> /// <param name="mdMgmt"></param> public TransactionDataManagement(CoreDriver coreDriver, MasterDataManagement mdMgmt) : base(coreDriver) { _masterDataMgmt = mdMgmt; _list = new Dictionary<MonthIdentity, MonthLedger>(); _glAccBalCol = new GLAccountBalanceCollection(_coreDriver, _masterDataMgmt); }
public async Task Initialize() { StorageFolder folder = await StoragePreparation.PrepareDataForLoadingAsync( TestFolderPath.LOADING_DATA_PATH); _coreDriver = new CoreDriver(); _coreDriver.RootFolder = folder; await _coreDriver.RestartAsync(); }
public ReportsManagement(CoreDriver coreDriver, MasterDataManagement mdMgmt) : base(coreDriver) { _mdMgmt = mdMgmt; indexes = new DocumentIndex[DocumentIndex.INDEX_COUNT]; indexes[DocumentIndex.ACCOUNT_INDEX] = new DocumentAccountIndex( _coreDriver, mdMgmt); indexes[DocumentIndex.BUSINESS_INDEX] = new DocumentBusinessIndex( _coreDriver, mdMgmt); }
public async Task Initialize() { StorageFolder folder = await StoragePreparation.CreateRootFolder( TestFolderPath.LOADING_EMPTY_DATA_PATH); _coreDriver = new CoreDriver(); _coreDriver.RootFolder = folder; await _coreDriver.RestartAsync(); }
/// <summary> /// Construcotr /// </summary> /// <param name="coreDriver"></param> /// <param name="entryType"></param> /// <param name="id"></param> /// <param name="name"></param> internal EntryTemplate(CoreDriver coreDriver, MasterDataManagement mdMgmt , EntryType entryType, int id, String name) { _coreDriver = coreDriver; _mdMgmt = mdMgmt; _defaultValues = new Dictionary <String, Object>(); _entryType = entryType; _id = id; _name = name; }
/// <summary> /// Parse master data from XElement /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="SystemException">Bug</exception> /// <exception cref="ArgumentNullException">Argument is null.</exception> public override MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem) { if (coreDriver == null || elem == null) { throw new ArgumentNullException(); } XAttribute idAttr = elem.Attribute(MasterDataUtils.XML_ID); XAttribute descpAttr = elem.Attribute(MasterDataUtils.XML_DESCP); try { MasterDataIdentity identity = new MasterDataIdentity( idAttr.Value); VendorMasterData vendor = (VendorMasterData)this .CreateNewMasterDataBase(identity, descpAttr.Value); _coreDriver.logDebugInfo(this.GetType(), 62, String.Format("Parse vendor ({0}).", vendor.Identity.ToString()), MessageType.INFO); return(vendor); } catch (IdentityTooLong e) { _coreDriver.logDebugInfo(this.GetType(), 150, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.VENDOR); } catch (IdentityNoData e) { _coreDriver .logDebugInfo(this.GetType(), 154, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.VENDOR); } catch (IdentityInvalidChar e) { _coreDriver.logDebugInfo(this.GetType(), 160, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.VENDOR); } catch (ParametersException e) { _coreDriver.logDebugInfo(this.GetType(), 164, e.Message, MessageType.ERRO); throw new SystemException(e); } catch (MasterDataIdentityExists e) { _coreDriver.logDebugInfo(this.GetType(), 168, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.VENDOR); } }
/// <summary> /// Parse master data from XElement /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="SystemException">Bug</exception> /// <exception cref="ArgumentNullException">Argument is null.</exception> public override MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem) { if (coreDriver == null || elem == null) { throw new ArgumentNullException(); } XAttribute idAttr = elem.Attribute(MasterDataUtils.XML_ID); XAttribute descpAttr = elem.Attribute(MasterDataUtils.XML_DESCP); try { MasterDataIdentity identity = new MasterDataIdentity( idAttr.Value); VendorMasterData vendor = (VendorMasterData)this .CreateNewMasterDataBase(identity, descpAttr.Value); _coreDriver.logDebugInfo(this.GetType(), 62, String.Format("Parse vendor ({0}).", vendor.Identity.ToString()), MessageType.INFO); return vendor; } catch (IdentityTooLong e) { _coreDriver.logDebugInfo(this.GetType(), 150, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.VENDOR); } catch (IdentityNoData e) { _coreDriver .logDebugInfo(this.GetType(), 154, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.VENDOR); } catch (IdentityInvalidChar e) { _coreDriver.logDebugInfo(this.GetType(), 160, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.VENDOR); } catch (ParametersException e) { _coreDriver.logDebugInfo(this.GetType(), 164, e.Message, MessageType.ERRO); throw new SystemException(e); } catch (MasterDataIdentityExists e) { _coreDriver.logDebugInfo(this.GetType(), 168, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.VENDOR); } }
/// <summary> /// document index /// </summary> /// <param name="coreDriver"></param> /// <param name="mdMgmt"></param> protected DocumentIndex(CoreDriver coreDriver, MasterDataManagement mdMgmt) { _coreDriver = coreDriver; _mdMgmt = mdMgmt; _list = new Dictionary <MasterDataIdentity, DocumentIndexItem>(); _coreDriver.ListenerMgmt.DocumentSavedHandler += documentSaved; _coreDriver.ListenerMgmt.DocumentLoadHandler += documentLoad; _coreDriver.ListenerMgmt.DocumentReversedHandler += documentReversed; }
/// <summary> /// document index /// </summary> /// <param name="coreDriver"></param> /// <param name="mdMgmt"></param> protected DocumentIndex(CoreDriver coreDriver, MasterDataManagement mdMgmt) { _coreDriver = coreDriver; _mdMgmt = mdMgmt; _list = new Dictionary<MasterDataIdentity, DocumentIndexItem>(); _coreDriver.ListenerMgmt.DocumentSavedHandler += documentSaved; _coreDriver.ListenerMgmt.DocumentLoadHandler += documentLoad; _coreDriver.ListenerMgmt.DocumentReversedHandler += documentReversed; }
/// <summary> /// create root folder for creation test in 2012_07 /// </summary> /// <param name="name"></param> /// <param name="coreDriver"></param> /// <returns></returns> public static async Task EstablishFolder_2012_07(String name , CoreDriver coreDriver) { coreDriver.RootFolder = await CreateRootFolder(name); await coreDriver.RestartAsync(); MonthIdentity monthId; monthId = new MonthIdentity(2012, 7); coreDriver.SetStartMonthId(monthId); }
/// <summary> /// check transaction data /// </summary> /// <param name="coreDriver"></param> public static void CheckTransactionData(CoreDriver coreDriver) { TransactionDataManagement transManagement = coreDriver.TransMgmt; MonthIdentity[] monthIds = coreDriver.MonthIds; // Assert.AreEqual(2, monthIds.length); MonthLedger ledger07 = transManagement.GetLedger(monthIds[0]); MonthLedger ledger08 = transManagement.GetLedger(monthIds[1]); CheckLedger2012_07(ledger07.Entities); CheckLedger2012_08(ledger08.Entities); }
/// <summary> /// /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <exception cref="ArgumentNullException">Argument is null</exception> protected MasterDataFactoryBase(CoreDriver coreDriver, MasterDataManagement management) { if (coreDriver == null || management == null) { throw new ArgumentNullException(); } _coreDriver = coreDriver; _management = management; _list = new Dictionary<MasterDataIdentity, MasterDataBase>(); _containDirtyData = false; }
/// <summary> /// Constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> public HeadEntity(CoreDriver coreDriver, MasterDataManagement management) { _coreDriver = coreDriver; _management = management; _items = new List <ItemEntity>(); _fields = new Dictionary <String, String>(); _postingDate = DateTime.Today; _docText = String.Empty; _isReversed = false; _isSaved = false; }
/// <summary> /// /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <exception cref="ArgumentNullException">Argument is null</exception> protected MasterDataFactoryBase(CoreDriver coreDriver, MasterDataManagement management) { if (coreDriver == null || management == null) { throw new ArgumentNullException(); } _coreDriver = coreDriver; _management = management; _list = new Dictionary <MasterDataIdentity, MasterDataBase>(); _containDirtyData = false; }
public VendorEntry(CoreDriver coreDriver, MasterDataManagement mdMgmt) { _coreDriver = coreDriver; _mdMgmt = mdMgmt; _text = ""; _recAcc = null; _glAccount = null; _vendor = null; _amount = new CurrencyAmount(); _businessArea = null; _doc = null; }
public ArticlesPage(IWebDriver driver) { CoreDriver something = new CoreDriver(); // creating an object // settings something.my_port = 50150; // multiple chrome instances - will be run on different ports // I am currently having 4 chrome profiles ;) something.my_name = "mynewprofile"; // full profile name will be: 'profile + my_name'. Check the code of the object. // void something.ConfigureProfile(); // creating new profile or updating existing one, if folder eists something.Initialize(); // starting the browser driver.Close(); this.driver = something.driver; }
/// <summary> /// Parse master data from XML /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="ArgumentNullException">Argument is null</exception> /// <exception cref="SystemException">Bug</exception> public override MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem) { XAttribute idAttr = elem.Attribute(MasterDataUtils.XML_ID); XAttribute descpAttr = elem.Attribute(MasterDataUtils.XML_DESCP); MasterDataIdentity identity; try { identity = new MasterDataIdentity(idAttr.Value); BankKeyMasterData bankKey = (BankKeyMasterData)this .CreateNewMasterDataBase(identity, descpAttr.Value); _coreDriver.logDebugInfo(this.GetType(), 61, String.Format("Parse bank key ({0}).", bankKey.Identity.ToString()), MessageType.INFO); return(bankKey); } catch (IdentityTooLong e) { _coreDriver.logDebugInfo(this.GetType(), 150, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_KEY); } catch (IdentityNoData e) { _coreDriver .logDebugInfo(this.GetType(), 154, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_KEY); } catch (IdentityInvalidChar e) { _coreDriver.logDebugInfo(this.GetType(), 160, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_KEY); } catch (ParametersException e) { _coreDriver.logDebugInfo(this.GetType(), 164, "Function parameter set error: " + e.Message, MessageType.ERRO); throw new SystemException(e); } catch (MasterDataIdentityExists e) { _coreDriver.logDebugInfo(this.GetType(), 168, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_KEY); } }
/// <summary> /// Only internal can invoke /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <param name="head"></param> /// <param name="lineNum"></param> internal ItemEntity(CoreDriver coreDriver, MasterDataManagement management, HeadEntity head, int lineNum) { _coreDriver = coreDriver; _management = management; _head = head; _lineNum = lineNum; _glAccount = null; _customer = null; _vendor = null; _amount = new CurrencyAmount(); _businessArea = null; }
internal GLAccountBalanceCollection(CoreDriver coreDriver, MasterDataManagement mdMgmt) { _coreDriver = coreDriver; _mdMgmt = mdMgmt; _items = new Dictionary<MasterDataIdentity_GLAccount, GLAccountBalanceItem>(); _coreDriver.ListenerMgmt.DocumentSavedHandler += documentSaved; _coreDriver.ListenerMgmt.DocumentLoadHandler += documentLoad; _coreDriver.ListenerMgmt.MasterDataLoadHandler += masterDataLoad; _coreDriver.ListenerMgmt.MasterDataCreatedHandler += masterDataCreated; _coreDriver.ListenerMgmt.DocumentReversedHandler += documentReversed; _coreDriver.ListenerMgmt.GLAccountInitAmountChangedHandler += glAccountInitAmountChanged; }
internal GLAccountBalanceCollection(CoreDriver coreDriver, MasterDataManagement mdMgmt) { _coreDriver = coreDriver; _mdMgmt = mdMgmt; _items = new Dictionary <MasterDataIdentity_GLAccount, GLAccountBalanceItem>(); _coreDriver.ListenerMgmt.DocumentSavedHandler += documentSaved; _coreDriver.ListenerMgmt.DocumentLoadHandler += documentLoad; _coreDriver.ListenerMgmt.MasterDataLoadHandler += masterDataLoad; _coreDriver.ListenerMgmt.MasterDataCreatedHandler += masterDataCreated; _coreDriver.ListenerMgmt.DocumentReversedHandler += documentReversed; _coreDriver.ListenerMgmt.GLAccountInitAmountChangedHandler += glAccountInitAmountChanged; }
/// <summary> /// /// </summary> /// <param name="monthId"></param> /// <returns></returns> public ObservableCollection <AbstractAdapterItem> GetItems(MonthIdentity monthId) { CoreDriver coreDriver = _dataCore.BackendCoreDriver; if (coreDriver.IsInitialize == false) { return(_items); } if (_curMonthId == null || _curMonthId.Equals(monthId) == false) { // clear _items.Clear(); // change month _curMonthId = monthId; GLAccountBalanceCollection balCol = coreDriver.TransMgmt.AccountBalanceCol; MasterDataManagement mdMgmt = coreDriver.MdMgmt; // for each cost group List <CostReportItem> costList = new List <CostReportItem>(); foreach (GLAccountGroupENUM group in GLAccountGroup.COST_GROUP) { List <MasterDataIdentity_GLAccount> ids = mdMgmt .GetGLAccountsBasedGroup(group); // for g/l account in each group foreach (MasterDataIdentity_GLAccount id in ids) { // get master data GLAccountMasterData masterData = (GLAccountMasterData)mdMgmt .GetMasterData(id, MasterDataType.GL_ACCOUNT); // get balance item GLAccountBalanceItem item = balCol.GetBalanceItem(id); costList.Add(new CostReportItem(id, masterData.Descp , item.GetAmount(_curMonthId), this)); } } // sort costList.Sort(); foreach (CostReportItem costItem in costList) { _items.Add(costItem); } } return(_items); }
/// <summary> /// Parse master data from XML /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="ArgumentNullException">Argument is null</exception> /// <exception cref="SystemException">Bug</exception> public override MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem) { XAttribute idAttr = elem.Attribute(MasterDataUtils.XML_ID); XAttribute descpAttr = elem.Attribute(MasterDataUtils.XML_DESCP); MasterDataIdentity identity; try { identity = new MasterDataIdentity(idAttr.Value); BankKeyMasterData bankKey = (BankKeyMasterData)this .CreateNewMasterDataBase(identity, descpAttr.Value); _coreDriver.logDebugInfo(this.GetType(), 61, String.Format("Parse bank key ({0}).", bankKey.Identity.ToString()), MessageType.INFO); return bankKey; } catch (IdentityTooLong e) { _coreDriver.logDebugInfo(this.GetType(), 150, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_KEY); } catch (IdentityNoData e) { _coreDriver .logDebugInfo(this.GetType(), 154, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_KEY); } catch (IdentityInvalidChar e) { _coreDriver.logDebugInfo(this.GetType(), 160, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_KEY); } catch (ParametersException e) { _coreDriver.logDebugInfo(this.GetType(), 164, "Function parameter set error: " + e.Message, MessageType.ERRO); throw new SystemException(e); } catch (MasterDataIdentityExists e) { _coreDriver.logDebugInfo(this.GetType(), 168, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_KEY); } }
/// <summary> /// Construct /// </summary> /// <param name="coreDriver">Core Driver</param> /// <param name="management">Matadata management</param> /// <param name="id"></param> /// <param name="descp"></param> /// <param name="accNumber"></param> /// <param name="bankKey"></param> /// <param name="type"></param> /// <exception cref="ArgumentNullException">Arguments null</exception> /// <exception cref="MasterDataIdentityNotDefined">Master data identity is not defined.</exception> public BankAccountMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity id, String descp, BankAccountNumber accNumber, MasterDataIdentity bankKey, BankAccountType type) : base(coreDriver, management, id, descp) { _accNumber = accNumber; _bankAccType = type; MasterDataBase bankKeyId = management.GetMasterData(bankKey, MasterDataType.BANK_KEY); if (bankKeyId == null) { throw new MasterDataIdentityNotDefined(bankKey, MasterDataType.BANK_KEY); } _bankKey = bankKeyId.GetIdentity(); }
public RootDriver() { CurrentThread = Thread.CurrentThread; ContextPtr = CoreInternals.Context_New(); ActorDriver = new ActorDriver(this); WorldDriver = new WorldDriver(this); CoreDriver = new CoreDriver(this); EngineDriver = new EngineDriver(this); ComponentDriver = new ComponentDriver(this); ResourcesCollection = new ResourceCollection(this); ComponentCollection = new ComponentCollection(); // Setup Internal Drivers ResourceManagerDriver = new ResourceManagerDriver(this); MeshDriver = new MeshDriver(this); }
/// <summary> /// check core driver /// </summary> /// <param name="coreDriver"></param> private void checkCore(CoreDriver coreDriver) { Assert.AreEqual(true, coreDriver.IsInitialize); MasterDataManagement masterData = coreDriver.MdMgmt; foreach (MasterDataType type in Enum.GetValues(typeof(MasterDataType))) { MasterDataFactoryBase factory = masterData .GetMasterDataFactory(type); Assert.AreEqual(0, factory.AllEntities.Count); } TransactionDataManagement tranData = coreDriver .TransMgmt; Assert.IsTrue(null != tranData); MonthIdentity[] monthIds = coreDriver.MonthIds; Assert.AreEqual(1, monthIds.Length); }
/// <summary> /// Master data management /// </summary> /// <param name="coreDriver"></param> internal MasterDataManagement(CoreDriver coreDriver) : base(coreDriver) { _factoryList = new Dictionary<MasterDataType, MasterDataFactoryBase>(); // initialize the hash table }
/// <summary> /// constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="mdMgmt"></param> public EntryTemplatesManagement(CoreDriver coreDriver, MasterDataManagement mdMgmt) : base(coreDriver) { _list = new Dictionary<int, EntryTemplate>(); _mdMgmt = mdMgmt; }
/// <summary> /// Parse master data from XML /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="ArgumentNullException">Argument is null</exception> /// <exception cref="SystemException">Bug</exception> public override MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem) { XAttribute id = elem.Attribute(MasterDataUtils.XML_ID); XAttribute descp = elem.Attribute(MasterDataUtils.XML_DESCP); XAttribute bankKey = elem.Attribute(MasterDataUtils.XML_BANK_KEY); XAttribute bankAcc = elem.Attribute(MasterDataUtils.XML_BANK_ACCOUNT); XAttribute typeStr = elem.Attribute(MasterDataUtils.XML_TYPE); // check attribute if (bankKey == null) { _coreDriver.logDebugInfo(this.GetType(), 93, String.Format( "Mandatory Field %s with no value", MasterDataUtils.XML_BANK_KEY), MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_ACCOUNT); } if (bankAcc == null) { _coreDriver.logDebugInfo(this.GetType(), 100, String.Format( "Mandatory Field %s with no value", MasterDataUtils.XML_BANK_ACCOUNT), MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_ACCOUNT); } if (typeStr == null) { _coreDriver.logDebugInfo(this.GetType(), 114, String.Format( "Mandatory Field %s with no value", MasterDataUtils.XML_TYPE), MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_ACCOUNT); } MasterDataIdentity identity; MasterDataIdentity bankKeyId; BankAccountNumber accNum; BankAccountType type; if (typeStr.Value.Length != 1 || (typeStr.Value[0] != (char)BankAccountType.CREDIT_CARD && typeStr.Value[0] != (char)BankAccountType.SAVING_ACCOUNT)) { _coreDriver.logDebugInfo(this.GetType(), 150, "Format of bank account type is error.", MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_ACCOUNT); } type = (BankAccountType)typeStr.Value[0]; try { identity = new MasterDataIdentity(id.Value); // bank key bankKeyId = new MasterDataIdentity( bankKey.Value); // bank account accNum = new BankAccountNumber( bankAcc.Value); } catch (Exception e) { _coreDriver.logDebugInfo(this.GetType(), 150, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.BANK_ACCOUNT); } try { BankAccountMasterData bankAccount = (BankAccountMasterData)this .CreateNewMasterDataBase(identity, descp.Value, accNum, bankKeyId, type); _coreDriver.logDebugInfo( this.GetType(), 130, String.Format("Parse bank account (%s).", bankAccount.Identity.ToString()), MessageType.INFO); return bankAccount; } catch (Exception e) { // bug throw new SystemException(e); } }
/// <summary> /// /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <exception cref="ArgumentNullException">Argument is null</exception> public BankKeyMasterDataFactory(CoreDriver coreDriver, MasterDataManagement management) : base(coreDriver, management) { }
/// <summary> /// Constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <param name="id"></param> /// <param name="descp"></param> /// <exception cref="ArgumentNullException">argument is null</exception> public GLAccountMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity_GLAccount id, String descp) : this(coreDriver, management, id, descp, null) { }
/// <summary> /// constructor /// </summary> /// <param name="coreDriver"></param> public CustomerEntry(CoreDriver coreDriver, MasterDataManagement mdMgmt) { _coreDriver = coreDriver; _mdMgmt = mdMgmt; }
/// <summary> /// Construct /// </summary> /// <param name="coreDriver">Core Driver</param> /// <param name="management">Master Data management</param> /// <param name="id">Identity</param> /// <param name="descp">Description</param> /// <exception cref="ArgumentNullException">Arguments null</exception> public BankKeyMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity id, String descp) : base(coreDriver, management, id, descp) { }
/// <summary> /// Parse master data from XML /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="ArgumentNullException">Argument is null</exception> /// <exception cref="SystemException">Bug</exception> public override MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem) { XAttribute id = elem.Attribute(MasterDataUtils.XML_ID); XAttribute descp = elem.Attribute(MasterDataUtils.XML_DESCP); XAttribute bankAccStr = elem.Attribute(MasterDataUtils.XML_BANK_ACCOUNT); XAttribute initAmountAttr = elem.Attribute(MasterDataUtils.XML_INIT_AMOUNT); MasterDataIdentity_GLAccount identity; MasterDataIdentity bankAccId = null; try { identity = new MasterDataIdentity_GLAccount( id.Value); // bank account if (bankAccStr != null) { bankAccId = new MasterDataIdentity( bankAccStr.Value); } } catch (Exception e) { _coreDriver.logDebugInfo(this.GetType(), 150, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.GL_ACCOUNT); } CurrencyAmount initAmount = new CurrencyAmount(); if (initAmountAttr != null) { try { initAmount = CurrencyAmount.Parse(initAmountAttr.Value); } catch (CurrencyAmountFormatException e) { _coreDriver.logDebugInfo(this.GetType(), 150, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException(MasterDataType.GL_ACCOUNT); } } try { GLAccountMasterData glAccount; if (bankAccId == null) { glAccount = (GLAccountMasterData)this.CreateNewMasterDataBase( identity, descp.Value); } else { glAccount = (GLAccountMasterData)this.CreateNewMasterDataBase( identity, descp.Value, bankAccId); } glAccount.setInitAmountInternal(initAmount); _coreDriver .logDebugInfo( this.GetType(), 167, String.Format("Parse G/L account ({0}).", glAccount.Identity.ToString()), MessageType.INFO); return glAccount; } catch (Exception e) { throw new SystemException(e); } }
internal DocumentAccountIndex(CoreDriver coreDriver, MasterDataManagement mdMgmt) : base(coreDriver, mdMgmt) { }
/// <summary> /// Constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <exception cref="ArgumentNullException">Argument is null</exception> public GLAccountMasterDataFactory(CoreDriver coreDriver, MasterDataManagement management) : base(coreDriver, management) { }
/// <summary> /// Constructor /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> public BusinessAreaMasterDataFactory(CoreDriver coreDriver, MasterDataManagement management) : base(coreDriver, management) { }
/// <summary> /// Parse master data from XML /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="ArgumentNullException">Argument is null</exception> /// <exception cref="SystemException">Bug</exception> public override MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem) { XAttribute id = elem.Attribute(MasterDataUtils.XML_ID); XAttribute descp = elem.Attribute(MasterDataUtils.XML_DESCP); XAttribute criticalLevel = elem .Attribute(MasterDataUtils.XML_CRITICAL_LEVEL); // check attribute if (criticalLevel == null) { throw new MasterDataFileFormatException( MasterDataType.BUSINESS_AREA); } if (criticalLevel.Value.Length != 1 || (criticalLevel.Value[0] != (char)CriticalLevel.HIGH && criticalLevel.Value[0] != (char)CriticalLevel.MEDIUM && criticalLevel.Value[0] != (char)CriticalLevel.LOW)) { _coreDriver .logDebugInfo(this.GetType(), 154, "Format of critical level is error", MessageType.ERRO); throw new MasterDataFileFormatException( MasterDataType.BUSINESS_AREA); } CriticalLevel l = (CriticalLevel)criticalLevel.Value[0]; MasterDataIdentity identity; try { identity = new MasterDataIdentity(id.Value); } catch (Exception e) { _coreDriver .logDebugInfo(this.GetType(), 154, e.Message, MessageType.ERRO); throw new MasterDataFileFormatException( MasterDataType.BUSINESS_AREA); } try { BusinessAreaMasterData businessArea = (BusinessAreaMasterData)this .CreateNewMasterDataBase(identity, descp.Value, l); _coreDriver.logDebugInfo( this.GetType(), 130, String.Format("Parse business area ({0}).", businessArea.Identity.ToString()), MessageType.INFO); return businessArea; } catch (Exception e) { throw new SystemException(e); } }
internal DocumentBusinessIndex(CoreDriver coreDriver, MasterDataManagement mdMgmt) : base(coreDriver, mdMgmt) { }
/// <summary> /// /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <param name="id"></param> /// <param name="descp"></param> /// <param name="level"></param> /// <exception cref="ArgumentNullException">argument is null</exception> public BusinessAreaMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity id, String descp, CriticalLevel level) : base(coreDriver, management, id, descp) { _criticalLevel = level; }
/// <summary> /// Parse master data from XML /// </summary> /// <param name="coreDriver"></param> /// <param name="elem"></param> /// <returns></returns> /// <exception cref="MasterDataFileFormatException">Master Data file exception</exception> /// <exception cref="ArgumentNullException">Argument is null</exception> /// <exception cref="SystemException">Bug</exception> public abstract MasterDataBase ParseMasterData(CoreDriver coreDriver, XElement elem);
/// <summary> /// /// </summary> /// <param name="coreDriver"></param> /// <param name="management"></param> /// <exception cref="ArgumentNullException"></exception> public CustomerMasterDataFactory(CoreDriver coreDriver, MasterDataManagement management) : base(coreDriver, management) { }
/// <summary> /// Constructor /// </summary> /// <param name="coreDriver">Core Driver</param> /// <param name="management">Master data management</param> /// <exception cref="ArgumentNullException"></exception> public VendorMasterDataFactory(CoreDriver coreDriver, MasterDataManagement management) : base(coreDriver, management) { }