public async Task <ActionResult> _hospitalList(int doctorID, int hospitalID = 0, DateTime?AppointmentDate = null) { AppointmentDate = MyExtension.getLocalTime(DateTime.UtcNow); IEnumerable <HospitalSchedules> hospitalList = await HospitalApiRequestHelper.scheduledHospitalList(doctorID, hospitalID, AppointmentDate); return(PartialView("_hospitalList", hospitalList)); }
public async Task <ActionResult> UpSertHospital(tbHospital hospital) { tbHospital result = await HospitalApiRequestHelper.UpSertHospital(hospital); if (result != null) { return(Json("Success", JsonRequestBehavior.AllowGet)); } else { return(Json("Fail", JsonRequestBehavior.AllowGet)); } }
public async Task <ActionResult> hospitaldelete(int ID = 0) { tbHospital result = await HospitalApiRequestHelper.hospitaldelete(ID); if (result != null) { return(Json("Success", JsonRequestBehavior.AllowGet)); } else { return(Json("Fail", JsonRequestBehavior.AllowGet)); } }
public async Task <ActionResult> _HospitalForm(string FormType, int ID) { tbHospital hospital = new tbHospital(); if (FormType == "Add") { return(PartialView("_hospitalForm", hospital)); } else { tbHospital result = await HospitalApiRequestHelper.GetHospitalById(ID); return(PartialView("_hospitalForm", result)); } }
public async Task <ActionResult> UpsertPatient(tbPatient patient, int doctorid = 0, string doctorname = null, DateTime?appdate = null, DateTime?fromtime = null, DateTime?totime = null, int scheduleid = 0, int hospitalID = 0) { PatientAppointmentViewModel shvm = new PatientAppointmentViewModel(); shvm.appointment = new tbAppointment(); shvm.appointment.DoctorId = doctorid; shvm.appointment.DoctorName = doctorname; string date = appdate.Value.ToShortDateString(); string fromtimedate = fromtime.Value.ToShortTimeString(); string appointmentdate = date + " " + fromtimedate; shvm.appointment.ScheduleDataID = scheduleid; shvm.appointment.AppointmentDateTime = DateTime.Parse(appointmentdate); shvm.appointment.HospitalId = hospitalID; //CareMeClient.Helper.CookieHelper.getstaffHospitalID(); // shvm.appointment.HospitalName = CareMeClient.Helper.CookieHelper.getstaffHospitalName(); shvm.patient = patient; PatientAppointmentViewModel result = await BookingApiRequestHelper.UpsertPatient(shvm); if (result != null) { BookingSuccessModel bsm = new BookingSuccessModel(); bsm.doctor = await DoctorApiRequestHelper.GetDoctorById(result.appointment.DoctorId ?? 0); bsm.hospital = await HospitalApiRequestHelper.GetHospitalById(result.appointment.HospitalId ?? 0); bsm.scheduleData = await ScheduleApiRequestHelper.getScheduleDetail(result.appointment.ScheduleDataID ?? 0); bsm.pavm = result; return(PartialView("_bookingSuccess", bsm)); } else { return(Json("Fail", JsonRequestBehavior.AllowGet)); } }
public async Task <ActionResult> GetTownShip(string state = null) { IEnumerable <string> result = await HospitalApiRequestHelper.GetTownShip(state); return(Json(result, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> GetState() { List <tbLocation> result = await HospitalApiRequestHelper.getstate(); return(Json(result, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> _hospitalList(string hospitalname = null, int pagesize = 10, int page = 1) { PagedListClient <tbHospital> result = await HospitalApiRequestHelper.GetHospitalWithPaging(hospitalname, pagesize, page); return(PartialView("_hospitalList", result)); }
private async Task MessageReceivedAsync(IDialogContext context, IAwaitable <object> result) { var msg = await result as Activity; if (msg.Text.isStart_words()) { var reply = msg.CreateReply($"Welcome to Careme bot. I am here to help you. One more thing: Don’t use me in medical emergencies. I don’t provide medical advice, and I don’t support emergency calls"); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; reply.Attachments.Add(new HeroCard { Title = "Bot for your health", Text = "Ask me anything about your health. I will learn from you and keep improved.", Images = new List <CardImage> { new CardImage(ResourceHelper.welcome_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.ImBack, "Gift for you", value: "Gift for you"), new CardAction(ActionTypes.OpenUrl, "Book a doctor", value: "Book a doctor"), //new CardAction(ActionTypes.ImBack, "ခရီးသြားရေအာင္", value:"ခရီးသြားရေအာင္"), new CardAction(ActionTypes.ImBack, "About us", value: "About us"), } }.ToAttachment()); await context.PostAsync(reply); } else if (msg.Text.isBookDoctor_words()) { var reply = msg.CreateReply($"Let's get started with your preferred choice for booking a doctor"); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; reply.Attachments = new List <HeroCard> { new HeroCard { Title = "Find a doctor", Text = "Tap here to find a doctor", Images = new List <CardImage> { new CardImage(ResourceHelper.doctor_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Find a doctor", value: $"https://airlineticketbotclient.yammobots.com/domain"), } }, new HeroCard { Title = "Find a doctor with specialty", Text = "Tap here to find a doctor with your preferred speciality", Images = new List <CardImage> { new CardImage(ResourceHelper.specialty_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Start with specialty", value: $"https://airlineticketbotclient.yammobots.com/domain"), } }, new HeroCard { Title = "Find a doctor by hospital", Text = "Tap here to find a doctor with your preferred hospital", Images = new List <CardImage> { new CardImage(ResourceHelper.hospital_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Start with hospital", value: $"https://airlineticketbotclient.yammobots.com/domain"), } }, new HeroCard { Title = "Recommend a doctor", Text = "Let us know your problem and we will suggest you.", Images = new List <CardImage> { new CardImage(ResourceHelper.specialty_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.ImBack, "Suggest me", value: "Suggest me"), } }, }.Select(a => a.ToAttachment()).ToList(); await context.PostAsync(reply); } else if (msg.Text.ToLower().Equals("about us")) { var objs = await DomainApiRequestHelper.Get(hospitalid : 1, tags : "About us"); if (objs != null && objs.Count > 0) { var reply = msg.CreateReply($"Welcome to . This is beta release bot for testing purpose to learn user insight better."); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; reply.Attachments = objs.Select(a => new HeroCard { Title = a.Name, Text = a.Description, Images = new List <CardImage> { new CardImage(a.ImageUrl) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, a.Action, value: $"https://airlineticketbotclient.yammobots.com/domain/index?id={a.ID}&airlineid={1}"), } }).ToList().Select(a => a.ToAttachment()).ToList(); await context.PostAsync(reply); } } else if (msg.Text.ToLower().Equals("suggest me")) { var hospitals = await HospitalApiRequestHelper.Get(pagesize : 0); var bodyparts = await BodyPartApiRequestHelper.Get(pagesize : 0); var form = new FormDialog <EngFormFlowDialog>(new EngFormFlowDialog(bodyparts, hospitals), EngFormFlowDialog.BuildForm, FormOptions.None, null); await context.Forward(form, ResumeAfterEngFFDialog, msg, CancellationToken.None); return; } else if (msg.Text.ToLower().Equals("gift for you")) { var reply = msg.CreateReply($"Here are useful stuffs for you. Just try it and suggest us."); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; reply.Attachments = new List <HeroCard> { new HeroCard { Title = "Free health tip and article", Text = "We select the useful articles for you. Tap here to subscribe", Images = new List <CardImage> { new CardImage(ResourceHelper.doctor_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.ImBack, "Subscribe now", value: "Subscribe now"), } }, new HeroCard { Title = "Reminder", Text = "I will remind you for your health and activity you set", Images = new List <CardImage> { new CardImage(ResourceHelper.specialty_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.ImBack, "Remind me", value: "Remind me"), } }, new HeroCard { Title = "Feedback", Text = "You are welcome and your feedback is always appreciated.", Images = new List <CardImage> { new CardImage(ResourceHelper.specialty_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Post suggestion", value: $"https://airlineticketbotclient.yammobots.com/domain"), } } }.Select(a => a.ToAttachment()).ToList(); await context.PostAsync(reply); } else if (msg.Text.ToLower().Equals("remind me")) { var form = new FormDialog <ReminderFormFlowDialog>(new ReminderFormFlowDialog(), ReminderFormFlowDialog.BuildForm, FormOptions.None, null); await context.Forward(form, ResumeAfterEngFFDialog, msg, CancellationToken.None); return; } else if (msg.Text.ToLower().Equals("subscribe now")) { var form = new FormDialog <SubscribeFormFlowDialog>(new SubscribeFormFlowDialog("a"), () => SubscribeFormFlowDialog.BuildForm("a"), FormOptions.None, null); await context.Forward(form, ResumeAfterEngFFDialog, msg, CancellationToken.None); return; } context.Wait(MessageReceivedAsync); }
private async Task MessageReceivedAsync(IDialogContext context, IAwaitable <object> result) { var msg = await result as Activity; if (msg.Text.isStart_words()) { var obj = await HospitalApiRequestHelper.GetHospitalById(ResourceHelper.hospitalId); var reply = msg.CreateReply($"Welcome to {obj.Name}. This is testing bot and I am here to help you."); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; reply.Attachments.Add(new HeroCard { Title = obj.Name, Text = obj.Description, Images = new List <CardImage> { new CardImage(obj.WelcomePhotoUrl) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.ImBack, "Health Tip", value: "Health Tip"), new CardAction(ActionTypes.OpenUrl, "Book a doctor", value: "Book a doctor"), //new CardAction(ActionTypes.ImBack, "ခရီးသြားရေအာင္", value:"ခရီးသြားရေအာင္"), new CardAction(ActionTypes.ImBack, "About us", value: "About us"), } }.ToAttachment()); await context.PostAsync(reply); } else if (msg.Text.isBookDoctor_words()) { var reply = msg.CreateReply($"Let's get started with your preferred choice for booking a doctor"); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; reply.Attachments = new List <HeroCard> { new HeroCard { Title = "Find a doctor", Text = "Tap here to find a doctor", Images = new List <CardImage> { new CardImage(ResourceHelper.doctor_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Find a doctor", value: $"https://airlineticketbotclient.yammobots.com/domain"), } }, new HeroCard { Title = "Find a doctor with specialty", Text = "Tap here to find a doctor with your preferred speciality", Images = new List <CardImage> { new CardImage(ResourceHelper.specialty_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Start with specialty", value: $"https://airlineticketbotclient.yammobots.com/domain"), } }, new HeroCard { Title = "Find a doctor by hospital", Text = "Tap here to find a doctor with your preferred hospital", Images = new List <CardImage> { new CardImage(ResourceHelper.hospital_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Start with hospital", value: $"https://airlineticketbotclient.yammobots.com/domain"), } }, new HeroCard { Title = "Recommend a doctor", Text = "Let us know your problem and we will suggest you.", Images = new List <CardImage> { new CardImage(ResourceHelper.specialty_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.ImBack, "Suggest me", value: "Suggest me"), } }, }.Select(a => a.ToAttachment()).ToList(); await context.PostAsync(reply); context.Wait(MessageReceivedAsync); } else if (msg.Text.ToLower().Equals("about us")) { var objs = await DomainApiRequestHelper.Get(hospitalid : 1, tags : "About us"); if (objs != null && objs.Count > 0) { var reply = msg.CreateReply($"Welcome to . This is beta release bot for testing purpose to learn user insight better."); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; reply.Attachments = objs.Select(a => new HeroCard { Title = a.Name, Text = a.Description, Images = new List <CardImage> { new CardImage(a.ImageUrl) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, a.Action, value: $"https://airlineticketbotclient.yammobots.com/domain/index?id={a.ID}&airlineid={1}"), } }).ToList().Select(a => a.ToAttachment()).ToList(); await context.PostAsync(reply); } } else if (msg.Text.ToLower().Equals("services")) { var objs = await ServiceApiRequestHelper.Get(hospitalid : 1); var reply = msg.CreateReply($"You are welcome. Learn about our services."); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; var attachments = new List <Attachment>() { new HeroCard { Title = "Book doctor", Text = "Check and make booking", Images = new List <CardImage> { new CardImage(ResourceHelper.buy_ticket_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Book now", value: "https://airlineticketbotclient.yammobots.com/home/index"), } }.ToAttachment(), new HeroCard { Title = "Suggest me", Text = "Let us know your pain and get suggestion", Images = new List <CardImage> { new CardImage(ResourceHelper.ticket_chat_img_url) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.ImBack, "Suggest me", value: "Suggest me"), } }.ToAttachment(), }; if (objs != null && objs.Count > 0) { attachments.AddRange(objs.Select(a => new HeroCard { Title = a.Title, Text = a.Description, Images = new List <CardImage> { new CardImage(a.ImageUrl) }, Buttons = new List <CardAction> { new CardAction(ActionTypes.OpenUrl, "Learn more", value: $"https://airlineticketbotclient.yammobots.com/domain/index?id={a.ID}&airlineid={1}"), new CardAction(ActionTypes.OpenUrl, "Contact now", value: $"tel:{a.Phone}") } }).ToList().Select(a => a.ToAttachment()).ToList()); } reply.Attachments = attachments; await context.PostAsync(reply); } else if (msg.Text.ToLower().Equals("suggest me")) { var hospitals = await HospitalApiRequestHelper.Get(pagesize : 0); var bodyparts = await BodyPartApiRequestHelper.Get(pagesize : 0); var form = new FormDialog <EngFormFlowDialog>(new EngFormFlowDialog(bodyparts, hospitals), EngFormFlowDialog.BuildForm, FormOptions.None, null); await context.Forward(form, ResumeAfterEngFFDialog, msg, CancellationToken.None); return; } context.Wait(MessageReceivedAsync); }