public ActionResult Create(ViewModel VN, HttpPostedFileBase ImageeExPrincipale, string[] Outildata, string[] ConseilData, IEnumerable <HttpPostedFileBase> UploadImage, List <string> UploadTitle, IEnumerable <HttpPostedFileBase> UploadDrive, List <string> UploadTitleDrive)
        {
            if (ModelState.IsValid)
            {
                //Ajouter Expiriment----------------------------------------------
                var ImageExprirmentPath = Path.Combine(Server.MapPath("~/Images/ImageExpiriment"), ImageeExPrincipale.FileName);
                ImageeExPrincipale.SaveAs(ImageExprirmentPath);
                VN.Expiriment.ApplicationUserId = User.Identity.GetUserId();
                VN.Expiriment.DateTime          = DateTime.Now;
                VN.Expiriment.Image             = ImageeExPrincipale.FileName;
                VN.Expiriment.IdFilliere        = string.Join(",", VN.Expiriment.SelectedArrayFilliere);
                db.Expiriments.Add(VN.Expiriment);
                db.SaveChanges();
                //------------------------------Ajouter Outils--------------------------------------

                OutilConseilImage.SaveOutil(Outildata, VN.Expiriment.Id);

                //------------------------------Ajouter Conseil--------------------------------------

                OutilConseilImage.SaveConseil(ConseilData, VN.Expiriment.Id);

                //Ajouter Image----------------------------------------------------------------------
                OutilConseilImage.saveImage(UploadImage, UploadTitle, VN.Expiriment.Id);
                //Ajouter Fichier pour telecharger
                GoogleDriveFilesRepository.FileUpload(UploadDrive, UploadTitleDrive, VN.Expiriment.Id);

                return(RedirectToAction("Index"));
            }

            return(View());
        }
Example #2
0
        public ActionResult UploadFile(String tenbaihat, String tentacgia, HttpPostedFileBase file)
        {
            string signature = GoogleDriveFilesRepository.FileUpload(tenbaihat, tentacgia, file);

            ViewBag.Message = signature;
            return(View());
        }
Example #3
0
        public ActionResult UploadFile(String tenbaihat, String tentacgia, HttpPostedFileBase file)
        {
            string signature = GoogleDriveFilesRepository.FileUpload(tenbaihat, tentacgia, file);

            ViewBag.Message = signature;
            ViewBag.ses     = (UserLogin)Session[CommonConstants.User_Session];
            return(View());
        }
Example #4
0
        static void Main()
        {
            Console.WriteLine("Running");
            GoogleDriveFilesRepository.FileUpload("Output2020_09_03.csv");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());


            //Application.Run(new Form1());
        }
Example #5
0
        private void UploadTOGGDrive(FileDesignDTO dgr, string folderId)
        {
            // get current row
            DataGridRow rowDetail = dgvImageInfo.ItemContainerGenerator.ContainerFromItem(dgr) as DataGridRow;

            string shareableLink = GoogleDriveFilesRepository.FileUpload(dgr.FilePath, folderId);

            if (shareableLink != null && shareableLink.Length > 0)
            {
                string id = dgr.Filename.Split('-')[0];
                imageUploads.Add(new ImageUploadDTO()
                {
                    ID = id, ImageLink = shareableLink
                });

                dgvImageInfo.Dispatcher.Invoke(new Action(delegate
                {
                    SolidColorBrush brush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 81, 211, 115));
                    rowDetail.Background  = brush;
                }));
            }
        }
 public ActionResult UploadFile(HttpPostedFileBase file)
 {
     GoogleDriveFilesRepository.FileUpload(file);
     return(RedirectToAction("GetGoogleDriveFiles"));
 }
Example #7
0
 public ActionResult UploadFile(IFormFile file)
 {
     GoogleDriveFilesRepository.FileUpload(file);
     return(RedirectToAction("GetGoogleDriveFiles"));
 }
 public ActionResult UploadFile(IFormFile file)
 {
     driveService.FileUpload(file);
     return(RedirectToAction("GetGoogleDriveFiles"));
 }