public void Update(Project model)
        {
            if (model == null)
                throw new ArgumentNullException("project");
            projectRepository.Update(model);

        }
 public async Task DeleteAsync(Project model)
 {
     if (model == null)
         throw new ArgumentNullException("project");
     await projectRepository.DeleteAsync(model);
 }
 public int Insert(Project model)
 {
     if (model == null)
         throw new ArgumentNullException("project");
     return projectRepository.Insert(model);
 }
        public async Task<ActionResult> Start(ProjectStart model)
        {
            if (ModelState.IsValid)
            {
                Project project = new Project
                {
                    AuthorID = _investContext.CurrentUser.Id,
                    CreateDate = DateTime.Now,
                    Status = ProjectStatusEnum.Uncreated,
                    IsInspected = false,
                    ProjectFilesDirectory = "",
                    Name = model.Name,
                    FundingDuration = model.FundingDuration,
                    LocationCityID = model.LocationCityID,
                    NecessaryFunding = model.NecessaryFunding,
                    ScopeID = model.ScopeID,
                    ShortDescription = model.ShortDescription
                };

                try
                {
                    await _projectRepository.InsertAsync(project);

                    string projectFilesDirectoryName = String.Format("project{0}in{1}", project.ID.ToString(), project.CreateDate.ToString("dd_MM_yyyy"));
                    string userDirRelPath = Path.Combine(ConfigurationManager.AppSettings["FileUploadDirectory"].ToString(), _investContext.CurrentUser.FilesBrowserDirectory);
                    string projectDirRelPath = Path.Combine(userDirRelPath, projectFilesDirectoryName);
                    
                    Directory.CreateDirectory(Server.MapPath(projectDirRelPath));
                    project.ProjectFilesDirectory = projectFilesDirectoryName;

                    await _projectRepository.EditAsync(project);
                }
                catch (Exception ex) { }

                return RedirectToAction("CompleteSecondStepOfStart", new { Id = project.ID });
            }
            else
            {
                return View(model);
            }

            
        }