コード例 #1
0
 public void CreatePermission(Permission permission)
 {
     using (SqlConnection connection = base.GetConnection())
     {
         SqlCommand command = new SqlCommand("_PermissionUpdate", connection) {
             CommandType = CommandType.StoredProcedure
         };
         command.Parameters.AddWithValue("@Type", 0);
         command.Parameters.AddWithValue("@PermissionID", 0);
         command.Parameters.AddWithValue("@PermissionName", permission.PermissionName);
         command.Parameters.AddWithValue("@Description", permission.Description);
         command.Parameters.AddWithValue("@Value", permission.Value);
         connection.Open();
         if (command.ExecuteNonQuery() <= 0)
         {
             throw new DataAccessException("Khong them duoc");
         }
         command.Dispose();
     }
 }
コード例 #2
0
 public void CreatePermission(Permission permission)
 {
     new PermissionDAO().CreatePermission(permission);
 }
コード例 #3
0
 public void UpdatePermission(Permission permission)
 {
     new PermissionDAO().UpdatePermission(permission);
 }