示例#1
0
        /// <summary>
        /// Method to create argument fault.
        /// </summary>
        /// <param name="message">Fault message.</param>
        /// <param name="paramName">Parameter that caused the fault.</param>
        /// <returns>Argument fault.</returns>
        internal static ArgumentFault CreateArgumentFault(string message, string paramName)
        {
            Debug.Assert(!String.IsNullOrEmpty(message), "Provide a valid message string");
            Debug.Assert(!String.IsNullOrEmpty(paramName), "Provide a valid param name");

            ArgumentFault argFault = new ArgumentFault();

            argFault.Message   = message;
            argFault.ParamName = paramName;
            argFault.Source    = FaultSource.Client;

            return(argFault);
        }
示例#2
0
        public void UpdateUser(UserDto user)
        {
            if (user == null)
            {
                var fault = new ArgumentFault
                {
                    Message      = "Argumnet is null",
                    ArgumentName = nameof(user)
                };

                throw new FaultException <ArgumentFault>(fault);
            }

            ApplicationUser userEntity = Mapper.Map <ApplicationUser>(user);

            _userBusinessLogic.UpdateUser(userEntity);
        }
示例#3
0
        public void UpdateProgram(RobotProgramDto program)
        {
            if (program == null)
            {
                var fault = new ArgumentFault
                {
                    Message      = "Argumnet is null",
                    ArgumentName = nameof(program)
                };

                throw new FaultException <ArgumentFault>(fault);
            }

            RobotProgram programEntity = Mapper.Map <RobotProgram>(program);

            _robotProgramBusinessLogic.UpdateProgram(programEntity);
        }
示例#4
0
        public void UpdateStep(ProgramStepDto step)
        {
            if (step == null)
            {
                var fault = new ArgumentFault
                {
                    Message      = "Argumnet is null",
                    ArgumentName = nameof(step)
                };

                throw new FaultException <ArgumentFault>(fault);
            }

            ProgramStep stepEntity = Mapper.Map <ProgramStep>(step);

            _robotProgramBusinessLogic.UpdateStep(stepEntity);
        }
示例#5
0
        public void CreateRole(RoleDto role)
        {
            // TODO: Move that validation to business logic layer ?
            if (role == null)
            {
                var fault = new ArgumentFault
                {
                    Message      = "Argumnet is null",
                    ArgumentName = nameof(role)
                };

                throw new FaultException <ArgumentFault>(fault);
            }

            IdentityRole userEntity = Mapper.Map <IdentityRole>(role);

            _rolesBusinessLogic.CreateRole(userEntity);
        }
示例#6
0
        public void UpdateJointPoint(JointPointDto point)
        {
            // TODO: null-possibility should rather be checked in Buisness logic, and here just try-catch-toFaultConv
            if (point == null)
            {
                var fault = new ArgumentFault
                {
                    Message      = "Argumnet is null",
                    ArgumentName = nameof(point)
                };

                throw new FaultException <ArgumentFault>(fault);
            }

            JointPoint pointEntity = Mapper.Map <JointPoint>(point);

            _robotProgramBusinessLogic.UpdateJointPoint(pointEntity);
        }
示例#7
0
        public void AddStep(ProgramStepDto step)
        {
            // TODO: null-possibility should rather be checked in Buisness logic, and here just try-catch-toFaultConv
            if (step == null)
            {
                var fault = new ArgumentFault
                {
                    Message      = "Argumnet is null",
                    ArgumentName = nameof(step)
                };

                throw new FaultException <ArgumentFault>(fault);
            }

            ProgramStep stepEntity = Mapper.Map <ProgramStep>(step);

            _robotProgramBusinessLogic.AddStep(stepEntity);
        }