public void CreateProspect(PersonId person, AccomodationId accomodation)
        {
            var personEntity       = Database.Persons.Single(p => p.Id == person.SurrogateId.ValueOrFailure());
            var accomodationEntity = Database.Accomodations.Single(p => p.Number == accomodation.Number);
            var prospect           = new ProspectEntity
            {
                Person       = personEntity,
                Accomodation = accomodationEntity
            };

            Database.Prospects.Add(prospect);
        }
Ejemplo n.º 2
0
        public static IProspect GetProspect(int prospectId, char isActiveOnly)
        {
            string    strExecution = "[common].[uspGetProspect]";
            IProspect prospect     = null;

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddIntegerParam("@ProspectId", prospectId);
                oDq.AddCharParam("@IsActiveOnly", 1, isActiveOnly);
                DataTableReader reader = oDq.GetTableReader();

                while (reader.Read())
                {
                    prospect = new ProspectEntity(reader);
                }

                reader.Close();
            }

            return(prospect);
        }
Ejemplo n.º 3
0
        public static List <IProspect> GetProspect(char isActiveOnly)
        {
            string           strExecution = "[common].[uspGetProspect]";
            List <IProspect> lstProspect  = new List <IProspect>();

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddCharParam("@IsActiveOnly", 1, isActiveOnly);
                DataTableReader reader = oDq.GetTableReader();

                while (reader.Read())
                {
                    IProspect prospect = new ProspectEntity(reader);
                    lstProspect.Add(prospect);
                }

                reader.Close();
            }

            return(lstProspect);
        }