public ServiceContract()
 {
     userDAL = (IUserDAL)ContextRegistry.GetContext().GetObject("UserDAL");
     orderDAL = (IOrderDAL)ContextRegistry.GetContext().GetObject("OrderDAL");
     orderItemDAL = (IOrderItemDAL)ContextRegistry.GetContext().GetObject("OrderItemDAL");
     productDAL = (IProductDAL)ContextRegistry.GetContext().GetObject("ProductDAL");
 }
示例#2
0
 /// <summary>
 /// Constructor that injects all the dependencies for the account controller.
 /// </summary>
 /// <param name="authProvider"></param>
 /// <param name="userDal"></param>
 /// <param name="checkinDal"></param>
 /// <param name="badgeDal"></param>
 public AccountController(IAuthProvider authProvider, IUserDAL userDal, ICheckinSqlDAL checkinDal, IBadgeSqlDAL badgeDal)
 {
     this.authProvider = authProvider;
     this.userDal      = userDal;
     this.checkinDal   = checkinDal;
     this.badgeDal     = badgeDal;
 }
示例#3
0
    //methods to use it
    public void MyMethod()
    {
        IUserDAL userDAL = (IUserDAL)Activator.CreateInstance(_myUserDALType);

        //Call method in IUserDAL
        userDAL.CreateUser();
    }
示例#4
0
        public ActionResult Autherize(UserViewModel userModel)
        {
            userDAL = new UserDALImpl();
            var userDetails = userDAL.getUser(userModel.UserName, userModel.Password);

            if (userDetails == null)
            {
                userModel.LoginErrorMessage = "Nombre de Usuario o Contraseña Incorrectos";
                return(View("Index", userModel));
            }
            else
            {
                //Against AD
                //http://www.benramey.com/2014/10/20/active-directory-authentication-in-asp-net-mvc-5-with-forms-authentication-and-group-based-authorization/
                //http://www.beansoftware.com/ASP.NET-Tutorials/Forms-Authentication-Active-Directory.aspx
                Session["userID"]   = userDetails.UserId;
                Session["userName"] = userDetails.UserName;
                var authTicket = new FormsAuthenticationTicket(userDetails.UserName, true, 100000);
                var cookie     = new HttpCookie(FormsAuthentication.FormsCookieName,
                                                FormsAuthentication.Encrypt(authTicket));
                Response.Cookies.Add(cookie);
                var name = User.Identity.Name; // line 4
                return(RedirectToAction("Index", "Home"));
            }
        }
示例#5
0
        public ActionResult Autherize(UsuarioViewModel userModel)
        {
            string check = Encrypt.GetSha256(userModel.Clave);

            userDAL = new UserDALImpl();
            var userDetails = userDAL.getUser(userModel.NombreUsuario, userModel.Clave = check.Trim());


            if (userDetails == null)
            {
                userModel.LoginErrorMessage = "Nombre de Usuario o Password Incorrectos";
                return(View("Index", userModel));
            }
            else
            {
                Session["Usuario_ID"]    = userDetails.Usuario_ID;
                Session["NombreUsuario"] = userDetails.NombreUsuario;
                var authTicket = new FormsAuthenticationTicket(userDetails.NombreUsuario, true, 100000);
                var cookie     = new HttpCookie(FormsAuthentication.FormsCookieName,
                                                FormsAuthentication.Encrypt(authTicket));
                Response.Cookies.Add(cookie);
                var name = User.Identity.Name;
                return(RedirectToAction("Index", "Home"));
            }
        }
 public DashboardController(IAuthProvider authProvider, IUserFoodDAL dal, IWeightDAL weightDal, IUserDAL userDal)
 {
     this.authProvider = authProvider;
     this.dal          = dal;
     this.weightDal    = weightDal;
     this.userDal      = userDal;
 }
示例#7
0
 public UserDALManageFacade()
 {
     _userDALProvider     = new UserDAL();
     _imageDALProvider    = new ImgStorageDAL();
     _userroleDALProvider = new UserRoleDAL();
     _roleDALProvider     = new RoleDAL();
 }
