public static Boolean EditDoor(EditDoor composite) { using (SqlConnection connectionstring = new SqlConnection(cstring)) { using (SqlCommand cmd = new SqlCommand()) { connectionstring.Open(); cmd.CommandText = "UPDATE DoorTable SET DoorID = @p1 WHERE DoorID = @p2"; cmd.Parameters.AddWithValue("@p1", composite.NewDoornr); cmd.Parameters.AddWithValue("@p2", composite.OldDoornr); cmd.CommandType = CommandType.Text; cmd.Connection = connectionstring; try { cmd.ExecuteNonQuery(); return(true); } catch { return(false); } finally { connectionstring.Close(); } } } }
public bool UpdateDoor(EditDoor composite) { return(DataHelper.EditDoor(composite)); }
public void EditDoor(EditDoor composite) { DataHelper.EditDoor(composite); }