AccountModel.cs 1.24 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AIAHTML5.ADMIN.API.Entity;

namespace AIAHTML5.ADMIN.API.Models
{

    public class AccountTypeEntityModel
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public bool IsActive { get; set; }

        public static List<AccountTypeEntityModel> GetActiveAccountTypes(AIADatabaseV5Entities dbContext)
        {
            List<AccountTypeEntityModel> AccountTypeList = new List<AccountTypeEntityModel>();
            AccountTypeEntityModel AccountTypeModelObj = new AccountTypeEntityModel();
            try
            {
                var result = dbContext.EC_GetAccountTypeList().ToList();
                if (result.Count > 0)
                {
                    foreach (var item in result)
                    {
                        AccountTypeModelObj = new AccountTypeEntityModel();
                        AccountTypeModelObj.Id = item.Id;
                        AccountTypeModelObj.Title = item.Title;
                        AccountTypeList.Add(AccountTypeModelObj);
                    }
                }
            }
            catch (Exception ex) { }
            return AccountTypeList;
        }

    }

}