public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "appointments/{handle}")] HttpRequest req, string handle, ILogger log) { DateTime startDate, endDate; StringValues startBuffer, endBuffer; log.LogInformation("Appointments(): Received request"); if (req.Query.TryGetValue("startdate", out startBuffer) && req.Query.TryGetValue("enddate", out endBuffer)) { if (!DateTime.TryParse(startBuffer, out startDate) || !DateTime.TryParse(endBuffer, out endDate)) { log.LogError("Appointments(): Badly formed dates in query string"); return(new BadRequestResult()); } } else { // Dates were not provided, use default of next 60 days startDate = DateTime.Today; endDate = DateTime.Today.AddDays(60); } // Protect from too large of a range if ((endDate - startDate).TotalDays > 100) { endDate = startDate.AddDays(100); } var result = await AppointmentData.GetAppointmentsAsync(handle, AppointmentData.AppointmentStatus.Requested, startDate, endDate); return(new OkObjectResult(result)); }
public static Appointment Create(AppointmentView view) { var d = new AppointmentData(); Copy.Members(view, d); return(new Appointment(d)); }
/// <summary> /// 获取可用的优惠下拉信息 /// </summary> /// <returns></returns> public JsonResult GetDiscountItems() { //根据方式拉项 List <Discount> DisCountList = AppointmentData.GetDiscountItems(); return(Json(DisCountList)); }
/// <summary> /// 新增预约单 /// </summary> /// <returns></returns> public JsonResult AddAppointment() { AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载 ajax.status = EnumAjaxStatus.Error; //默认失败 ajax.msg = "新增失败!"; //前台获取,用于显示提示信息 var data = Request["data"]; //获取前台传递的数据,主要序列化 if (string.IsNullOrEmpty(data)) { return(Json(ajax)); } Appointment obj = (Appointment)(JsonConvert.DeserializeObject(data.ToString(), typeof(Appointment))); obj.ID = CommonData.DPGetTableMaxId("AP", "ID", "Appointment", 8); obj.CreateTime = DateTime.Now; obj.CreatorId = UserSession.userid; obj.ApStateID = 1;//默认未跟进 if (string.IsNullOrEmpty(obj.ComCode)) { ajax.msg = "请选择所属分校!"; return(Json(ajax)); } if (AppointmentData.Add(obj))//注意时间类型 { ajax.msg = "新增成功!"; ajax.status = EnumAjaxStatus.Success; } return(Json(ajax)); }
public List <AppointmentModels> SearchAppointmentByFiltersAdministrator(AppointmentModels appointment, String initialDate, String finalDate, int process, String dateStatus, int age, int professional) { AppointmentData appointmentData = new AppointmentData(); return(appointmentData.SearchAppointmentByFiltersAdministrator(appointment, initialDate, finalDate, process, dateStatus, age, professional)); }
public ActionResult CancelAppointment(int appointmentId, DateTime date) { var data = Scheduler.AppointmentRepository.GetAppointmentById(appointmentId); if (data == null) { return(HttpNotFound()); } if (data.Type != AppointmentType.Recurring) { return(Content("Error: only recurring appointments can be cancelled.")); } var cancellationAppointment = new AppointmentData { Type = AppointmentType.Cancellation, RecurringAppointmentId = data.Id, CaseId = data.CaseId, ProviderId = data.ProviderId, Date = date, StartTime = data.StartTime, EndTime = data.EndTime }; Scheduler.AppointmentRepository.CreateAppointment(cancellationAppointment); return(Content("Ok")); }
private async Task <IMessageActivity> HandleAppointment(IDialogContext context, string appointment) { Enum.TryParse(appointment, out AppointmentDetails details); PatientDetails.AppointmentAction = details; switch (details) { case AppointmentDetails.BookAppointment: await context.Forward(new DateTimeAdaptiveDialog(), this.AppointmentDateResultDialogAsync, null, CancellationToken.None); break; case AppointmentDetails.CancelAppointment: await context.PostAsync(await GetAppointmentCancelCard(context, AppointmentData.ShowBookedAppointment(Convert.ToInt32(PatientDetails.PatientId)))); break; case AppointmentDetails.ShowBookedAppointment: await context.PostAsync(await GetAppointmentListCard(context, AppointmentData.ShowBookedAppointment(Convert.ToInt32(PatientDetails.PatientId)))); context.Done(appointment); break; case AppointmentDetails.UpdateAppointment: return(await GetAppointmentListCard(context, AppointmentData.ShowBookedAppointment(Convert.ToInt32(PatientDetails.PatientId)))); case AppointmentDetails.Done: context.Done(appointment); break; } return(null); }
public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "delete", Route = "appointment/{repo}/{id}")] HttpRequest req, string repo, string id, ILogger log) { log.LogInformation(string.Format("DeleteAppointment(): Received request to delete appointment with keys {0} {1}", repo, id)); try { var table = CosmosTableUtil.GetTableReference("schedule"); TableEntity appointment = await AppointmentData.GetAppointmentAsync(repo, id); if (appointment != null) { var result = await table.ExecuteAsync(TableOperation.Delete(appointment)); return(new OkObjectResult(result.Result as AppointmentEntity)); } else { return(new NotFoundResult()); } } catch (Exception ex) { log.LogError(string.Format("DeleteAppointment(): Exception occurred {0}:{1}", ex.Message, ex)); return(new InternalServerErrorResult()); } }
public ActionResult Index() { List <AppointmentData> final = new List <AppointmentData>(); AppointmentData temp = new AppointmentData(); temp.Id = 1; temp.StartTime = Convert.ToDateTime("3/2/20"); temp.EndTime = Convert.ToDateTime("3/9/2020"); temp.Subject = "Jorge Gonzalez - PTO"; temp.CategoryColor = "#00bdae"; final.Add(temp); AppointmentData temp1 = new AppointmentData(); temp1.Id = 2; temp1.StartTime = Convert.ToDateTime("3/5/20"); temp1.EndTime = Convert.ToDateTime("3/19/2020"); temp1.Subject = "William Gundaker - PTO"; temp1.CategoryColor = "#ea7a57"; final.Add(temp1); ViewBag.appointments = final; return(View()); }
public void PutAppointment(AppointmentCreateModel model) { model.UserId = RequestContext.Principal.Identity.GetUserId(); AppointmentData data = new AppointmentData(); // data.Create(model); }
/// <summary> /// 安排试听 /// </summary> /// <returns></returns> public ActionResult AddST() { AjaxStatusModel ajax = new AjaxStatusModel(); ajax.status = EnumAjaxStatus.Error; //默认失败 ajax.msg = "获取失败!"; //前台获取,用于显示提示信息 string apid = Request["apid"]; //预约单 string classid = Request["classid"]; //班级号 if (string.IsNullOrEmpty(apid)) { return(Json(ajax)); } if (EnrollData.GetEnrollPrintByApidAndClassid(apid, classid).Count() > 0) { ajax.msg = "此资源记录已经预约试听过了,不允许重复报名!"; return(Json(ajax)); } DataProvider.Entities.Enroll obj = new DataProvider.Entities.Enroll(); Appointment ap = AppointmentData.GetOneByID(apid); obj.ID = CommonData.DPGetTableMaxId("EN", "ID", "Enroll", 8); obj.APID = apid; obj.StudentID = ap.ApStudentID; obj.ClassID = classid; obj.CreatorId = UserSession.userid; obj.CreateTime = DateTime.Now; if (EnrollData.Add(obj))//注意时间类型 { ajax.msg = "预约试听报名成功!"; ajax.status = EnumAjaxStatus.Success; } return(Json(ajax)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,StartDateTime,Detail,Status,PatientId,DoctorId")] AppointmentData appointmentData) { if (id != appointmentData.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(appointmentData); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppointmentDataExists(appointmentData.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DoctorId"] = new SelectList(_context.DoctorData, "Id", "Id", appointmentData.DoctorId); ViewData["PatientId"] = new SelectList(_context.PatientsData, "Id", "Id", appointmentData.PatientId); return(View(appointmentData)); }
public List <AppointmentModel> GetAllAppointmentsForUser() { string userId = RequestContext.Principal.Identity.GetUserId(); AppointmentData data = new AppointmentData(); return(data.GetAllAppointmentsForOneUser(userId)); }
public List <AppointmentModel> GetOneAppointmentForUser(int Id) { string userId = RequestContext.Principal.Identity.GetUserId(); AppointmentData data = new AppointmentData(); return(data.GetSpecificAppointmentForUser(userId, Id)); }
/// <summary> /// 根据预约号返回跟进记录 /// </summary> /// <param name="apid"></param> /// <returns></returns> public JsonResult GetFollowListByAPID(string apid) { AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载 ajax.status = EnumAjaxStatus.Error; //默认失败 List <FollowRecord> FollowList = AppointmentData.GetFollowListByAPID(apid); ajax.data = FollowList; return(Json(new { total = FollowList.Count(), rows = FollowList, state = true, msg = "加载成功" }, JsonRequestBehavior.AllowGet)); }
private Appointment CreateAppointment(AppointmentData appointmentData, DateTime date) { return(new Appointment() { Id = appointmentData.Id, Date = date, StartTime = appointmentData.StartTime, EndTime = appointmentData.EndTime //Type = appointmentData.Type }); }
public void GetClosedAppointmentListTest() { // Arrange AppointmentData appointment = new AppointmentData(); // Act var result = appointment.GetClosedAppointmentList().Count > 0; // Assert Assert.IsTrue(result); }
public ActionResult ManageInvoice() { if (Session["userId"] == null) { return(Redirect("~")); } AppointmentData appointments = new AppointmentData(); List <Appointment> AppointmentList = appointments.GetClosedAppointmentList(); return(View(AppointmentList)); }
/// <summary> /// 添加约据房间数据(包括公开和私密) /// </summary> /// <param name="id">约据ID</param> /// <param name="data">约据房间数据</param> public void AddAppointmentData(uint id, AppointmentData data) { if (!rooms_.ContainsKey(id)) { rooms_.Add(id, data); } else { rooms_[id] = data; } }
public ActionResult AppointmentList() { if (Session["userId"] == null) { return(Redirect("~")); } AppointmentData appointmentData = new AppointmentData(); List <Appointment> AppointmentList = appointmentData.GetAppointmentList(); return(View(AppointmentList)); }
public AppointmentSearchClassBase(AppointmentSearch frm) { _frm = frm; _frm.lblFrom.Visible = false; _frm.lblTo.Visible = false; _frm.dtpFrom.Visible = false; _frm.dtpTo.Visible = false; _ad = new AppointmentData(); // DisableIndexChangedEvents(); //SetDataSource(); }
/// <summary> /// Action that calls for the view which can show report by patient phone number /// </summary> /// <returns>The View which shows the list of appointments of the Patient whose phone number is passed</returns> public ActionResult ByPatient() { if (Session["userId"] == null) { return(Redirect("~")); } AppointmentData report = new AppointmentData(); var daily = report.GetAppointmentList(); return(View(daily)); }
public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "appointment/{repo}/{id}")] HttpRequest req, string repo, string id, ILogger log) { log.LogInformation("Appointment(): Received request"); var result = await AppointmentData.GetAppointmentAsync(repo, id); return(new OkObjectResult(result)); }
private void HandleAddedEvent(AppointmentAdded addedEvent) { AppointmentData.Add(new AppointmentTransferData(addedEvent.PatientId, addedEvent.Description, addedEvent.AggregateId.Date, addedEvent.StartTime, addedEvent.EndTime, addedEvent.TherapyPlaceId, addedEvent.AppointmentId, addedEvent.AggregateId.MedicalPracticeId, addedEvent.LabelId)); }
// POST: odata/Appointments public async Task <IHttpActionResult> Post(AppointmentData appointmentData) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } // TODO: Add create logic here. // return Created(AppointmentDto); return(StatusCode(HttpStatusCode.NotImplemented)); }
public ActionResult AppointmentList() { if (Session["userId"] == null) { return(Redirect("~")); } AppointmentData appointments = new AppointmentData(); List <Appointment> AppointmentList = appointments.GetDoctorAppointmentList((int)Session["userId"]); var DoctorViewObj = new DoctorProfileView((int)Session["userId"]); return(View(AppointmentList)); }
public async Task <IActionResult> Create([Bind("Id,StartDateTime,Detail,Status,PatientId,DoctorId")] AppointmentData appointmentData) { if (ModelState.IsValid) { _context.Add(appointmentData); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DoctorId"] = new SelectList(_context.DoctorData, "Id", "Id", appointmentData.DoctorId); ViewData["PatientId"] = new SelectList(_context.PatientsData, "Id", "Id", appointmentData.PatientId); return(View(appointmentData)); }
public ActionResult CreateAppointment(AppointmentCreateRequest model) { var data = new AppointmentData(); data.Type = model.Type; data.CaseId = model.CaseId; data.ProviderId = model.ProviderId; data.Date = model.Date.Date; data.StartTime = model.StartTime.TimeOfDay; data.EndTime = model.EndTime.TimeOfDay; Scheduler.AppointmentRepository.CreateAppointment(data); return(Content("Ok")); }
public ActionResult AddAppointmentTran(AddAppointmentDataInput aapp) { string code = WebHelper.GetSession <string>(App_VerifyCodeKey); WebHelper.RemoveSession(App_VerifyCodeKey); if (code.IsNullOrEmpty() || code.ToLower() != aapp.VCode.ToLower()) { return(null); } AppointmentData appd = this.CreateService <IAppointmentDataService>().Add(aapp); return(this.JsonContent(appd)); }
public void RemoveExistingAppointmentSlots(int patientId, DateTime date) { AppointmentData appointmentData = new AppointmentData(); var PreviousAppointmentsTimeSlots = appointmentData.GetPatientsCurrentAppointmentTimeSlots(patientId, date); foreach (var item in PreviousAppointmentsTimeSlots) { var appointment = TimeSlots.SingleOrDefault(x => x.Id == item.Id); if (appointment != null) { TimeSlots.Remove(appointment); } } }
public IEnumerable<AppointmentData> UpdateAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) { if (appointmentData.ID == null) return Controller.InsertAppointment(schedulerInfo, appointmentData); //Inserts Or Updates the Appointment return Controller.UpdateAppointment(schedulerInfo, appointmentData); }
public IEnumerable<AppointmentData> RemoveRecurrenceExceptions(SchedulerInfo schedulerInfo, AppointmentData masterAppointmentData) { return Controller.RemoveRecurrenceExceptions(schedulerInfo, masterAppointmentData); }
public IEnumerable<AppointmentData> InsertAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) { return Controller.InsertAppointment(schedulerInfo, appointmentData); }
public IEnumerable<AppointmentData> DeleteAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData, bool deleteSeries) { if (appointmentData.ID == null) return null; return Controller.DeleteAppointment(schedulerInfo, appointmentData, deleteSeries); }
public IEnumerable<AppointmentData> CreateRecurrenceException(SchedulerInfo schedulerInfo, AppointmentData recurrenceExceptionData) { return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData); }
public IEnumerable<AppointmentData> UpdateAppointment(MySchedulerInfo schedulerInfo, AppointmentData appointmentData) { return Controller.UpdateAppointment(schedulerInfo, appointmentData); }
public IEnumerable<AppointmentData> DeleteAppointment(MySchedulerInfo schedulerInfo, AppointmentData appointmentData, bool deleteSeries) { return Controller.DeleteAppointment(schedulerInfo, appointmentData, deleteSeries); }