public static Boolean EditCard(EditCard composite) { using (SqlConnection connectionstring = new SqlConnection(cstring)) { using (SqlCommand cmd = new SqlCommand()) { connectionstring.Open(); cmd.CommandText = "UPDATE CardTable SET CardID = @p1 WHERE CardID = @p2"; cmd.Parameters.AddWithValue("@p1", composite.NewCardnr); cmd.Parameters.AddWithValue("@p2", composite.OldCardnr); cmd.CommandType = CommandType.Text; cmd.Connection = connectionstring; try { cmd.ExecuteNonQuery(); return(true); } catch { return(false); } finally { connectionstring.Close(); } } } }
public bool UpdateCard(EditCard composite) { return(DataHelper.EditCard(composite)); }
public void EditCard(EditCard composite) { DataHelper.EditCard(composite); }