public static async Task <tbSchedule> UpSertSchedule2(tbSchedule schedule) { var url = "api/Doctor/UpsertSchedule2"; tbSchedule result = await ApiRequest <tbSchedule> .PostRequest(url, schedule); return(result); }
public static async Task <tbSchedule> scheduledelete(int ID) { var url = string.Format("api/Doctor/ScheduleDelete?ID={0}", ID); tbSchedule result = await ApiRequest <tbSchedule> .GetRequest(url); return(result); }
public HttpResponseMessage getScheduleByID(HttpRequestMessage request, int ID) { tbSchedule cate = new tbSchedule(); var result = dbContext.tbSchedules.Where(a => a.IsDeleted != true && a.ID == ID).FirstOrDefault(); return(request.CreateResponse <tbSchedule>(HttpStatusCode.OK, result)); }
public tbSchedule deleteSchedulesByID(int scheduleID) { tbSchedule UpdatedSchedule = null; tbSchedule schedule = scheduleRepo.Get().Where(a => a.ID == scheduleID).FirstOrDefault(); schedule.IsDeleted = true; UpdatedSchedule = scheduleRepo.UpdatewithObj(schedule); return(UpdatedSchedule); }
public async Task <ActionResult> scheduledelete(int ID = 0) { tbSchedule result = await DoctorApiRequestHelper.scheduledelete(ID); if (result != null) { return(Json("Success", JsonRequestBehavior.AllowGet)); } else { return(Json("Fail", JsonRequestBehavior.AllowGet)); } }
public HttpResponseMessage ScheduleDelete(HttpRequestMessage request, int ID) { tbSchedule UpdatedEntity = new tbSchedule(); tbSchedule schedule = scheduleRepo.Get().Where(a => a.ID == ID).FirstOrDefault(); schedule.IsDeleted = true; UpdatedEntity = scheduleRepo.UpdatewithObj(schedule); return(request.CreateResponse <tbSchedule>(HttpStatusCode.OK, UpdatedEntity)); }
public HttpResponseMessage UpsertSchedule(HttpRequestMessage request, tbSchedule schedule) { tbSchedule UpdatedEntity = null; if (schedule.ID > 0) { UpdatedEntity = scheduleRepo.UpdatewithObj(schedule); } else { schedule.IsDeleted = false; UpdatedEntity = scheduleRepo.AddWithGetObj(schedule); } return(request.CreateResponse <tbSchedule>(HttpStatusCode.OK, UpdatedEntity)); }
public HttpResponseMessage Upsert(HttpRequestMessage request, tbSchedule schedule) { tbSchedule UpdatedEntity = null; if (schedule.ID > 0) { UpdatedEntity = scheduleRepo.UpdatewithObj(schedule); } else { schedule.Accesstime = MyExtension.getLocalTime(DateTime.UtcNow); schedule.IsDeleted = false; UpdatedEntity = scheduleRepo.AddWithGetObj(schedule); } return(request.CreateResponse <tbSchedule>(HttpStatusCode.OK, UpdatedEntity)); }
public async Task <ActionResult> _ScheduleForm2(string FormType, int ID, string docname = null, string hosname = null, int docid = 0, int hosid = 0) { tbSchedule schedule = new tbSchedule(); schedule.DoctorName = docname; schedule.HospitalName = hosname; schedule.DoctorID = docid; schedule.HospitalID = hosid; if (FormType == "Add") { return(PartialView("_ScheduleForm2", schedule)); } else { tbSchedule result = await DoctorApiRequestHelper.GetScheduleByID(ID); return(PartialView("_ScheduleForm2", result)); } }
public async Task <ActionResult> UpSertSchedule2(tbSchedule schedule) { // tbSchedule schedule = new tbSchedule(); //schedule.DoctorID = doctorid; //schedule.DoctorName = doctorname; //schedule.HospitalID = hospitalid; //schedule.HospitalName = hospitalname; //schedule.Fromtime = timepicker1; //schedule.Totime = timepicker2; tbSchedule result = await DoctorApiRequestHelper.UpSertSchedule2(schedule); if (result != null) { // return Json(result, JsonRequestBehavior.AllowGet); return(PartialView("_schedule", result)); } else { return(Json("Fail", JsonRequestBehavior.AllowGet)); } }
public bool deleteSchedulesUnderHospital(int doctorID, int hospitalID) { bool status = false; List <tbSchedule> scheduleList = scheduleRepo.Get().Where(a => a.DoctorID == doctorID && a.HospitalID == hospitalID).ToList(); int delCount = 0; foreach (var item in scheduleList) { item.IsDeleted = true; tbSchedule delResult = scheduleRepo.UpdatewithObj(item); if (delResult != null) { delCount += 1; } } if (delCount == scheduleList.Count()) { status = true; } return(status); }
public HttpResponseMessage delete(HttpRequestMessage request, int scheduleid = 0) { tbSchedule UpdatedSchedule = iScheduleDelService.deleteSchedulesByID(scheduleid); return(request.CreateResponse <tbSchedule>(HttpStatusCode.OK, UpdatedSchedule)); }
public HttpResponseMessage scheduleDetail(HttpRequestMessage request, int scheduleID = 0) { tbSchedule result = scheduleRepo.GetWithoutTracking().Where(a => a.IsDeleted != true).Where(a => a.ID == scheduleID).FirstOrDefault(); return(request.CreateResponse <tbSchedule>(HttpStatusCode.OK, result)); }