Exemplo n.º 1
0
        public BLEntidad(IUnityContainer container)
        {
            this.ContainerService = container;
            Loader = new BusinessEntityLoader <Entidad>();
            Entidad item = new Entidad();

            Loader.EntityType = item.GetType();
        }
Exemplo n.º 2
0
        private ObservableCollection <Prospecto> SelectAllByEjecutivoGestionVentas(Int16 EMPR_Codigo, Int16 SUCR_Codigo, Int32 ENTC_CodEjecutivo, Nullable <Int32> ENTC_CodAgenteCarga, Nullable <DateTime> GEST_FechaProximaGestion)
        {
            try
            {
                BusinessEntityLoader <Entidad> LoaderContacto = new BusinessEntityLoader <Entidad>();
                Entidad contacto = new Entidad();
                LoaderContacto.EntityType = contacto.GetType();

                ObservableCollection <Prospecto> items = new ObservableCollection <Prospecto>();
                Prospecto item = new Prospecto();
                DataAccessEnterpriseSQL.DAAsignarProcedure("TCOM_SP_CONSULTAR_Prospecto_GestionVentas");
                DataAccessEnterpriseSQL.DAAgregarParametro("@psinEMPR_Codigo", EMPR_Codigo, SqlDbType.SmallInt, 2, ParameterDirection.Input);
                DataAccessEnterpriseSQL.DAAgregarParametro("@psinSUCR_Codigo", SUCR_Codigo, SqlDbType.SmallInt, 2, ParameterDirection.Input);
                DataAccessEnterpriseSQL.DAAgregarParametro("@pintENTC_CodEjecutivo", ENTC_CodEjecutivo, SqlDbType.Int, 4, ParameterDirection.Input);
                DataAccessEnterpriseSQL.DAAgregarParametro("@pintENTC_CodAgenteCarga", ENTC_CodAgenteCarga, SqlDbType.Int, 4, ParameterDirection.Input);
                DataAccessEnterpriseSQL.DAAgregarParametro("@pdtmGEST_FechaProximaGestion", GEST_FechaProximaGestion, SqlDbType.DateTime, 8, ParameterDirection.Input);

                using (IDataReader reader = DataAccessEnterpriseSQL.DAExecuteReader())
                {
                    while (reader.Read())
                    {
                        item = new Prospecto();

                        Loader.LoadEntity(reader, item);

                        if (item.ENTC_CodContacto.HasValue)
                        {
                            item.ItemContacto = new Entidad();
                            LoaderContacto.LoadEntity(reader, item.ItemContacto);
                        }

                        item.Instance = InstanceEntity.Added;
                        items.Add(item);
                    }
                }
                return(items);
            }
            catch (Exception ex)
            { throw ex; }
        }