public JsonResult IsStageUsed(int?StageId) { Response res = new SWI.AirView.Models.Response(); res.Message = "There is an error"; res.Status = "error"; if (StageId == null || StageId < 1) { res.Status = "UnwantedStage"; res.Message = "Stage deleted succesfully!"; return(Json(res)); } PM_TaskStagesBL pM_TaskStagesBL = new PM_TaskStagesBL(); var val = pM_TaskStagesBL.Single("IsStageUsed", StageId.Value); if (val >= 1) { res.Status = "used"; res.Message = "This stage is used in some site tasks."; } else { res.Status = "free"; res.Message = "Stage deleted succesfully!"; } return(Json(res)); }
public JsonResult AddTaskStages(long ProjectId, long TaskId, string Stages) { Response res = new SWI.AirView.Models.Response(); PM_TaskStagesBL pM_TaskStagesBL = new PM_TaskStagesBL(); List <PM_TaskStages> TaskStage = new JavaScriptSerializer().Deserialize <List <PM_TaskStages> >(Stages); var List = pM_TaskStagesBL.UpdateOrAdd("UpdateOrAddForTaskWorkFlow", ProjectId, TaskId, TaskStage); res.Message = "Workflow saved successfully!"; res.Status = "Ok"; return(Json(res)); }