public bool PostProfessionalSchedule([FromBody] KendoEntity k) { KendoEntity ku = k; return(professionalRepository.AddProfessionalSchedule(k)); //return professionalRepository.AddProfessionalSchedule(proSchedule); }
//TODO:Get confirmation. //User the same method to soft delete dont need have another method to softdelete, this method does have IsActive param. public bool PutProfessionalSchedule([FromBody] KendoEntity k) { KendoEntity ku = k; return(professionalRepository.UpdateProfessionalSchedule(k)); }
public bool UpdateProfessionalSchedule(KendoEntity professionalSchedule) { using (var conn = new SqlConnection(PrescienceRxConnectionString)) { conn.Open(); //TODO: Fix this method using (var cmd = new SqlCommand(UpdateProfessionalScheduleSp, conn)) { cmd.CommandType = System.Data.CommandType.StoredProcedure; TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); professionalSchedule.Start = TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(professionalSchedule.Start).ToUniversalTime(), easternZone).ToString(); professionalSchedule.End = TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(professionalSchedule.End).ToUniversalTime(), easternZone).ToString(); cmd.Parameters.Add("@AppointmentId", SqlDbType.Int).Value = professionalSchedule.TaskID; cmd.Parameters.Add("@ProfessionalId", SqlDbType.Int).Value = professionalSchedule.ProfessionalId; cmd.Parameters.Add("@CustomerId", SqlDbType.Int).Value = professionalSchedule.OwnerID; cmd.Parameters.Add("@Title", SqlDbType.NVarChar).Value = professionalSchedule.Title; cmd.Parameters.Add("@StartTime", SqlDbType.DateTime).Value = professionalSchedule.Start; cmd.Parameters.Add("@EndTime", SqlDbType.DateTime).Value = professionalSchedule.End; cmd.Parameters.Add("@Comments", SqlDbType.NVarChar).Value = professionalSchedule.Description; cmd.Parameters.Add("@UpdatedBy ", SqlDbType.NVarChar).Value = professionalSchedule.UserId; cmd.Parameters.Add("@DateUpdated", SqlDbType.DateTime).Value = DateTime.UtcNow; //TODO: Add this back, these parms missing from sp //cmd.Parameters.Add("@UpdatedBy", SqlDbType.VarChar).Value = professionalSchedule.UpdatedBy; //cmd.Parameters.Add("@DateUpdated", SqlDbType.DateTime).Value = DateTime.UtcNow; return(cmd.ExecuteNonQuery() > 0); } } }