/// <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> /// equals /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { GLAccountGroup group = obj as GLAccountGroup; if (group == null) { return(false); } return(this.Identity == group.Identity); }