Пример #1
0
 public Register(IAccountDal accountDal, IUserInfoDal userInfoDal, IAdressDal adressDal, ICardInfoDal cardinfoDal)
 {
     this._accountDal  = accountDal;
     this._userInfoDal = userInfoDal;
     this._adressDal   = adressDal;
     this._cardinfoDal = cardinfoDal;
 }
 public CustomerInfoService(AuthUserDto user) : base(user)
 {
     _customerInfoDal = new CustomerInfoDal(user);
     _groupInfoDal    = new GroupInfoDal(user);
     _userInfoDal     = new UserInfoDal(user);
     _userInfoService = new UserInfoService(user);
 }
Пример #3
0
        static void Main(string[] args)
        {
            IApplicationContext ctx = ContextRegistry.GetContext();

            IUserInfoDal UserInfoDal = ctx.GetObject("UserInfoDal") as IUserInfoDal;

            UserInfoDal.Show();
            Console.ReadKey();
        }
Пример #4
0
        public ActionResult Details(int id)
        {
            //UserInfoDal ud = new UserInfoDal();
            IUserInfoDal ud = StaticDalFactory.GetUserInfoDal();

            //BaseDal<UserInfo>.GetEntities(u => u.UserId ==id);
            ViewData.Model = ud.GetUserInfoById(id);
            return(View());
        }
Пример #5
0
        static void Main(string[] args)
        {
            IApplicationContext ctx = ContextRegistry.GetContext();
            IUserInfoDal        u   = ctx.GetObject("UserInfoDal") as IUserInfoDal;

            // UserInfoService u = ctx.GetObject("UserInfoService") as UserInfoService;
            u.Show();
            Console.ReadKey();
        }
Пример #6
0
        static void Main(string[] args)
        {
            IApplicationContext ac = ContextRegistry.GetContext();
            //IUserInfoDal dall = ac.GetObject("UserInfoDal") as IUserInfoDal;
            IUserInfoDal dall2 = ac.GetObject("UserInfoDal1") as IUserInfoDal;

            dall2.Show();

            UserInfoServce dal3 = ac.GetObject("UserInfoServce") as UserInfoServce;

            dal3.Show();
            Console.ReadLine();
        }
Пример #7
0
        static void Main(string[] args)
        {
            //传统的
            //IUserInfoDal userInfoDal=new UserInfoDal();
            //userInfoDal.Show();

            //做容器创建实例
            //初始化容器
            IApplicationContext context = ContextRegistry.GetContext();
            IUserInfoDal        dal     = context.GetObject("UserInfoDal") as IUserInfoDal;

            dal.Show();

            Console.ReadKey();
        }
Пример #8
0
        public ActionResult Index()
        {
            //IOC
            IApplicationContext ctx   = ContextRegistry.GetContext();
            IUserInfoDal        efDal = ctx.GetObject("UserInfoDal") as IUserInfoDal;
            var a = efDal.Show();

            IUserInfoDal adoDal = ctx.GetObject("UserInfoDal2") as IUserInfoDal;

            adoDal.Show();

            //DI
            var a1 = UserInfoDal;
            var a2 = UserName;


            return(View());
        }
Пример #9
0
        static void Main(string[] args)
        {
            //IUserInfoDal userInfoDal=new UserInfoDal();
            //userInfoDal.Show();

            //容器创建
            IApplicationContext ctx = ContextRegistry.GetContext();
            IUserInfoDal        dal = ctx.GetObject("UserInfoDal") as IUserInfoDal;

            dal.Show();

            IUserInfoDal dal1 = ctx.GetObject("UserInfoDal1") as IUserInfoDal;

            dal1.Show();

            //UserInfoService userInfoService=((IObjectFactory) ctx).GetObject("UserInfoService") as UserInfoService;
            //userInfoService.Show();


            Console.ReadKey();
        }