示例#8
0
 public ReservationController(IAuthProvider authProvider, IPetDAO petDAO, IUserDAL userDAL, IReservationDAO reservationDAO)
 {
     this.authProvider   = authProvider;
     this.petDAO         = petDAO;
     this.userDAL        = userDAL;
     this.reservationDAO = reservationDAO;
 }
示例#9
0
 public GymController(IAuthProvider authProvider, IGymDAL gymDAL, IMemberDAL memberDAL, IUserDAL userDAL)
 {
     this.authProvider = authProvider;
     this.gymDAL       = gymDAL;
     this.memberDAL    = memberDAL;
     this.userDAL      = userDAL;
 }
示例#10
0
        public ActionResult Authorize(UsuarioViewModel usuarioViewModel)
        {
            usuarioViewModel.usuario     = Request["usuario"];
            usuarioViewModel.contrasenia = Request["contrasenia"];
            userDAL = new UserDALImpl();
            var userDetails = userDAL.getUser(usuarioViewModel.usuario, usuarioViewModel.contrasenia);

            if (userDetails == null)
            {
                Response.Write("Nombre de Usuario o Contraseña Incorrectos");
                //string script = "<script type='text/javascript'>alert('Nombre de Usuario o Password Incorrectos');</script>";
                //usuarioViewModel.LoginErrorMessage = "Nombre de Usuario o Password Incorrectos";
                return(View("Index", usuarioViewModel));
            }
            else
            {
                Session["userID"]   = userDetails.idUsuario;
                Session["userName"] = userDetails.usuario;
                var authTicket = new FormsAuthenticationTicket(userDetails.usuario, true, 100000);
                var cookie     = new HttpCookie(FormsAuthentication.FormsCookieName,
                                                FormsAuthentication.Encrypt(authTicket));
                Response.Cookies.Add(cookie);
                var name = User.Identity.Name; // line 4
                return(RedirectToAction("Index", "Home"));
            }
        }
示例#11
0
 public BrewerController(IBeerDAL beerDAL, IBreweryDAL breweryDAL, IUserDAL userDAL, IBeerRatingDAL beerRatingDAL)
 {
     this.beerDAL       = beerDAL;
     this.breweryDAL    = breweryDAL;
     this.userDAL       = userDAL;
     this.beerRatingDAL = beerRatingDAL;
 }
 public AccountController(IAuthProvider authProvider, IUserDAL userDAO, IProfileDAL profileDAO, IProfileSearchDAL profileSearchDAL)
 {
     this.authProvider     = authProvider;
     this.userDAO          = userDAO;
     this.profileDAO       = profileDAO;
     this.profileSearchDAL = profileSearchDAL;
 }
示例#13
0
 public PlanTripController(IUserDAL userDAL, ILandmarkDAL landmarkDAL, ITripDAL tripDAL) 
     : base(userDAL)
 {
     this.userDAL = userDAL;
     this.landmarkDAL = landmarkDAL;
     this.tripDAL = tripDAL;
 }
 public ClassesController(IUserDAL userDAL, IAuthProvider authProvider, IWorkoutDAL workoutDAL, IClassesDAL classDAL)
 {
     this.userDAL      = userDAL;
     this.authProvider = authProvider;
     this.workoutDAL   = workoutDAL;
     this.classDAL     = classDAL;
 }
示例#15
0
        //Alle dependecies injecteren via deze constructor.

        public UserContainer(IUserContainerDAL dAL, IUserDAL userdal, IBetDAL betDAL)
        {
            this._containerDAL = dAL;
            this._userdal      = userdal;
            this._betDAL       = betDAL;
            Users = this.GetAllUsers();
        }
示例#16
0
 public UserBLL([DIPParameterShortName("mysql")] IUserDAL iuserDAL, IServiceA serviceA, [DIPParameterConstant] string name, [DIPParameterConstant] int value)
 {
     _iuserDAL = iuserDAL;
     _serviceA = serviceA;
     Name      = name;
     Value     = value;
 }
