/// <summary> /// function to update appointment time and date /// </summary> /// <param name="Data">JObject, contains 2 parameters: "newTimeAndDate":Format(yyyy-mm-dd HH:MM:SS) and "AppointmentId":int</param> ///<returns>Success status</returns> public bool ChangeAppointmentDateOrTime(UpdateAppointmentDateTime UADT) { if (!IsAppointmentOccupied(UADT)) { return(SqlConnector.Update("Appointments", "appointment_time", $"'{UADT.NewDateTime}'", $"where appointment_id = {UADT.AppointmentId}")); } return(false); }
public ActionResult <MyBooleanResult> ChangeAppointmentDateOrTime([FromBody] UpdateAppointmentDateTime UADT) { MyBooleanResult res = new MyBooleanResult { ResultValue = _appointmentBL.ChangeAppointmentDateOrTime(UADT) }; return(res); }
/// <summary> /// function to check if wished time is occupied /// </summary> /// <param name="UADT">UpdateAppointmentDateTime object</param> /// <returns>boolean value</returns> public bool IsAppointmentOccupied(UpdateAppointmentDateTime UADT) { DataSet ReturnedData = SqlConnector.Select("appointment_id", "Appointments", $"where '{UADT.NewDateTime}' = appointment_time"); return(DataToObj.IsRecordExist(ReturnedData)); }