public async Task <ActionResult> Create([Bind(Include = "Id,Name,Notes")] ConstructionProject constructionProject)
        {
            if (ModelState.IsValid)
            {
                db.ConstructionProjects.Add(constructionProject);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(constructionProject));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Notes,PictureReference,ConstructionProjectId")] ProgressTrackingEntry progressTrackingEntry)
        {
            if (ModelState.IsValid)
            {
                if (Request.Files.Count > 0)
                {
                    var file = Request.Files[0];
                    if (file != null && file.ContentLength > 0)
                    {
                        var fileName = Path.GetFileName(file.FileName);
                        var mimeType = MimeMapping.GetMimeMapping(fileName);
                        var filePath = await _filesStorageService.UploadFile(fileName, file.InputStream, mimeType);

                        progressTrackingEntry.PictureReference = filePath;
                    }
                }

                progressTrackingEntry.EntryDate = DateTime.Now;
                _db.ProgressTrackingEntries.Add(progressTrackingEntry);
                await _db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.ConstructionProjectId = new SelectList(_db.ConstructionProjects, "Id", "Name", progressTrackingEntry.ConstructionProjectId);
            return(View(progressTrackingEntry));
        }