//项目相关的页面 public ActionResult Program(int id, int bid) { if (Session["CustomerId"] != null) { string ApiUrl = AliyunCommonParaConfig.ApiUrl; // 注意这里需要使用UTC时间,比北京时间少8小时。 string Timestamp = DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ", DateTimeFormatInfo.InvariantInfo); string Action = "GetVideoPlayAuth"; string SignatureNonce = CommonTools.EncryptToSHA1(CommonTools.GenerateRandomNumber(8)); AdsVideo video = unitOfWork.adsVideosRepository.GetByID(id); string VideoId = video.VideoUrl; ViewBag.babyId = bid; ViewBag.VideoId = VideoId; ViewBag.PlayAuth = AliyunVideoServices.GetVideoInfo(ApiUrl, VideoId, Timestamp, Action, SignatureNonce).PlayAuth; return(View(video)); } else { return(RedirectToAction("Login")); } }
public ActionResult Edit(AdsVideo adsvideo) { if (ModelState.IsValid) { unitOfWork.adsVideosRepository.Update(adsvideo); unitOfWork.Save(); return(RedirectToAction("Index")); } return(View(adsvideo)); }
public ActionResult Create(AdsVideo adsvideo) { if (ModelState.IsValid) { unitOfWork.adsVideosRepository.Insert(adsvideo); unitOfWork.Save(); return(RedirectToAction("Index")); } CategoryServices categoryServices = new CategoryServices(); ViewData["Categorylist"] = categoryServices.GetCategorySelectList(SkyVideoRootId); return(View(adsvideo)); }
public ActionResult Create(int cid) { AdsVideo video = new AdsVideo(); video.VideoNumber = CommonTools.ToUnixTime(System.DateTime.Now).ToString() + CommonTools.getRandomNumber(100000, 999999).ToString(); video.VideoPrice = 0; video.VideoZKPrice = 0; video.VideoVIPPrice = 0; video.VideoTry = false; video.VideoFree = false; // CategoryServices categoryServices= new CategoryServices(); ViewData["Categorylist"] = CategoryServices.GetCategorySelectList(cid); return(View(video)); }
// GET: /Video/Edit/5 public ActionResult Edit(int?id) { CategoryServices categoryServices = new CategoryServices(); ViewData["Categorylist"] = categoryServices.GetCategorySelectList(SkyVideoRootId); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AdsVideo adsvideo = unitOfWork.adsVideosRepository.GetByID(id); if (adsvideo == null) { return(HttpNotFound()); } return(View(adsvideo)); }
//项目相关的页面 public ActionResult FreeHeartServices(int id) { string ApiUrl = AliyunCommonParaConfig.ApiUrl; // 注意这里需要使用UTC时间,比北京时间少8小时。 string Timestamp = DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ", DateTimeFormatInfo.InvariantInfo); string Action = "GetVideoPlayAuth"; string SignatureNonce = CommonTools.EncryptToSHA1(CommonTools.GenerateRandomNumber(8)); AdsVideo video = unitOfWork.adsVideosRepository.GetByID(id); string VideoId = video.VideoUrl; ViewBag.VideoId = VideoId; ViewBag.PlayAuth = AliyunVideoServices.GetVideoInfo(ApiUrl, VideoId, Timestamp, Action, SignatureNonce).PlayAuth; return(View(video)); }
// GET: /Video/Edit/5 public ActionResult Edit(int?id) { //GetParentIdById if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AdsVideo adsvideo = unitOfWork.adsVideosRepository.GetByID(id); if (adsvideo == null) { return(HttpNotFound()); } int pid = CategoryServices.GetParentIdById(adsvideo.VideoCategory); ViewData["Categorylist"] = CategoryServices.GetCategorySelectList(pid); return(View(adsvideo)); }
public static string GetVideoNameById(int id) { AdsVideo video = unitOfWork.adsVideosRepository.GetByID(id); return(video.VideoName); }