Ejemplo n.º 1
0
        public List <InfoDTO> InfoList(int Id)
        {
            List <InfoDTO>  InfoList       = new List <InfoDTO>();
            IInfoRepository infoRepository = new InfoRepositorySqlServer();

            return(infoRepository.Infos(Id));
        }
Ejemplo n.º 2
0
        public List <InfoDTO> InfoList()
        {
            List <InfoDTO>  InfoList       = new List <InfoDTO>();
            IInfoRepository infoRepository = new InfoRepositorySqlServer();

            return(infoRepository.InfoJournal());
        }
Ejemplo n.º 3
0
        public Info(int Id)
        {
            List <InfoDTO>  InfoList       = new List <InfoDTO>();
            IInfoRepository infoRepository = new InfoRepositorySqlServer();

            InfoList = infoRepository.Infos(Id);

            InfoDTO i = InfoList[0];

            this.Name  = i.Name;
            this.Key   = i.Key;
            this.Value = i.Value;
            this.Url   = i.Url;
            this.iDate = i.iDate;
            this.Id    = Id;
        }
Ejemplo n.º 4
0
        // public List<MyInfo.DTO.InfoDTO> InfoList { get; set; }

        /// <summary>
        /// Persist the new task in the repository
        /// </summary>
        public int Save()
        {
            // create new object and send to the repository
            InfoDTO td = new InfoDTO();

            td.Name  = this.Name;
            td.Key   = this.Key;
            td.Value = this.Value;
            IInfoRepository infoRepository = new InfoRepositorySqlServer();


            if (this.Id == 0)
            {
                // add the item in the repository and return the provided generated information id
                return(infoRepository.Add(td));
            }
            else
            {
                // Id exist: update existing item
                td.Id = this.Id;
                infoRepository.Update(td);
                return(0);
            }
        }
Ejemplo n.º 5
0
        public void Delete()
        {
            IInfoRepository infoRepository = new InfoRepositorySqlServer();

            infoRepository.Delete(this.Id);
        }