public static void DeletePoi(MapPoi poi) { using (var sc = new SqlConnection(ConnectionStringHelper.ConnectionString)) { var cmd = new SqlCommand("sp_map_Poi_Delete", sc) { CommandType = CommandType.StoredProcedure }; cmd.Parameters.AddWithValue("@PoiId", poi.Id); sc.Open(); cmd.ExecuteNonQuery(); } }
public static void UpdatePoi(MapPoi poi) { using (var sc = new SqlConnection(ConnectionStringHelper.ConnectionString)) { var cmd = new SqlCommand("sp_map_Poi_Update", sc) { CommandType = CommandType.StoredProcedure }; cmd.Parameters.AddWithValue("@PoiId", poi.Id); cmd.Parameters.AddWithValue("@Name", poi.Name); cmd.Parameters.AddWithValue("@Title", poi.Title); cmd.Parameters.AddWithValue("@PortalId", poi.PortalId); cmd.Parameters.AddWithValue("@Email", poi.Email); cmd.Parameters.AddWithValue("@ImageUrl", poi.ImageUrl); cmd.Parameters.AddWithValue("@Phone", poi.Phone); cmd.Parameters.AddWithValue("@Type", poi.Type); sc.Open(); cmd.ExecuteNonQuery(); } }