using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace ZSMusic.BLL
{
    public static class UserBLL
    {
        private static IDAL.IUser dal = DALFactory.DataAccess.CreatUser(ConfigurationManager.AppSettings["UserDB"]);
        public static bool Exists(string id)
        {
            return dal.Exists(id);
        }

        public static Model.User GetModelById(string id)
        {
            return dal.GetModelById(id);
        }

        public static bool Add(Model.User u)
        {
            return dal.Add(u);
        }

        public static bool Regist(string id, string name = "", long balance = 50000)
        {
            return dal.Regist(id, name, balance);
        }

        public static bool Delete(string id)
        {
            return dal.Delete(id);
        }

        public static bool Update(Model.User u)
        {
            return dal.Update(u);
        }

        public static bool Pay(string key, long cost)
        {
            return dal.Pay(key, cost);
        }

        public static System.Data.DataTable Quary(string cdn = null)
        {
            return dal.Quary(cdn);
        }

    }
}
