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");
 }
Esempio n. 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;
 }
Esempio n. 3
0
    //methods to use it
    public void MyMethod()
    {
        IUserDAL userDAL = (IUserDAL)Activator.CreateInstance(_myUserDALType);

        //Call method in IUserDAL
        userDAL.CreateUser();
    }
Esempio n. 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"));
            }
        }
Esempio n. 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;
 }
Esempio n. 7
0
 public UserDALManageFacade()
 {
     _userDALProvider     = new UserDAL();
     _imageDALProvider    = new ImgStorageDAL();
     _userroleDALProvider = new UserRoleDAL();
     _roleDALProvider     = new RoleDAL();
 }
Esempio n. 8
0
 public ReservationController(IAuthProvider authProvider, IPetDAO petDAO, IUserDAL userDAL, IReservationDAO reservationDAO)
 {
     this.authProvider   = authProvider;
     this.petDAO         = petDAO;
     this.userDAL        = userDAL;
     this.reservationDAO = reservationDAO;
 }
Esempio n. 9
0
 public GymController(IAuthProvider authProvider, IGymDAL gymDAL, IMemberDAL memberDAL, IUserDAL userDAL)
 {
     this.authProvider = authProvider;
     this.gymDAL       = gymDAL;
     this.memberDAL    = memberDAL;
     this.userDAL      = userDAL;
 }
Esempio n. 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"));
            }
        }
Esempio n. 11
0
 public BrewerController(IBeerDAL beerDAL, IBreweryDAL breweryDAL, IUserDAL userDAL, IBeerRatingDAL beerRatingDAL)
 {
     this.beerDAL       = beerDAL;
     this.breweryDAL    = breweryDAL;
     this.userDAL       = userDAL;
     this.beerRatingDAL = beerRatingDAL;
 }
Esempio n. 12
0
 public AccountController(IAuthProvider authProvider, IUserDAL userDAO, IProfileDAL profileDAO, IProfileSearchDAL profileSearchDAL)
 {
     this.authProvider     = authProvider;
     this.userDAO          = userDAO;
     this.profileDAO       = profileDAO;
     this.profileSearchDAL = profileSearchDAL;
 }
Esempio n. 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;
 }
Esempio n. 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();
        }
Esempio n. 16
0
 public UserBLL([DIPParameterShortName("mysql")] IUserDAL iuserDAL, IServiceA serviceA, [DIPParameterConstant] string name, [DIPParameterConstant] int value)
 {
     _iuserDAL = iuserDAL;
     _serviceA = serviceA;
     Name      = name;
     Value     = value;
 }
Esempio n. 17
0
 public UserBLL(IUserDAL userDAL, UserValidation userValidation, IMapper mapper)
     : base(userDAL)
 {
     _userDAL        = userDAL;
     _userValidation = userValidation;
     _mapper         = mapper;
 }
Esempio n. 18
0
 public ComicBookController(ICollectionDAL collectionDAL, IStatisticsDAL statisticsDAL, IComicDAL comicDAL, IUserDAL userDAL)
 {
     this.collectionDAL = collectionDAL;
     this.statisticsDAL = statisticsDAL;
     this.comicDAL      = comicDAL;
     this.userDAL       = userDAL;
 }
Esempio n. 19
0
 public ProfileController(IProfileSearchDAL profileSearchDAL, IUserDAL userDAL, IAuthProvider authProvider, IProfileDAL profileDAL)
 {
     this.profileSearchDAL = profileSearchDAL;
     this.userDAL          = userDAL;
     this.authProvider     = authProvider;
     this.profileDAL       = profileDAL;
 }
Esempio n. 20
0
 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;
 }
Esempio n. 22
0
 public UserLogic(IUserDAL DAL)
 {
     if (DAL == null)
     {
         throw new ArgumentNullException("DAL as parametr is null");
     }
     dal = DAL;
 }
Esempio n. 23
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            MyContainer container = new MyContainer();

            container.Register <IUserDAL, UserDAL>();
            IUserDAL userDal = container.Resolve <IUserDAL>();
        }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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));
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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);
        }
Esempio n. 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
        }
Esempio n. 33
0
 public UserBLL()
 {
     userDAL = new UserDAL();
 }
Esempio n. 34
0
 public UserBLL(IUserDAL iUserDAL)
 {
     _userDAL = iUserDAL;
     _loggingBLL = new LoggingBLL();
 }
Esempio n. 35
0
 public UserService()
 {
     this.userDal = new UserDAL();
 }
Esempio n. 36
0
 public UsersBLL(IUserDAL iUserDal)
 {
     _iUserDal = iUserDal;
 }
Esempio n. 37
0
 public UserBLL()
 {
     _userDAL = new UserDAL();
     _loggingBLL = new LoggingBLL();
 }
Esempio n. 38
0
 public UserService(IUserDAL dal)
 {
     this.userDal = dal;
 }
Esempio n. 39
0
 public UserBLL()
 {
     dal = DALFactory.createUserDAL();
 }