public JsonResult AssignUnassignReport(AssignReportsViewModel model) { using (ProjectDB projectDB = new ProjectDB()) { OperationDetails operationDetails = projectDB.AssignUnassignReport(model.Pfid, model.ReportId, CurrentUser.Pfid); if (operationDetails.OperationStatus == 1) { return(Json(new { success = true, message = operationDetails.OperationMessage }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = false, message = "Something went wrong!!" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult AssignReports(int projectId, int pfid) { ProjectMappingModel projectMapping; bool isAssigned = new ProjectBL().IsProjectAssignedToUser(projectId, CurrentUser.Pfid, out projectMapping); if (!isAssigned) { TempData["ErrorMessage"] = "Project not found"; return(RedirectToAction("Dashboard", "Project")); } AssignReportsViewModel model = new AssignReportsViewModel { Pfid = pfid, ProjectDetails = GetProjectDetailsViewModel(projectMapping) }; return(View(model)); }