示例#17
0
 public UserBLL(IUserDAL userDAL, UserValidation userValidation, IMapper mapper)
     : base(userDAL)
 {
     _userDAL        = userDAL;
     _userValidation = userValidation;
     _mapper         = mapper;
 }
示例#18
0
 public ComicBookController(ICollectionDAL collectionDAL, IStatisticsDAL statisticsDAL, IComicDAL comicDAL, IUserDAL userDAL)
 {
     this.collectionDAL = collectionDAL;
     this.statisticsDAL = statisticsDAL;
     this.comicDAL      = comicDAL;
     this.userDAL       = userDAL;
 }
示例#19
0
 public ProfileController(IProfileSearchDAL profileSearchDAL, IUserDAL userDAL, IAuthProvider authProvider, IProfileDAL profileDAL)
 {
     this.profileSearchDAL = profileSearchDAL;
     this.userDAL          = userDAL;
     this.authProvider     = authProvider;
     this.profileDAL       = profileDAL;
 }
 public AdminController(IAuthProvider authProvider, TeamSqlDAL teamDAL, IUserDAL userDAL, MessagesDAL messageDAL)
 {
     this.authProvider = authProvider;
     this.teamDAL      = teamDAL;
     this.userDAL      = userDAL;
     this.messageDAL   = messageDAL;
 }
 public HomeController(IRecipeDAL recipeDAL, IUserDAL userDal, IRecipeIngredientDAL recipeIngredientDAL, IIngredientDAL ingredientDAL, IPreparationStepsDAL preparationStepsDAL)
 {
     this.recipeDAL           = recipeDAL;
     this.userDAL             = userDal;
     this.recipeIngredientDAL = recipeIngredientDAL;
     this.ingredientDAL       = ingredientDAL;
     this.preparationStepsDAL = preparationStepsDAL;
 }
示例#22
0
 public UserLogic(IUserDAL DAL)
 {
     if (DAL == null)
     {
         throw new ArgumentNullException("DAL as parametr is null");
     }
     dal = DAL;
 }
示例#23
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            MyContainer container = new MyContainer();

            container.Register <IUserDAL, UserDAL>();
            IUserDAL userDal = container.Resolve <IUserDAL>();
        }
示例#24
0
 public HomeController(IAuthProvider authProvider, IBeerDAL beerDAL, IBreweryDAL breweryDAL, IBeerReviewDAL beerReviewDAL, IUserDAL userDAL)
 {
     this.AuthProvider = authProvider;
     BeerDAL           = beerDAL;
     BreweryDAL        = breweryDAL;
     BeerReviewDAL     = beerReviewDAL;
     UserDAL           = userDAL;
 }
示例#25
0
 public PurchaseController(IReservationDAO resParam, IFilmDAO filmParam, IShowTimeDAO stParam, IAuthProvider authProvider, IUserDAL userDAO)
 {
     this.ResDAO       = resParam;
     this.FilmDAO      = filmParam;
     this.ShowTimeDAO  = stParam;
     this.authProvider = authProvider;
     this.userDAO      = userDAO;
 }
示例#26
0
 public AccountController(IAuthProvider authProvider, IUserDAL userDAL, IBeerDAL beerDAL, IBreweryDAL breweryDAL, IBeerReviewDAL beerReviewDAL)
 {
     this.AuthProvider  = authProvider;
     this.UserDAL       = userDAL;
     this.BeerDAL       = beerDAL;
     this.BreweryDAL    = breweryDAL;
     this.BeerReviewDAL = beerReviewDAL;
 }
示例#27
0
 public User(string name, IUserDAL userdal, IBetDAL betdal)
 {
     this.Name        = name;
     this._userDAL    = userdal;
     this._betDal     = betdal;
     this.UserRole    = 2;
     this.Permissions = new List <string>();
     this.CurrentBet  = MakeBetObject(betdal.GetCurrentBet(this.Id));
 }
