public JsonResult EditUploadJS(int uploadId) { var ajaxResponse = new AjaxResponse { Success = false, Message = "There was a problem loading the upload." }; ExtractViewModel model = new ExtractViewModel(); try { var extract = ExtractViewModel.GetExtract(_unitOfWork, uploadId); if (extract == null) { return(Json(ajaxResponse)); } model.ExtractId = uploadId; model.Name = extract.Name; model.NameSave = extract.Name; ajaxResponse.Success = true; ajaxResponse.TheData = model; } catch (Exception ex) { ErrorTools.HandleError(ex, ErrorLevel.NonFatal); //just log, no redirect } return(Json(ajaxResponse)); }
public JsonResult GetUploadNameJS(int uploadId) { var ajaxResponse = new AjaxResponse { Success = false, Message = "An error occurred while getting the upload name." }; try { string uploadName; var upload = ExtractViewModel.GetExtract(_unitOfWork, uploadId); if (upload != null) { uploadName = upload.Name; } else { uploadName = "unknown"; } ajaxResponse.Success = true; ajaxResponse.TheData = uploadName; } catch (Exception ex) { ErrorTools.HandleError(ex, ErrorLevel.NonFatal); //just log, no redirect } return(Json(ajaxResponse)); }
public ActionResult ManageUploads(int?uploadId) { ExtractViewModel upload; if (uploadId != null) { upload = ExtractViewModel.GetExtract(_unitOfWork, (int)uploadId); if (upload == null) { throw new ApplicationException(string.Format("The Upload (ID: {0}) could not be loaded.", uploadId)); } } else { upload = new ExtractViewModel(); //want extractId == 0 } return(View("ManageUploads", upload)); }
public ActionResult ShowUploadDetailOnly(int uploadId) { ExtractViewModel upload = ExtractViewModel.GetExtract(_unitOfWork, uploadId); return(View("UploadDetail", upload)); }