public void BizAction(long inputData)
        {
            var item = _updatedbAccess.GetFormDictionary(inputData);

            if (item == null)
            {
                AddError("Could not find the Form Document. Someone entering illegal ids?");
            }

            _dbAccess.Delete(item);

            Message = $"Form Document is Delete: {item.ToString()}.";
        }
Example #2
0
        public void BizAction(FormDictionaryDto inputData)
        {
            var formDictioanry = _dbAccess.GetFormDictionary(inputData.Id);

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

            var status = formDictioanry.UpdateFormDictioanry(inputData.Type
                                                             , inputData.Description, inputData.Code, inputData.ActivityName
                                                             , inputData.WorkPackageId, inputData.Priority, inputData.FileName, inputData.Mh);

            CombineErrors(status);

            Message = $"formDictioanry is update: {formDictioanry.ToString()}.";
        }
Example #3
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()}.";
        }
        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);
        }