public ActionResult CreateOtherProject(OtherProjects otherProject) { if (otherProject.Other_requestor_id != null) { //Changes the lab project null to 2=Laboratory otherProject.Other_projectType = 5; try { if (!ModelState.IsValid) { return(View()); } var otherProjectToAdd = Mapper.Map <DATA.OtherProjects>(otherProject); oProjec.AddOtherProject(otherProjectToAdd); return(RedirectToAction("CreateOtherProject")); } catch (Exception ex) { throw ex; } } else { return(View()); } }
public ActionResult EditOtherProject(OtherProjects other) { try { if (!ModelState.IsValid) { return(View()); } var updateOtherProject = Mapper.Map <DATA.OtherProjects>(other); oProjec.UpdateOtherProject(updateOtherProject); int x = (Int32)Session["UserType"]; switch (x) { case 1: return(RedirectToAction("PmProjects", "User")); case 2: return(RedirectToAction("UserMyProjects", "User")); case 3: return(RedirectToAction("Index", "OtherProjects")); case 4: return(RedirectToAction("Index", "OtherProjects")); default: return(RedirectToAction("Index", "Home")); } } catch { return(View()); } }
public void DeleteOtherProject(OtherProjects otherProject) { try { unitOfWork.Repository <OtherProjects>().Delete(otherProject); } catch (Exception ex) { throw ex; } }
public ActionResult EditOtherProject(OtherProjects other) { try { if (!ModelState.IsValid) { return(View()); } var updateOtherProject = Mapper.Map <DATA.OtherProjects>(other); oProjec.UpdateOtherProject(updateOtherProject); return(RedirectToAction("Index", "Home")); } catch { return(View()); } }
public ActionResult CreateOtherProject(OtherProjects otherProject) { if (otherProject.Other_requestor_id != null) { //Changes the lab project null to 2=Laboratory otherProject.Other_projectType = 5; try { if (!ModelState.IsValid) { return(View()); } var otherProjectToAdd = Mapper.Map <DATA.OtherProjects>(otherProject); oProjec.AddOtherProject(otherProjectToAdd); int x = (Int32)Session["UserType"]; switch (x) { case 1: return(RedirectToAction("PmProjects", "User")); case 2: return(RedirectToAction("UserMyProjects", "User")); case 3: return(RedirectToAction("Index", "OtherProjects")); case 4: return(RedirectToAction("Index", "OtherProjects")); default: return(RedirectToAction("Index", "Home")); } } catch (Exception ex) { throw ex; } } else { return(View()); } }
public void UpdateOtherProject(OtherProjects otherProject) { _db.Update(otherProject); }
public void AddOtherProject(OtherProjects otherProject) { _db.Insert(otherProject); }