public ActionResult SaveComment(pj_manager_request req) { var loggedUser = (User)Session["LoggedUser"]; req.project_manager_id = loggedUser.Id; using (PMEntities context = new PMEntities()) { context.pj_manager_request.Add(req); context.SaveChanges(); } return(RedirectToAction("PmDashboard", "Home")); }
public ActionResult AssignUser(pj_manager_request request) { using (PMEntities context = new PMEntities()) { if (context.projects.Any(p => p.Id == request.project_id)) { project pj = context.projects.Find(request.project_id); pj.project_manager_id = request.project_manager_id; pj.status = 5; context.SaveChanges(); return(Json(new { status = "200", data = request, displaySweetAlert = true, message = "Project Assigned Successfully" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { status = "404", data = "", message = "project not found", displaySweetAlert = false }, JsonRequestBehavior.AllowGet)); } } }