public ActionResult UploadAllDocumentsPutBack(IEnumerable<HttpPostedFileBase> checkDocuments) { //Let us get Id of newly created reocrd string _addedPutBackRecordID = Request.Form["hdnPutbackRecordID"]; //If ID is not null then go ahaead if (_addedPutBackRecordID != null) { int _recordID = 0; //Gather the Info _recordID = Convert.ToInt32(_addedPutBackRecordID); //Get the Info from the Repository Cascade.Data.Repositories.MSIPutBackFormRepository repository = new MSIPutBackFormRepository(); Cascade.Data.Models.MSI_PutBackForm _putbackForm = (from existingForm in repository.GetAll().Where(record => record.ID == _recordID) select existingForm).First(); _putbackForm.UploadedOn = DateTime.Now; _putbackForm.IsActive = true; _putbackForm.UploadedBy = UserId.ToString(); #region [[ Check Images ]] if (checkDocuments != null) { if (checkDocuments.Count() >= 1) { PerformFileUploadOperationPutBack(_putbackForm, checkDocuments); } } #endregion //Redirect to View Edit Form return RedirectToAction("DetailsPutback", "Recall", new { id = _putbackForm.ID }); } else { //Something is wrong so go to main page return RedirectToAction("PutBackIndex", "Recall"); } }
public JsonResult GetPutbackData(int id) { MSIPutBackFormRepository portRecallRepo = new MSIPutBackFormRepository(); var _portRecallData = from _portRecall in portRecallRepo.GetAll().Distinct() where _portRecall.ID == id select _portRecall; return Json(_portRecallData.SingleOrDefault(), JsonRequestBehavior.AllowGet); }