public int AddProjectPhase(ProjectPhaseModel phaseModel, int projectId)
        {
            ProjectDataAccess obj = new ProjectDataAccess();
            var result            = obj.AddProjectPhase(phaseModel, projectId);

            foreach (ProjectTaskModel taskModel in phaseModel.ProjectTasks)
            {
                AddProjectTask(taskModel, result);
            }
            return(result);
        }
        public int UpdateProjectPhase(ProjectPhaseModel phaseModel, int projectId)
        {
            ProjectDataAccess obj = new ProjectDataAccess();
            var result            = 0;

            if (phaseModel.PhaseId > 0)
            {
                result = phaseModel.PhaseId;
                obj.UpdateProjectPhase(phaseModel);
            }
            else
            {
                result = obj.AddProjectPhase(phaseModel, projectId);
            }

            foreach (ProjectTaskModel taskModel in phaseModel.ProjectTasks)
            {
                UpdateProjectTask(taskModel, result);
            }
            return(result);
        }