public ActionResult _Read_FirstImages([DataSourceRequest] DataSourceRequest request, long ParamPlayerID) { PlayerImagesRepository modelRepo = new PlayerImagesRepository(); DataSourceResult result = modelRepo.ReadAll(ParamPlayerID, false, true).ToDataSourceResult(request); return(Json(result)); }
public ActionResult ReadFirstImages(long ParamPlayerID) { PlayerImagesRepository modelRepo = new PlayerImagesRepository(); var result = modelRepo.ReadAll(ParamPlayerID, false, true).ToList(); return(this.Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult ReadSecondImages(long ParamPlayerID, long ParamImageID) { PlayerImagesRepository modelRepo = new PlayerImagesRepository(); var data = modelRepo.ReadAll(ParamPlayerID, false, true).Where(m => m.PlayerImageID != ParamImageID).ToList(); return(this.Json(data, JsonRequestBehavior.AllowGet)); }
public JsonResult GetAllBeforeAfter(long PlayerId) { PlayerImagesRepository modelRepo = new PlayerImagesRepository(); var result = modelRepo.ReadAll(PlayerId, false, true).Where(i => i.PlayerID == PlayerId && i.IsBeforeAfter == true).ToList(); return(this.Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult ImageGallery(string id) { PlayerDashboardRepository modelRepo = new PlayerDashboardRepository(); var playerDashboard = modelRepo.ReadOne(id); string Reason = ""; if (modelRepo.ValidateLogin(playerDashboard, this, ref Reason)) { PlayerProgressGallery model = new PlayerProgressGallery(); model.PlayerID = playerDashboard.PlayerID; PlayerImagesRepository pImgRepo = new PlayerImagesRepository(); model.playerImages = pImgRepo.ReadAll(model.PlayerID.Value, false, false); ViewBag.PlayerProgressGallery = model; //Descrypt password return(View(playerDashboard)); } else { //Otherwise Redirect to Login Screen, if cookie didn't match then redirect to Login Page System.Web.Routing.RouteValueDictionary rt = new System.Web.Routing.RouteValueDictionary(); rt.Add("id", id); rt.Add("Reason", Reason); return(RedirectToAction("Login", rt)); } }
public ActionResult _Read_SecondImages([DataSourceRequest] DataSourceRequest request, long ParamPlayerID, long ParamImageID) { PlayerImagesRepository modelRepo = new PlayerImagesRepository(); var data = modelRepo.ReadAll(ParamPlayerID, false, true).Where(m => m.PlayerImageID != ParamImageID).ToList(); DataSourceResult result = data.ToDataSourceResult(request); return(Json(result)); }
// GET: Member //id compare from PlayerDashboard.Dashboard URL to get PlayerID public ActionResult Index(string id) { PlayerDashboardRepository modelRepo = new PlayerDashboardRepository(); //Check if Player is Allowed to Access Premium Dashboard var playerDashboard = modelRepo.ReadOne(id); //if Didn't found any record then difinitely Player is not registered for Premium Dashboard if (playerDashboard == null) { return(RedirectToAction("NoPremiumMembership")); } //If system found a Cookie and Login Cookie Session is similar then let the user Login to Player Dashboard without Displaying Login Screen string Reason = ""; if (true)//modelRepo.ValidateLogin(playerDashboard, this, ref Reason)) { //if (playerDashboard.IsFirstLogin) //{ // System.Web.Routing.RouteValueDictionary rt = new System.Web.Routing.RouteValueDictionary(); // rt.Add("id", id); // return RedirectToAction("Settings", rt); //} PlayerProgressGallery model = new PlayerProgressGallery(); model.PlayerID = playerDashboard.PlayerID; PlayerImagesRepository pImgRepo = new PlayerImagesRepository(); model.playerImages = pImgRepo.ReadAll(model.PlayerID.Value, false, false); ViewBag.PlayerProgressGallery = model; PlayerDashboardNotificationsRepository paRepo = new PlayerDashboardNotificationsRepository(); var playerNotifications = paRepo.ReadAll_NonDismissed(model.PlayerID.Value); ViewBag.Notifications = playerNotifications.ToList(); return(View(playerDashboard)); } else { //Otherwise Redirect to Login Screen, if cookie didn't match then redirect to Login Page System.Web.Routing.RouteValueDictionary rt = new System.Web.Routing.RouteValueDictionary(); rt.Add("id", id); rt.Add("Reason", Reason); return(RedirectToAction("Login", rt)); } //We need to Implement Cookies to store Login Session ID. //Member can be login for upto 1 week after that they must enter their Password to View their Dashboard //Must have Paid Out payment of type "Premium Dashboard" in last 31 days //var dashboard = modelRepo.va }
// GET: Member //id compare from PlayerDashboard.Dashboard URL to get PlayerID public ActionResult Index(string id) { if (SecurityUtils.Enable_PremiumDashboard == false) { return(RedirectToAction("Index", "Home")); } PlayerDashboardRepository modelRepo = new PlayerDashboardRepository(); //Check if Player is Allowed to Access Premium Dashboard var playerDashboard = modelRepo.ReadOne(id); //if Didn't found any record then difinitely Player is not registered for Premium Dashboard if (playerDashboard == null) { return(RedirectToAction("NoPremiumMembership")); } //If system found a Cookie and Login Cookie Session is similar then let the user Login to Player Dashboard without Displaying Login Screen string Reason = ""; //if (modelRepo.ValidateLogin(playerDashboard, this, ref Reason)) //{ // if (playerDashboard.IsFirstLogin) // { // System.Web.Routing.RouteValueDictionary rt = new System.Web.Routing.RouteValueDictionary(); // rt.Add("id", id); // return RedirectToAction("Settings", rt); // } PlayerProgressGallery model = new PlayerProgressGallery(); model.PlayerID = playerDashboard.PlayerID; PlayerImagesRepository pImgRepo = new PlayerImagesRepository(); model.playerImages = pImgRepo.ReadAll(model.PlayerID.Value, false, false); ViewBag.PlayerProgressGallery = model; List <PlayerImagesExt> ListOfPlayerImages = new List <PlayerImagesExt>(); PlayerImagesRepository modelImagesRepo = new PlayerImagesRepository(); ListOfPlayerImages = modelImagesRepo.ReadAll(model.PlayerID.Value, true, false); ViewBag.PlayerAnimatedGallery = ListOfPlayerImages; PlayerDashboardNotificationsRepository paRepo = new PlayerDashboardNotificationsRepository(); var playerNotifications = paRepo.ReadAll_NonDismissed(model.PlayerID.Value); ViewBag.Notifications = playerNotifications.ToList(); MemberToolsBenefitsRepository toolsRepo = new MemberToolsBenefitsRepository(); ViewBag.ToolsAndBenifits = toolsRepo.ReadAll(); HeaderTextsRepository headerTexts = new HeaderTextsRepository(); var headerTextList = headerTexts.ReadAll(); //Select if date specific header exists if (headerTextList.Exists(x => x.DisplayDate.HasValue && x.DisplayDate.Value.Date.ToString("dd/MM/YYYY") == DateTime.Now.Date.ToString("dd/MM/yyyy"))) { playerDashboard.HeaderTexts = new HeaderTextsExt(); playerDashboard.HeaderTexts = headerTextList.Where(x => x.DisplayDate.HasValue && x.DisplayDate.Value.Date.ToString("dd/MM/YYYY") == DateTime.Now.Date.ToString("dd/MM/yyyy")).SingleOrDefault(); } else { var headerListWithoutDateHeaders = headerTextList.Where(x => x.DisplayDate == null).ToList(); if (headerListWithoutDateHeaders != null && headerListWithoutDateHeaders.Count > 0) { playerDashboard.HeaderTexts = new HeaderTextsExt(); //Select general header int randomNumber = GeneralHelper.GetRandomNumber(1, headerListWithoutDateHeaders.Count); var listArray = headerListWithoutDateHeaders.ToArray(); playerDashboard.HeaderTexts = listArray[randomNumber - 1]; } } return(View(playerDashboard)); //} //else //{ // //Otherwise Redirect to Login Screen, if cookie didn't match then redirect to Login Page // System.Web.Routing.RouteValueDictionary rt = new System.Web.Routing.RouteValueDictionary(); // rt.Add("id", id); // rt.Add("Reason", Reason); // return RedirectToAction("Login", rt); //} //We need to Implement Cookies to store Login Session ID. //Member can be login for upto 1 week after that they must enter their Password to View their Dashboard //Must have Paid Out payment of type "Premium Dashboard" in last 31 days //var dashboard = modelRepo.va }
public ActionResult GetPlayerGIFImages(long id, bool All) { PlayerImagesRepository modelRepo = new PlayerImagesRepository(); return(this.Json(modelRepo.ReadAll(id, true, All), JsonRequestBehavior.AllowGet)); }
public ActionResult GetPlayerImagesAsync(long id) { PlayerImagesRepository modelRepo = new PlayerImagesRepository(); return(this.Json(modelRepo.ReadAll(id, false, true), JsonRequestBehavior.AllowGet)); }
/// <summary> /// Save Player Progress Image /// </summary> /// <param name="PlayerProgressImages">List of Uploaded Images</param> /// <param name="PlayerEmailAddress">Player Email Address to match and save against Player record in DB</param> /// <param name="LeagueID">League ID from current League Home Page</param> /// <param name="IsFront">IsFront</param> /// <param name="IsSide">IsSide</param> /// <returns></returns> public ActionResult SavePlayerProgressImages(IEnumerable <HttpPostedFileBase> PlayerProgressImages_Front, IEnumerable <HttpPostedFileBase> PlayerProgressImages_Side, string PlayerEmailAddress, long LeagueID, bool IsFront, bool IsSide) { IEnumerable <HttpPostedFileBase> PlayerProgressImages = null; List <PlayerImagesExt> ListOfPlayerImages = new List <PlayerImagesExt>(); if (PlayerProgressImages_Front != null) { PlayerProgressImages = PlayerProgressImages_Front; } else if (PlayerProgressImages_Side != null) { PlayerProgressImages = PlayerProgressImages_Side; } PlayersRepository playerRepo = new PlayersRepository(); var player = playerRepo.ReadOne_ByEmailAddress(PlayerEmailAddress); PlayerImagesRepository modelRepo = new PlayerImagesRepository(); if (player != null) { ListOfPlayerImages = modelRepo.ReadAll(player.PlayerID, false, false); } var ErrorMsg = ValidatePlayer_ForProgressImage(player, ListOfPlayerImages, LeagueID, IsFront, IsSide); if (!string.IsNullOrEmpty(ErrorMsg)) { return(Content(ErrorMsg)); } else { var ParamPlayerID = player.PlayerID; string FinalFileName = ""; // The Name of the Upload component is "files" if (PlayerProgressImages != null) { string PlayerImagesFolder = Path.Combine(Server.MapPath("~" + SecurityUtils.Players_ImagePath + ""), ParamPlayerID.ToString()); foreach (var file in PlayerProgressImages) { if (!(System.IO.Directory.Exists(PlayerImagesFolder))) { System.IO.Directory.CreateDirectory(PlayerImagesFolder); } // Some browsers send file names with full path. This needs to be stripped. string IEFileName = "", FileNameWithExtension = ""; if (Request.Browser.Browser.ToLower().Equals("ie") || Request.Browser.Browser.ToLower().Equals("internetexplorer")) { IEFileName = Path.GetFileName(file.FileName); } if (IEFileName != "") { FileNameWithExtension = IEFileName; SecurityUtils.CheckforInvalidFileNameChar(ref FileNameWithExtension); } else { FileNameWithExtension = file.FileName; SecurityUtils.CheckforInvalidFileNameChar(ref FileNameWithExtension); } var fileExtension = Path.GetExtension(FileNameWithExtension); //Following Code will rename the file if it is already Exists int count = 1; string fileNameOnly = Guid.NewGuid().ToString(); //Path.GetFileNameWithoutExtension(FileNameWithExtension); string extension = Path.GetExtension(FileNameWithExtension); string newFullPath = FileNameWithExtension; newFullPath = Path.Combine(PlayerImagesFolder, fileNameOnly + extension); while (System.IO.File.Exists(newFullPath)) { string tempFileName = string.Format("{0}({1})", fileNameOnly, count++); newFullPath = Path.Combine(PlayerImagesFolder, tempFileName + extension); } fileNameOnly = Path.GetFileNameWithoutExtension(newFullPath); //Update Filename from Repository string Msg = ""; bool status = true; FinalFileName = fileNameOnly + extension; //Save the file to the Disk file.SaveAs(newFullPath); // ImageWaterMark imgWaterMark = new ImageWaterMark(); string PlayerImagePath = Path.Combine(PlayerImagesFolder, FinalFileName); string WaterMarkImagePath = Server.MapPath("~/Images/verticle_mvff.png"); Image_Combine imgCombine = new Image_Combine(); string FinalFileName_WaterMarked = imgCombine.CombineBitmap_WatermarkImage(PlayerImagesFolder, FinalFileName, WaterMarkImagePath); //imgWaterMark.GenerateWaterMarkOnImage(PlayerImagesFolder, FinalFileName, false, true, WaterMarkImagePath, null, false, false, true, false, false); //Clear the Object imgCombine = null; PlayerImagesExt PlayerImg = new PlayerImagesExt() { PlayerID = ParamPlayerID, FileName = FinalFileName_WaterMarked, IsAnimated = false, Display = true, DefaultImage = false, IsFront = IsFront, IsSide = IsSide, UploadDateTime = DateTime.Now }; modelRepo.CreateOrUpdate(ref PlayerImg, ref Msg, ref status, this); string NonWaterMarkImagePath = Path.Combine(PlayerImagesFolder, FinalFileName); if (System.IO.File.Exists(NonWaterMarkImagePath)) { System.IO.File.Delete(NonWaterMarkImagePath); } } } // Return an empty string to signify success return(Content("")); } }