public ActionResult PostIncomingToNewProject(int?id) { if (id == null) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); } incoming_project projectIn = db.incoming_project.Find(id); if (id == null) { return(HttpNotFound()); } TempData["project_name"] = projectIn.project_name; TempData["lab_head"] = projectIn.lab_head; TempData["investigator"] = projectIn.contact_name; TempData["email"] = projectIn.contact_email; TempData["contact_phone"] = projectIn.contact_phone; TempData["service_requested"] = projectIn.service_requested; TempData["sample_type"] = projectIn.sample_type; TempData["number_of_samples"] = projectIn.number_of_samples; TempData["species"] = projectIn.species; TempData["service_requested"] = projectIn.service_requested; TempData["downstream_process"] = projectIn.downstream_process; TempData["comments"] = projectIn.comments; return(View()); }
public ActionResult SubmitNewProject(incoming_project newIncomingProject) { try { if (ModelState.IsValid) { using (pimsEntitiesNew db = new pimsEntitiesNew()) { db.incoming_project.Add(newIncomingProject); db.SaveChanges(); } ModelState.Clear(); using (pimsEntitiesNew dbpid = new pimsEntitiesNew()) { var crum = dbpid.incoming_project.Max(d => d.temp_project_id); ViewBag.successMessage = "Temporary Project ID:" + crum.ToString() + "\nYour project information has been successfully submitted.\nPlease bring your samples to the GCL along with the Temporary Project ID."; } } } catch (Exception ex) { ModelState.AddModelError("projectSubmitError", ex.Message); } return(View()); }
public ActionResult DeleteConfirmed(int id) { incoming_project inProject = db.incoming_project.Find(id); db.incoming_project.Remove(inProject); db.SaveChanges(); return(RedirectToAction("TemporaryProjectQueue")); }
public ActionResult TempProjectDetails(int?id) { if (id == null) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); } incoming_project incoming_project = db.incoming_project.Find(id); if (id == null) { return(HttpNotFound()); } return(View(incoming_project)); }