public async Task <TblHospitalSectionRel> AddHospitalSectionRel(TblHospitalSectionRel hospitalSectionRel) { HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync("api/HospitalSectionRelCore/AddHospitalSectionRel", hospitalSectionRel); TblHospitalSectionRel ans = await httpResponseMessage.Content.ReadAsAsync <TblHospitalSectionRel>(); return(ans); }
public DtoTblHospitalSectionRel(TblHospitalSectionRel hospitalSectionRel, HttpStatusCode statusEffect) { id = hospitalSectionRel.id; HospitalId = hospitalSectionRel.HospitalId; SectionId = hospitalSectionRel.SectionId; DoctorId = hospitalSectionRel.DoctorId; StatusEffect = statusEffect; }
public async Task <bool> UpdateHospitalSectionRel(TblHospitalSectionRel hospitalSectionRel, int logId) { List <object> hospitalSectionRelAndLogId = new List <object>(); hospitalSectionRelAndLogId.Add(hospitalSectionRel); hospitalSectionRelAndLogId.Add(logId); HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync("api/HospitalSectionRelCore/UpdateHospitalSectionRel", hospitalSectionRelAndLogId); bool ans = await httpResponseMessage.Content.ReadAsAsync <bool>(); return(ans); }
public IHttpActionResult AddHospitalSectionRel(TblHospitalSectionRel hospitalSectionRel) { var task = Task.Run(() => new HospitalSectionRelService().AddHospitalSectionRel(hospitalSectionRel)); if (task.Wait(TimeSpan.FromSeconds(10))) { if (task.Result.id != -1) { return(Ok(new DtoTblHospitalSectionRel(task.Result, HttpStatusCode.OK))); } else { return(Conflict()); } } return(StatusCode(HttpStatusCode.RequestTimeout)); }
public IHttpActionResult UpdateHospitalSectionRel(List <object> hospitalSectionRelLogId) { TblHospitalSectionRel hospitalSectionRel = JsonConvert.DeserializeObject <TblHospitalSectionRel>(hospitalSectionRelLogId[0].ToString()); int logId = JsonConvert.DeserializeObject <int>(hospitalSectionRelLogId[1].ToString()); var task = Task.Run(() => new HospitalSectionRelService().UpdateHospitalSectionRel(hospitalSectionRel, logId)); if (task.Wait(TimeSpan.FromSeconds(10))) { if (task.Result) { return(Ok(true)); } else { return(Conflict()); } } return(StatusCode(HttpStatusCode.RequestTimeout)); }
public TblHospitalSectionRel AddHospitalSectionRel(TblHospitalSectionRel hospitalSectionRel) { return(new HospitalSectionRelRepo().AddHospitalSectionRel(hospitalSectionRel)); }
public bool UpdateHospitalSectionRel(TblHospitalSectionRel hospitalSectionRel, int logId) { return(new HospitalSectionRelRepo().UpdateHospitalSectionRel(hospitalSectionRel, logId)); }
public bool UpdateHospitalSectionRel(TblHospitalSectionRel hospitalSectionRel, int logId) { return(new MainProvider().Update(hospitalSectionRel, logId)); }
public TblHospitalSectionRel AddHospitalSectionRel(TblHospitalSectionRel hospitalSectionRel) { return((TblHospitalSectionRel) new MainProvider().Add(hospitalSectionRel)); }