/// <summary> /// Delete the string in ArrangementDate /// </summary> public static void DeleteArrangementDate(ArrangementDate arrDate) { using (SqlConnection connection = new SqlConnection(ConnectionString)) { SqlCommand command = connection.CreateCommand(); StringBuilder query = new StringBuilder(); query.AppendFormat("DELETE FROM "); query.AppendFormat(DBAttributesManager.GetDBTableName(typeof(ArrangementDate))); query.AppendFormat(" WHERE ArrangementID=" + arrDate.ArrangementID); query.AppendFormat(" AND Date=cast('" + arrDate.Date.ToString("MM.dd.yyyy HH:mm:ss") + "' as datetime)"); connection.Open(); command.CommandText = query.ToString(); command.ExecuteNonQuery(); } }
public XMLSerializableArrangementDate(ArrangementDate arr) { if ((arr == null) || (!arr.ID.HasValue)) throw new ArgumentNullException("arr"); this.ArrangementID = arr.ID.Value; this.Date = arr.Date; }