Exemple #1
0
        public static Subcategory FromDbEntity(SqlEntity.Subcategory sqlSubcategory)
        {
            if (sqlSubcategory == null)
            {
                return(null);
            }

            return(new Subcategory
            {
                Id = sqlSubcategory.Id,
                Name = sqlSubcategory.Name,
                CategoryId = sqlSubcategory.CategoryId
            });
        }
Exemple #2
0
 public static Account FromDbEntity(SqlEntity.Account account, SqlEntity.Category category, SqlEntity.Subcategory subcategory)
 {
     return(new Account
     {
         Id = account.Id,
         Name = account.Name,
         NormalSide = (NormalSide)account.NormalSide,
         BeginningBalance = account.BeginningBalance,
         Balance = account.Balance,
         Debit = account.Debit,
         Credit = account.Credit,
         Comment = account.Comment,
         Order = account.Order,
         Active = account.Active == 1,
         Category = Category.FromDbEntity(category),
         Subcategory = Subcategory.FromDbEntity(subcategory),
         AccountId = account.AccountId,
         ContraAccount = account.ContraAccount == 1
     });
 }