Пример #10
0
        static void Main(string[] args)
        {
            //控制权没有反转
            //IUserInfoDal infoDal = new EFUserInfoDal();

            //Spring.Net 创建实例的方式转为容器帮我们创建
            //第一步,引用Spring.Net程序集 Spring.Core.dll 和 Common.Logging.dll
            //第二步,添加Spring.Net配置节点
            //第三步,配置object节点
            //第四步,创建spring容器上下文

            IApplicationContext ctx = ContextRegistry.GetContext();
            //第五步,通过容器创建对象
            IUserInfoDal efDal = ctx.GetObject("UserInfoDal") as IUserInfoDal;

            efDal.Show();

            IUserInfoDal adoDal = ctx.GetObject("UserInfoDal2") as IUserInfoDal;

            adoDal.Show();

            Console.ReadKey();
        }
Пример #11
0
        static void Main(string[] args)
        {
            IUserInfoDal userInfoDal = new UserInfoDal("x");

            userInfoDal.Show();

            Console.WriteLine("---------1---------");

            //下面用容器来创建UserInfoDal的实例

            // 第一步: 初始化容器
            IApplicationContext ctx = ContextRegistry.GetContext();

            // 创建对象
            IUserInfoDal efdal = ctx.GetObject("EFUserInfoDal") as IUserInfoDal;

            efdal.Show();

            Console.WriteLine("--------2----------");

            // xml配置文件中配置的文件
            IUserInfoDal dal = ctx.GetObject("UserInfoDal") as IUserInfoDal;

            dal.Show();

            Console.WriteLine("---------3---------");

            //
            UserInfoService userInfoServive = ctx.GetObject("UserInfoService") as UserInfoService;

            userInfoServive.Show();

            Console.WriteLine("---------4---------");

            Console.ReadKey();
        }
Пример #12
0
        static void Main(string[] args)
        {
            //IUserInfoDal userInfoDal =new UserInfoDal();
            //userInfoDal.Show();

            //下面走一个容器来 创建UserInfoDal实例

            //第一步  初始化容器
            IApplicationContext ctx = ContextRegistry.GetContext();

            //IUserInfoDal dal = ctx.GetObject("UserInfoDal") as IUserInfoDal;
            //dal.Show();

            IUserInfoDal dal1 = ctx.GetObject("UserInfoDal1") as IUserInfoDal;

            dal1.Show();

            //UserInfoServce userInfoServce = ctx.GetObject("UserInfoServce") as UserInfoServce;

            //userInfoServce.Show();


            Console.ReadKey();
        }
Пример #13
0
 public UserInfo(IAccountDal accountDal, IUserInfoDal userInfoDal)
 {
     _accountDal  = accountDal;
     _userInfoDal = userInfoDal;
 }
Пример #14
0
 public UserInfoService(IUserInfoDal userInfoDal)
 {
     _userInfoDal = userInfoDal;
     BaseDal      = _userInfoDal;
 }
Пример #15
0
 public UserInfoFixture(IUserInfoDal userInfoDal)
 => this.userInfoDal = userInfoDal;
Пример #16
0
 public UserInfoService(IUserInfoDal dal)
 {
     this._dal    = dal;
     this.baseDal = dal;
 }
Пример #17
0
 public UserInfoService(AuthUserDto user) : base(user)
 {
     _userInfoDal        = new UserInfoDal(user);
     _loginRecrodService = new LoginRecrodService(user);
     _groupInfoDal       = new GroupInfoDal(user);
 }
Пример #18
0
 public UserInfoManager(IUserInfoDal userInfoDal)
 {
     _userInfoDal = userInfoDal;
 }
Пример #19
0
 public UserInfoService(IUserInfoDal userinfodal)
     : base(userinfodal)
 {
 }
Пример #20
0
 /// <summary>
 /// 构造注入数据操作类对象
 /// </summary>
 /// <param name="userInfoDal">用户数据操作类</param>
 public UserInfoBll(IUserInfoDal userInfoDal)
     : base(userInfoDal)
 {
     this.userInfoDal = userInfoDal;
 }