コード例 #1
0
        public void BizAction(ProjectSystemDto inputData)
        {
            var pSystem = _dbAccess.GetSystme(inputData.Id);

            if (pSystem == null)
            {
                AddError("Could not find the system. Someone entering illegal ids?");
                return;
            }


            var status = pSystem.UpdateProjectSystem(inputData.Code, inputData.Description);

            CombineErrors(status);

            Message = $"system is update: {pSystem.ToString()}.";
        }
コード例 #2
0
        public void BizAction(ActivityDto inputData)
        {
            var workPackage = _workPackageDbAccess.GetRoadMap(inputData.WorkPackageId);

            if (workPackage == null)
            {
                AddError("WorkPackage is Not Valid.");
            }

            var location = _locationDbAccess.GetLocationType(inputData.LocationId);

            if (location == null)
            {
                AddError("Location is Not Valid.");
            }

            var descipline = _desciplineDbAccess.GetDescipline(inputData.DesciplineId);

            if (descipline == null)
            {
                AddError("Descipline is Not Valid.");
            }

            var form = _formDicDbAccess.GetFormDictionary(inputData.FormDictionaryId);

            if (form == null)
            {
                AddError("Form is Not Valid.");
            }

            var system = _systemDbAccess.GetSystme(inputData.SystemdId);

            if (system == null)
            {
                AddError("System is Not Valid.");
            }

            var subSystem = _subSystemDbAccess.GetSubSystme(inputData.SubsytemId);

            if (subSystem == null)
            {
                AddError("Subsystem is Not Valid.");
            }
            var workStep = _workStepDbAccess.GetWorkPackageStep(inputData.WorkPackageStepId);

            if (workStep == null)
            {
                AddError("WorkPackage Step is Not Valid.");
            }

            var activity = _dbAccess.GetActivity(inputData.Id);

            if (activity == null)
            {
                AddError("Could not find the Activity. Someone entering illegal ids?");
                return;
            }

            var status = activity.UpdateActivity(inputData.TagNumber, inputData.TagDescription
                                                 , inputData.ValueUnitNum, inputData.EstimateMh, inputData.ActualMh, inputData.ActualStartDate,
                                                 inputData.ActualEndDate, inputData.Condition, inputData.Status);

            CombineErrors(status);

            Message = $"activity is update: {activity.ToString()}.";
        }
コード例 #3
0
        public Activity BizAction(ActivityDto inputData)
        {
            var workPackage = _workPackageDbAccess.GetRoadMap(inputData.WorkPackageId);

            if (workPackage == null)
            {
                AddError("WorkPackage is Not Valid.");
            }

            var location = _locationDbAccess.GetLocationType(inputData.LocationId);

            if (location == null)
            {
                AddError("Location is Not Valid.");
            }

            var descipline = _desciplineDbAccess.GetDescipline(inputData.DesciplineId);

            if (descipline == null)
            {
                AddError("Descipline is Not Valid.");
            }

            var form = _formDicDbAccess.GetFormDictionary(inputData.FormDictionaryId);

            if (form == null)
            {
                AddError("Form is Not Valid.");
            }

            var system = _systemDbAccess.GetSystme(inputData.SystemdId);

            if (system == null)
            {
                AddError("System is Not Valid.");
            }

            var subSystem = _subSystemDbAccess.GetSubSystme(inputData.SubsytemId);

            if (subSystem == null)
            {
                AddError("Subsystem is Not Valid.");
            }
            var workStep = _workStepDbAccess.GetWorkPackageStep(inputData.WorkPackageStepId);

            if (workStep == null)
            {
                AddError("WorkPackage Step is Not Valid.");
            }

            if (inputData.WeightFactor < 0)
            {
                AddError("WeightFactor is Not Valid.");
            }

            if (string.IsNullOrWhiteSpace(inputData.TagNumber))
            {
                AddError("TagNumber is Not Valid.");
            }

            var desStatus = Activity.CreateActivity(inputData.TagNumber, inputData.TagDescription, inputData.Progress,
                                                    inputData.WeightFactor, inputData.ValueUnitNum, inputData.EstimateMh, inputData.ActualMh, inputData.Status, inputData.ActualStartDate, inputData.ActualEndDate
                                                    , inputData.PlanStartDate, inputData.PlanEndDate, inputData.FormDictionaryId, inputData.ValueUnitId
                                                    , inputData.WorkPackageId, inputData.LocationId, inputData.SubsytemId,
                                                    inputData.Condition, inputData.ActivityCode, inputData.DesciplineId, inputData.WorkPackageStepId);

            CombineErrors(desStatus);

            if (!HasErrors)
            {
                _dbAccess.Add(desStatus.Result);
            }

            return(HasErrors ? null : desStatus.Result);
        }