コード例 #1
0
 //переделать
 public void Update(Empl empl)
 {
     using (IDbConnection db = new SqlConnection(connectionString))
     {
         var sqlQuery = "UPDATE Empl SET FirstName = @FirstName, LastName = @LastName, Title = @Title, BirthDate = @BirthDate, City = @City WHERE Id = @Id";
         db.Execute(sqlQuery, empl);
     }
 }
コード例 #2
0
 //переделать
 public void Create(Empl user)
 {
     using (IDbConnection db = new SqlConnection(connectionString))
     {
         var sqlQuery = "INSERT INTO [dbo].[Empl] (FirstName ,LastName ,Title ,BirthDate ,City) VALUES (@FirstName, @LastName, @Title, @BirthDate, @City)";
         db.Execute(sqlQuery, user);
     }
 }