public async Task <ActionResult> CreateAppointment(string start, string end, string subject, string resourceId, int orderId, int joblabel, int tenantId) { if (!caSession.AuthoriseSession()) { return(Json(new { Message = "You are not authorised to perofrm this operation" })); } var appointment = _appointmentsService.CreateAppointment(start, end, subject, resourceId, orderId, joblabel, tenantId); if (appointment != null) { var order = OrderService.UpdateOrderStatus(orderId, 6, CurrentUserId); var result = await _emailNotificationsHelper.CreateTenantEmailNotificationQueue($"#{order.OrderNumber} - Works order scheduled", Mapper.Map(order, new OrderViewModel()), worksOrderNotificationType : WorksOrderNotificationTypeEnum.WorksOrderScheduledTemplate, appointment : appointment, sendImmediately : false); if (result != "Success") { ViewBag.Error = result; } } // send resources as per filter values var selectedJobType = int.Parse(!string.IsNullOrEmpty(Request.Params["SelectedJobType"]) ? Request.Params["SelectedJobType"] : "0"); Session["selectedJobType"] = selectedJobType; return(PartialView("_SchedulerPartial", AppointmentsSchedulerSettings.DataObject)); }