示例#28
0
 public CampaignController(ICampaignDAL campaigndal, ICategoryDAL categorydal, IMakeDAL makedal, IProductModelDAL modeldal, IProductDAL productdal, IUserDAL userdal)
 {
     CampaignDAL = campaigndal;
     CategoryDAL = categorydal;
     MakeDAL     = makedal;
     ModelDAL    = modeldal;
     ProductDAL  = productdal;
     UserDAL     = userdal;
 }
示例#29
0
 public GymController(IEquipmentDAL equipmentDAL, IWorkoutDAL workoutDAL, IVisitDAL visitDAL,
                      IAuthProvider authProvider, IUserDAL userDAL)
 {
     this.workoutDAL   = workoutDAL;
     this.userDAL      = userDAL;
     this.equipmentDAL = equipmentDAL;
     this.visitDAL     = visitDAL;
     this.authProvider = authProvider;
 }
 public UserDetailController(IUserDAL _userDAL, IUserCardDAL _userCardDAL, IUserAddressDAL _userAddressDAL, ICityDAL _cityDAL, IDistrictDAL _districtDAL, IOrderDAL _orderDAL)
 {
     orderDAL       = _orderDAL;
     districtDAL    = _districtDAL;
     cityDAL        = _cityDAL;
     userDAL        = _userDAL;
     userCardDAL    = _userCardDAL;
     userAddressDAL = _userAddressDAL;
     currentUser    = System.Web.HttpContext.Current.Session["user"] as ETicaret.Model.Models.Entity.User;
 }
示例#31
0
        public void TestSave()
        {
            IUserDAL dal  = DALFactory.createUserDAL();
            User     user = new User();

            user.UserName = "******";
            user.Password = EncryptUtil.MD5Encrypt("12345678");
            user.Type     = "5";
            dal.save(user);
        }
示例#32
0
        //private ContainerBuilder _builder;
        //private IContainer _IContainer;
        #endregion

        #region constructor
        public UserBLL(IUserDAL userDal)
        {
            _iUserDal = userDal;
            #region regist examp
            //_builder = new ContainerBuilder();
            //
            //////如果为Winform类型,请使用以下获取Assembly方法
            ////_builder.RegisterAssemblyTypes(AppDomain.CurrentDomain.GetAssemblies())//查找程序集中以services结尾的类型
            ////.Where(t => t.Name.EndsWith("Services"))
            ////.AsImplementedInterfaces();
            ////_builder.RegisterAssemblyTypes(AppDomain.CurrentDomain.GetAssemblies())//查找程序集中以Repository结尾的类型
            ////.Where(t => t.Name.EndsWith("Repository"))
            ////.AsImplementedInterfaces();

            ////如果有web类型,请使用如下获取Assenbly方法
            ////var assemblys = BuildManager.GetReferencedAssemblies().Cast<Assembly>().ToList();
            ////_builder.RegisterAssemblyTypes(assemblys.ToArray())//查找程序集中以Repository结尾的类型
            ////.Where(t => t.Name.EndsWith("Repository"))
            ////.AsImplementedInterfaces();
            //
            ////_builder.RegisterType<UserQueryDAL>().As<IUserQueryDAL>();
            //_IContainer = _builder.Build();
            #endregion
        }
示例#33
0
 public UserBLL()
 {
     userDAL = new UserDAL();
 }
示例#34
0
 public UserBLL(IUserDAL iUserDAL)
 {
     _userDAL = iUserDAL;
     _loggingBLL = new LoggingBLL();
 }
示例#35
0
 public UserService()
 {
     this.userDal = new UserDAL();
 }
示例#36
0
 public UsersBLL(IUserDAL iUserDal)
 {
     _iUserDal = iUserDal;
 }
示例#37
0
 public UserBLL()
 {
     _userDAL = new UserDAL();
     _loggingBLL = new LoggingBLL();
 }
示例#38
0
 public UserService(IUserDAL dal)
 {
     this.userDal = dal;
 }
示例#39
0
文件: UserBLL.cs 项目: smilelhh/-web-
 public UserBLL()
 {
     dal = DALFactory.createUserDAL();
 }