public ActionResult PickFile(PnpFileViewModel model) { if (model.SelectedPnpFile != "0") { return(RedirectToAction("Create", new { id = Guid.Parse(model.SelectedPnpFile), SPHostUrl = Request.QueryString["SPHostUrl"] })); } if (model.file != null) { var pnpFiles = _pnpFileService.Read().Result.ToList(); var info = model.file.FileName; bool sameName = pnpFiles.Any(l => l.Filename == model.file.FileName); if (sameName) { return(null); } else { _pnpFileService.Insert(model.ToPnpFile()); return(RedirectToAction("Create", new { id = model.Id, SPHostUrl = Request.QueryString["SPHostUrl"] })); } } return(View(model)); }
public async Task <ActionResult> ValidateTemplate(PnpFileViewModel pnpViewModel) { string fileName = pnpViewModel.file.FileName; var validFileName = await _pnpFileService.Validate(fileName); return(Json(new { Result = validFileName.Key, Message = validFileName.Value })); }
public async Task <ActionResult> PickFile() { var pnpFiles = await _pnpFileService.Read(); var model = new PnpFileViewModel { Id = Guid.NewGuid(), PnpFiles = pnpFiles.ToList <PnpFile>() }; return(View(model)); }