Esempio n. 1
0
        public void BizAction(ActivityDocumentDto inputData)
        {
            var activity = _dbAccess.GetActivity(inputData.ActivityId);

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


            if (inputData.PunchId.HasValue)
            {
                var punch = _punchDbAccess.GetPunch(inputData.PunchId.Value);
                if (punch == null)
                {
                    AddError("Could not find the punch. Someone entering illegal ids?");
                    return;
                }
            }

            var status = activity.CreateActivityDocument(inputData.Description, inputData.FilePath,
                                                         inputData.ActivityId, inputData.PunchId);

            CombineErrors(status);

            Message = $"Activity Document is Added: {activity.ToString()}.";
        }
Esempio n. 2
0
        public void BizAction(ActivityStatusUpdateDto inputData)
        {
            var activity = _dbAccess.GetActivity(inputData.Id);

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


            var status = activity.UpdateActivityStatus(inputData.Status, inputData.HoldBy,
                                                       inputData.Condition);

            CombineErrors(status);

            Message = $"activity status is update: {activity.ToString()}.";
        }
Esempio n. 3
0
        public void BizAction(long inputData)
        {
            var item = _updateDbAccess.GetActivity(inputData);

            if (item == null)
            {
                throw new NullReferenceException("Could not find the activity. Someone entering illegal ids?");
            }

            if (item.Status != ActivityStatus.NotStarted)
            {
                throw new NullReferenceException("Activity not allowed for delete!!!");
            }

            _dbAccess.Delete(item);

            Message = $"Activity is Delete: {item.ToString()}.";
        }
Esempio n. 4
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()}.";
        }