コード例 #1
0
        public ActionResult UploadCommsCenterVideoImage(FormCollection formCollection, CommunicationsCentreVideoModel model)
        {
            if (Request != null && Request.Files.Count == 1)
            {
                var file = Request.Files[0];

                if (!file.IsImage())
                {
                    return(View("CommunicationsCenterUploadImage", model));
                }

                string thumbName      = "thumb_" + model.id.ToString() + file.FileName.Substring(file.FileName.LastIndexOf("."));
                string targetFilePath = Utilities.GetDaikinCityDirectory() + @"images\buildings\communications-center\" + thumbName;

                if (file != null && file.ContentLength > 0)
                {
                    file.SaveAs(targetFilePath);
                    services.SaveCommsCenterVideoThumb(model.id, thumbName);
                }
            }

            return(RedirectToAction("CommunicationsCenter"));
        }
コード例 #2
0
        public ActionResult CommunicationsCenterUploadImage(long videoid)
        {
            CommunicationsCentreVideoModel model = services.GetSingleCommunicationsCenterVideo(videoid);

            return(View(model));
        }