/// <summary>
        /// Updates record for the dbo.Paciente table.
        /// SQL+ Routine: dbo.PacienteUpdate - Authored by IStrficek
        /// </summary>
        public PacienteUpdateOutput PacienteUpdate(IPacienteUpdateInput input)
        {
            if (!input.IsValid())
            {
                throw new ArgumentException("PacienteUpdateInput fails validation - use the PacienteUpdateInput.IsValid() method prior to passing the input argument to the PacienteUpdate method.", "input");
            }

            PacienteUpdateOutput output = new PacienteUpdateOutput();

            if (sqlConnection != null)
            {
                using (SqlCommand cmd = GetPacienteUpdateCommand(sqlConnection, input))
                {
                    cmd.Transaction = sqlTransaction;
                    PacienteUpdateCommand(cmd, output);
                }
                return(output);
            }
            for (int idx = 0; idx <= retryOptions.RetryIntervals.Count; idx++)
            {
                if (idx > 0)
                {
                    System.Threading.Thread.Sleep(retryOptions.RetryIntervals[idx - 1]);
                }
                try
                {
                    using (SqlConnection cnn = new SqlConnection(connectionString))
                        using (SqlCommand cmd = GetPacienteUpdateCommand(cnn, input))
                        {
                            cnn.Open();
                            PacienteUpdateCommand(cmd, output);
                            cnn.Close();
                        }
                    break;
                }
                catch (SqlException sqlException)
                {
                    bool throwException = true;

                    if (retryOptions.TransientErrorNumbers.Contains(sqlException.Number))
                    {
                        throwException = (idx == retryOptions.RetryIntervals.Count);

                        if (retryOptions.Logger != null)
                        {
                            retryOptions.Logger.Log(sqlException);
                        }
                    }
                    if (throwException)
                    {
                        throw;
                    }
                }
            }
            return(output);
        }
        /// <summary>
        /// Builds the command object for PacienteUpdate method.
        /// </summary>
        /// <param name="cnn">The connection that will execute the procedure.</param>
        /// <param name="input">PacienteUpdateInput instance for loading parameter values.</param>
        /// <returns>SqlCommand ready for execution.</returns>
        private SqlCommand GetPacienteUpdateCommand(SqlConnection cnn, IPacienteUpdateInput input)
        {
            SqlCommand result = new SqlCommand()
            {
                CommandType = CommandType.StoredProcedure,
                CommandText = "dbo.PacienteUpdate",
                Connection  = cnn
            };

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IdPaciente",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.Int,
                Scale         = 0,
                Precision     = 10,
                Value         = input.IdPaciente
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@DNI",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.VarChar,
                Size          = 50,
                Value         = (object)input.DNI ?? DBNull.Value
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Nombre",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.VarChar,
                Size          = 50,
                Value         = (object)input.Nombre ?? DBNull.Value
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Apellido",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.VarChar,
                Size          = 50,
                Value         = (object)input.Apellido ?? DBNull.Value
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Telefono",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.VarChar,
                Size          = 50,
                Value         = (object)input.Telefono ?? DBNull.Value
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@FechaNacimiento",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.Date,
                Precision     = 0,
                Value         = (object)input.FechaNacimiento ?? DBNull.Value
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Domicilio",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.VarChar,
                Size          = 200,
                Value         = (object)input.Domicilio ?? DBNull.Value
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Sexo",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.Char,
                Size          = 1,
                Value         = (object)input.Sexo ?? DBNull.Value
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Localidad",
                Direction     = ParameterDirection.Input,
                SqlDbType     = SqlDbType.VarChar,
                Size          = 50,
                Value         = (object)input.Localidad ?? DBNull.Value
            });

            result.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ReturnValue",
                Direction     = ParameterDirection.ReturnValue,
                SqlDbType     = SqlDbType.Int,
                Scale         = 0,
                Precision     = 10,
                Value         = DBNull.Value
            });

            return(result);
        }