Example #1
0
        public ValuesController(IPlayerService playerService, IMemoryCache memoryCache, NBAContext _context)
        {
            unitOfWork _unitOfWork = new unitOfWork(_context);

            _playerService = playerService;
            _memoryCache   = memoryCache;
        }
        public static string AjouterReservationDansLaBase(RESERVATION_MODEL model)
        {
            RESERVATIONs reservation = IntReservationFromModel(model);

            using (unitOfWork unitOfWork = new unitOfWork())
            {
                return(unitOfWork.ReservationRepository.Add(reservation));
            }
        }
Example #3
0
 public static List <PROFESSEUR> GetfProfesseur()
 {
     try
     {
         using (unitOfWork unitofwork = new unitOfWork())
         {
             return(unitofwork.GetProf.Get().ToList());
         }
     }
     catch
     {
         return(null);
     }
 }
Example #4
0
 public static List <SALLE> GetSalle()
 {
     try
     {
         using (unitOfWork unitofwork = new unitOfWork())
         {
             return(unitofwork.GetSalle.Get().ToList());
         }
     }
     catch
     {
         return(null);
     }
 }
Example #5
0
 public static List <MATIERE> GetMatiere()
 {
     try
     {
         using (unitOfWork unitofwork = new unitOfWork())
         {
             return(unitofwork.GetMatiere.Get().ToList());
         }
     }
     catch
     {
         return(null);
     }
 }
Example #6
0
 public static List <PROMOTION> GetPromotion()
 {
     try
     {
         using (unitOfWork unitofwork = new unitOfWork())
         {
             return(unitofwork.GetPromotion.Get().ToList());
         }
     }
     catch
     {
         return(null);
     }
 }
        public static List <RESERVATION_MODEL> GetAll()
        {
            List <RESERVATIONs> _model = new List <RESERVATIONs>();

            try
            {
                using (unitOfWork unitofwork = new unitOfWork())
                {
                    _model = unitofwork.GetReservationDay.Get().ToList();
                    return(mappingResultDbToModel(_model));
                }
            }
            catch (Exception e)
            {
                return(null);
            }
        }
        public static UTILISATEUR_MODEL GetUserPasswordByEmail(string email)
        {
            List <UTILISATEUR> _model = new List <UTILISATEUR>();

            try
            {
                using (unitOfWork unitofwork = new unitOfWork())
                {
                    _model = unitofwork.GetUser.Get(x => x.E_MAIL == email).ToList();
                    return(mappingResultDbToModel(_model));
                }
            }
            catch (Exception e)
            {
                return(null);
            }
        }
        public ActionResult Register(UserRegister user)
        {
            // The ModelState represents a collection of name and value pairs that were submitted to the server during a POST.

            // ModelState:

            // To store the value submitted to the server.
            // Store the validation errors associated with those values.
            if (ModelState.IsValid)
            //Tells whether it is possible to bind the incoming values from the request to the model correctly.
            {
                if (kEY_DB.tblUsers.Where(m => m.Email == user.Email).FirstOrDefault() == null)
                {
                    string UserNameImage  = user.UserName;
                    string ImageFileName  = Path.GetFileNameWithoutExtension(user.ImageFile.FileName);
                    string ImageExtension = Path.GetExtension(user.ImageFile.FileName);

                    string ImagePathDetails = ImageFileName + UserNameImage + ImageExtension;
                    user.UrlImage = "~/IMG/" + ImagePathDetails;   // Save this Path in Database. It is the Project Path.

                    string SaveImage = Path.Combine(Server.MapPath("~/IMG/"), ImagePathDetails);
                    user.ImageFile.SaveAs(SaveImage); // Here we save the actual Path(Full Path of the Image) in the Images folder.

                    tblUser tblUser = new tblUser();

                    // User-> Inputs from the view.
                    // tblUser -> Store thos Inputs in the database.
                    tblUser.UserName = user.UserName;
                    tblUser.Email    = user.Email;
                    tblUser.Passcode = user.ConfirmPasscode;
                    tblUser.UrlImage = user.UrlImage;

                    unitOfWork uow = new unitOfWork(kEY_DB);// Saving the Images in the Databse.
                    uow.getUserRepo().RegisterUser(tblUser);
                    kEY_DB.SaveChanges();
                    ModelState.Clear();
                    return(RedirectToAction("Index", "users"));
                }
                else
                {
                    ModelState.AddModelError("Error", "Email Already Exists!");
                    return(View(user));
                }
            }
            return(View(user));
        }
Example #10
0
 public productSearch(unitOfWork UOW)
 {
     uow = UOW;
     sm  = new subcategoryModel();
 }
Example #11
0
 public productDetails(unitOfWork Uow)
 {
     uow = Uow;
 }
Example #12
0
 public productCompare(unitOfWork Uow)
 {
     uow = Uow;
 }
Example #13
0
 public productList(unitOfWork Uow)
 {
     uow         = Uow;
     displayList = new List <tblProduct>();
 }
Example #14
0
 public ProductServices(unitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }