Пример #1
0
 public Account(AccountTypes type, AccountSubTypes subType, bool folder, string AccountNo, string accountName, Account parent)
 {
     this.Id          = Guid.NewGuid();
     this.Type        = type;
     this.SubEnumType = subType;
     this.IsFolder    = folder;
     this.No          = AccountNo;
     this.Name        = accountName;
 }
Пример #2
0
        public Account newItem(AccountTypes accountType, AccountSubTypes accountSubType)
        {
            var newItem = new Account()
            {
                Type           = accountType,
                SubEnumType    = accountSubType,
                OpeningBalance = 0,
                No             = "N/A",
            };

            return(newItem);
        }
Пример #3
0
        public Account newFolder(AccountTypes type, AccountSubTypes subType, string codeName, string name, string nameEnglish)
        {
            Account item = new Account();

            item.Id          = Guid.NewGuid();
            item.Type        = type;
            item.SubEnumType = subType;
            item.IsFolder    = true;
            item.CodeName    = codeName;
            item.Name        = name;

            erpNodeDBContext.Accounts.Add(item);
            return(item);
        }
Пример #4
0
        private void RunEnumScript()
        {
            AccountTypes
            .Merge().Using(Enums.GetMembers <Common.Enums.AccountType>())
            .On((dst, src) => dst.AccountTypeId == src.Value)
            .InsertWhenNotMatched(src => new EnumTable_AccountType {
                AccountTypeId = src.Value, Name = src.Name,
            })
            .DeleteWhenNotMatchedBySource()
            .Merge();

            AccountSubTypes
            .Merge().Using(Enums.GetMembers <Common.Enums.AccountSubType>())
            .On((dst, src) => dst.AccountSubTypeId == src.Value)
            .InsertWhenNotMatched(src => new EnumTable_AccountSubType {
                AccountSubTypeId = src.Value, Name = src.Name,
            })
            .DeleteWhenNotMatchedBySource()
            .Merge();

            ClearedStatus
            .Merge().Using(Enums.GetMembers <Common.Enums.ClearedStatus>())
            .On((dst, src) => dst.ClearedStatusId == src.Value)
            .InsertWhenNotMatched(src => new EnumTable_ClearedStatus {
                ClearedStatusId = src.Value, Name = src.Name,
            })
            .DeleteWhenNotMatchedBySource()
            .Merge();

            TransactionTypes
            .Merge().Using(Enums.GetMembers <Common.Enums.TransactionType>())
            .On((dst, src) => dst.TransactionTypeId == src.Value)
            .InsertWhenNotMatched(src => new EnumTable_TransactionType {
                TransactionTypeId = src.Value, Name = src.Name,
            })
            .DeleteWhenNotMatchedBySource()
            .Merge();

            this.InsertOrReplace(
                new Models.Account
            {
                AccountId        = Making.Cents.Common.Models.Account.UnrealizedGain,
                Name             = "_Unrealized Gain",
                AccountTypeId    = Common.Enums.AccountType.Income,
                AccountSubTypeId = Common.Enums.AccountSubType.Income,
            });
        }
Пример #5
0
 public List <Account> GetItemBySubType(AccountSubTypes subType) => erpNodeDBContext.Accounts
 .Where(account => account.SubEnumType == subType)
 .Where(account => account.IsFolder == false)
 .ToList();