/// <summary>
        /// New commission agent
        /// </summary>
        /// <returns>Returns the commission agent.</returns>
        public ICommissionAgent GetNewCommissionAgentDo(string id)
        {
            CommissionAgentFactory factory = CommissionAgentFactory.GetFactory(_sqlExecutor);
            ICommissionAgent       agent   = factory.NewCommissionAgent(id);

            return(agent);
        }
        /// <summary>
        /// Gives us a commission agent collection list
        /// </summary>
        /// <param name="fields">Fields to be present in the query</param>
        /// <param name="pageSize">Page dimension</param>
        /// <param name="startAt">Initialization of the object</param>
        /// <returns>Return the list commission agents.</returns>
        public async Task <IList <ICommissionAgent> > GetCommissionAgentCollection(IDictionary <string, string> fields, int pageSize = 0, int startAt = 0)
        {
            logger.Debug("GetCommissionAgentCollection ");
            CommissionAgentFactory   commissionAgentFactory = CommissionAgentFactory.GetFactory(_sqlExecutor);
            IList <ICommissionAgent> commissionAgents       = await commissionAgentFactory.CreateCommissionAgentList(fields, pageSize, startAt);

            return(commissionAgents);
        }
        /// <summary>
        /// New commission agent
        /// </summary>
        /// <returns>Returns the commission agent.</returns>
        public ICommissionAgent GetNewCommissionAgentDo()
        {
            CommissionAgentFactory factory = CommissionAgentFactory.GetFactory(_sqlExecutor);
            string id = GetNewId();

            logger.Debug("GetCommissionAgent " + id);
            ICommissionAgent agent = factory.NewCommissionAgent(id);

            return(agent);
        }
Пример #4
0
        /// <summary>
        /// New commission agent
        /// </summary>
        /// <returns>Returns the commission agent.</returns>
        public ICommissionAgent GetNewDo()
        {
            var factory = CommissionAgentFactory.GetFactory(_sqlExecutor);
            var id      = NewId();

            logger.Debug("GetCommissionAgent " + id);
            var agent = factory.NewCommissionAgent(id);

            return(agent);
        }
Пример #5
0
        /// <summary>
        ///  This returns to us a commission agent object.
        /// </summary>
        /// <param name="queryDictionary">Dictionary of fields to be included in the query.</param>
        /// <param name="commissionAgentId">Agent id to be fetched</param>
        /// <returns>The commission agent list.</returns>
        public async Task <ICommissionAgent> GetCommissionAgentDo(string commissionAgentId, IDictionary <string, string> queryDictionary = null)
        {
            IDictionary <string, string> queries;

            logger.Debug("GetCommissionAgentData Object");
            queries = queryDictionary ?? base.BaseQueryDictionary;
            var agentFactory = CommissionAgentFactory.GetFactory(_sqlExecutor);
            var createdAgent = await agentFactory.GetCommissionAgent(queries, commissionAgentId);

            return(createdAgent);
        }
Пример #6
0
        public async Task Should_Load_Commission_Agent_ByFactory()
        {
            IDictionary <string, string> fields = new Dictionary <string, string>();
            string numComi = "0000002";

            fields.Add(CommissionAgent.Comisio, "COMISIO, NUM_COMI, PERSONA, NIF, TIPOCOMI, " +
                       "VENDE_COMI, MERCADO, NEGOCIO, CANAL, CLAVEPPTO, " +
                       "ORIGEN_COMI, ZONAOFI, direccion, cp, poblacion, " +
                       "provincia, nacioper, telefono, fax, " +
                       "Movil, alta_comi, baja_comi, idioma, IATA, IVASINO, " +
                       "RETENSINO, NACIONAL, CONCEPTOS_COND, AGENCIA, TRADUCE_WS, " +
                       "TRUCK_RENTAL_BROKER, COMBUS_PREPAGO_COMI, NO_GENERAR_AUTOFAC, " +
                       "TODOS_EXTRAS, NO_GESTIONAR_CUPO, AUTO_ONEWAY, COT_INCLUIDOS_SIN_GRUPO, " +
                       "ACCESO_PREMIUM, NO_MAIL_RES, AUTOFAC_SIN_IVA, " +
                       "COMISION_SIN_IVA_COM");
            CommissionAgentFactory agentFactory = CommissionAgentFactory.GetFactory(_sqlExecutor);

            Assert.NotNull(agentFactory);
            ICommissionAgent createdAgent = await agentFactory.GetCommissionAgent(fields, numComi);

            Assert.NotNull(createdAgent);
        }