예제 #1
0
 public void Create(CreateBlockCommand command)
 {
     _db.Connection().Execute(
         "spCreateBlock",
         new
     {
         id          = command.Id,
         description = command.Description,
         idCollege   = command.IdCollege
     },
         commandType: CommandType.StoredProcedure
         );
 }
예제 #2
0
 public void Create(CreateClassRoomCommand command)
 {
     _db.Connection().Execute(
         "spCreateClassRoom",
         new
     {
         id          = command.Id,
         description = command.Description,
         status      = command.Status,
         type        = command.Type,
         idBlock     = command.IdBlock
     },
         commandType: CommandType.StoredProcedure
         );
 }
예제 #3
0
        public bool Create(Category category)
        {
            int affectedRows = _db.Connection().Execute(
                "insert into [Category] (Id, Title, Description, CreatedAt, UpdatedAt) values(@id, @title, @description, @createdAt, @updatedAt)",
                new
            {
                id          = category.Id,
                title       = category.Title,
                description = category.Description,
                createdAt   = category.CreatedAt,
                updatedAt   = category.UpdatedAt
            }
                );

            return(affectedRows > 0);
        }
예제 #4
0
        public bool Create(Gender gender)
        {
            int affectedRows = _db.Connection().Execute(
                "insert into [Gender] (Id, Title, Description, CreatedAt, UpdatedAt) values(@id, @title, " +
                "@description, @createdAt, @updatedAt)",
                new
            {
                id          = gender.Id,
                title       = gender.Title,
                description = gender.Description,
                createdAt   = gender.CreatedAt,
                updatedAt   = gender.UpdatedAt
            }
                );

            return(affectedRows > 0);
        }
예제 #5
0
 public void Create(CreateProfessorCommand Command)
 {
     _db.Connection().Execute(
         "spCreateProfessor",
         new
     {
         id        = Command.Id,
         firstName = Command.FirstName,
         lastName  = Command.LastName,
         document  = Command.Document,
         email     = Command.Email,
         phone     = Command.Phone,
         status    = Command.Status,
         idCourse  = Command.IdCourse
     },
         commandType: CommandType.StoredProcedure
         );
 }
예제 #6
0
        public bool Create(Album album)
        {
            int affectedRows = _db.Connection().Execute(
                "insert into [Album](Id, Title, GenderId, CategoryId, Image, CreatedAt, UpdatedAt)" +
                "values(@id, @title, @genderId, @categoryId, @image, @createdAt, @updatedAt)",
                new
            {
                id         = album.Id,
                title      = album.Title,
                genderId   = album.Gender.Id,
                categoryId = album.Category.Id,
                image      = album.Image,
                createdAt  = album.CreatedAt,
                updatedAt  = album.UpdatedAt
            }
                );

            return(affectedRows > 0);
        }
예제 #7
0
        public bool Create(Singer singer)
        {
            int affectedRows = _db.Connection().Execute(
                "insert into [Singer](Id, FirstName, LastName, Nationality, About, Image, CreatedAt, UpdatedAt) " +
                "values(@id, @firstName, @lastName, @nationality, @about, @image, @createdAt, @updatedAt)",
                new
            {
                id          = singer.Id,
                firstName   = singer.Name.FirstName,
                lastName    = singer.Name.LastName,
                nationality = singer.Nationality,
                about       = singer.About,
                image       = singer.Image,
                createdAt   = singer.CreatedAt,
                updatedAt   = singer.UpdatedAt
            }
                );

            return(affectedRows > 0);
        }
 public void Book(Guid id)
 {
     _db.Connection().Execute(
         "spBookHeritage",
         new
     {
         id = id
     },
         commandType: CommandType.StoredProcedure
         );
 }
예제 #9
0
 public void Book(Equipment equipment)
 {
     _db.Connection().Execute(
         "spBookEquipment",
         new
     {
         id     = equipment.Id,
         status = equipment.Status
     },
         commandType: CommandType.StoredProcedure
         );
 }
예제 #10
0
        public bool ChangeStatus(Guid id, int status)
        {
            int affectedRows = _db.Connection().Execute(
                "update [User] set Status = @status where Id = @id",
                new
            {
                id     = id,
                status = status
            }
                );

            return(affectedRows > 0);
        }
예제 #11
0
 public void Create(User user)
 {
     _db.Connection().Execute(
         "spCreateUser",
         new
     {
         id        = user.Id,
         firstName = user.Name.FirstName,
         lastName  = user.Name.LastName,
         document  = user.Document.Number,
         email     = user.Email.Address,
         password  = user.Password.Value,
         phone     = user.Phone,
         status    = user.Status,
         image     = user.Image
     },
         commandType: CommandType.StoredProcedure
         );
 }
예제 #12
0
 public void Create(Project project)
 {
     _db.Connection().Execute(
         "spCreateProject",
         new
     {
         id          = project.Id,
         title       = project.Title,
         description = project.Description,
         createdAt   = project.CreatedAt,
         updatedAt   = project.UpdatedAt,
         ownerId     = project.Owner.Id,
         status      = project.Status
     },
         commandType: CommandType.StoredProcedure
         );
 }
예제 #13
0
        public bool Create(Song song)
        {
            int affectedRows = _db.Connection().Execute(
                "insert into [Song](Id, Title, SingerId, AlbumId, Url, DownloadCounter, PublishedDate, CreatedAt, UpdatedAt) " +
                "values(@id, @title, @singerId, @albumId, @url, @downloadCounter, @publishedDate, @createdAt, @updatedAt)",
                new
            {
                id              = song.Id,
                title           = song.Title,
                singerId        = song.Singer.Id,
                albumId         = song.Album.Id,
                url             = song.Url,
                downloadCounter = song.DownloadCounter,
                publishedDate   = song.PublishedDate,
                createdAt       = song.CreatedAt,
                updatedAt       = song.UpdatedAt
            }
                );

            return(affectedRows > 0);
        }
예제 #14
0
        public void Create(College college)
        {
            _db.Connection().Execute(
                "spCreateCollege",
                new
            {
                id        = college.Id,
                firstName = college.Name.FirstName,
                lastName  = college.Name.LastName,
                document  = college.Document.Number,
                email     = college.Email.Address,
                phone     = college.Phone,
                image     = college.Image
            },
                commandType: CommandType.StoredProcedure
                );

            foreach (var address in college.Addresses)
            {
                _db.Connection().Execute(
                    "spCreateAddress",
                    new
                {
                    id       = address.Id,
                    street   = address.Street,
                    number   = address.Number,
                    district = address.District,
                    city     = address.City,
                    state    = address.State,
                    zipCode  = address.ZipCode,
                    country  = address.Country,
                    idOwner  = college.Id
                },
                    commandType: CommandType.StoredProcedure
                    );
            }
        }