public async Task <ActionResult> ServiceStaff(string serviceName) { serviceID = Convert.ToInt32(serviceName); selectedServiceName = serviceName; if (Session["loginUserID"] == null) { TempData["error"] = "Null"; return(RedirectToAction("Index", "Home")); } Session.Timeout = 1000; //ServicesController serviceController = new ServicesController(); //Response<Service> responceService = new Response<Service>(); //responceService = await serviceController.GetServicebyName(serviceName); Response <CommunityService> responceCommunityService = new Response <CommunityService>(); CommunityServicesController communityServicesController = new CommunityServicesController(); responceCommunityService = await communityServicesController.GetCommunityService(serviceID); Response <List <ServiceStaff> > responceServiceStaff = new Response <List <ServiceStaff> >(); ServiceStaffsController serviceStaffController = new ServiceStaffsController(); responceServiceStaff = await serviceStaffController.GetServiceStaffbyService(serviceID, Convert.ToInt32(Session["loginCommunityID"].ToString())); ServiceStaffDTO serviceStaffDTO = new ServiceStaffDTO(); serviceStaffDTO.serviceStaffList = responceServiceStaff.model; serviceStaffDTO.serviceName = responceCommunityService.model.serviceName; serviceID = responceCommunityService.model.communityServiceID; return(View(serviceStaffDTO)); }
public async Task <ActionResult> EditCommunityServices(string serviceName, string imageURL, int communityServiceID) { if (Session["loginUserID"] == null) { TempData["error"] = "Null"; return(RedirectToAction("Index", "Home")); } Session.Timeout = 1000; CommunityServicesController communityServicesController = new CommunityServicesController(); Response <CommunityService> responcePostCommunityService = new Response <CommunityService>(); responcePostCommunityService = await communityServicesController.GetCommunityService(communityServiceID); CommunityService communityService = new CommunityService(); communityService = responcePostCommunityService.model; communityService.communityID = Convert.ToInt32(Session["loginCommunityID"].ToString()); communityService.icon = imageURL; communityService.serviceName = serviceName; responcePostCommunityService = await communityServicesController.PutCommunityService(communityServiceID, communityService); //Response<List<CommunityService>> responceCommunityService = new Response<List<CommunityService>>(); //responceCommunityService =await communityServicesController.GetServicebyCommunityID(Convert.ToInt32(Session["loginCommunityID"].ToString())); return(Json(new { CommunityServiceID = responcePostCommunityService.model.communityServiceID })); }
//-------------------------------------------------------Services Controllers------------------------------------------------------------ public async Task <ActionResult> Services(int?communityId) { if (Session["loginUserID"] == null) { TempData["error"] = "Null"; return(RedirectToAction("Index", "Home")); } Session.Timeout = 1000; CommunitiesController communitiesController = new CommunitiesController(); List <Community> communitiesList = new List <Community>(); communitiesList = await communitiesController.GetAllCommunities(); if (communityId == null) { if (communitiesList.Count != 0) { Session["loginCommunityID"] = communitiesList.FirstOrDefault().communityID; } else { Session["loginCommunityID"] = 0; } } else { Session["loginCommunityID"] = communityId; } CommunityServicesController communityServicesController = new CommunityServicesController(); Response <List <CommunityService> > responceCommunityService = new Response <List <CommunityService> >(); Response <List <Service> > responceCommunityRemainingService = new Response <List <Service> >(); //comunity Selected Services responceCommunityService = await communityServicesController.GetServicebyCommunityID(Convert.ToInt32(Session["loginCommunityID"].ToString())); //comunity Remaining Services responceCommunityRemainingService = await communityServicesController.GetRemainingServiceOfCommunityID(Convert.ToInt32(Session["loginCommunityID"].ToString()), 1); ServiceDTO serviceDTO = new ServiceDTO(); serviceDTO.selectedServices = responceCommunityService.model; serviceDTO.remainingServices = responceCommunityRemainingService.model; DirectoryImagesController directoryImagesController = new DirectoryImagesController(); Response <List <DirectoryImages> > responceDirectoryImage = new Response <List <DirectoryImages> >(); responceDirectoryImage = directoryImagesController.GetAllDirectoryImages(); serviceDTO.directoryImage = responceDirectoryImage.model; Response <List <CommunityServiceWithServiceIdDTO> > responceCommunityServiceWithServiceIdDTO = new Response <List <CommunityServiceWithServiceIdDTO> >(); responceCommunityServiceWithServiceIdDTO = await communityServicesController.GetServicebyWithServiceID(Convert.ToInt32(Session["loginCommunityID"].ToString()), 1); serviceDTO.CommunityServiceWithServiceIdDTOList = responceCommunityServiceWithServiceIdDTO.model; serviceDTO.communitieslist = communitiesList; serviceDTO.emergencyContactRange = communitiesController.GetCommunitybyID(Convert.ToInt32(Session["loginCommunityID"].ToString())).model.emergencyContactRange; return(View(serviceDTO)); }
public async Task <ActionResult> RemoveCommunityServices(int CommunityServiceID) { if (Session["loginUserID"] == null) { TempData["error"] = "Null"; return(RedirectToAction("Index", "Home")); } Session.Timeout = 1000; CommunityServicesController communityServicesController = new CommunityServicesController(); Response <CommunityService> responcePostCommunityService = new Response <CommunityService>(); await communityServicesController.DeleteCommunityService(CommunityServiceID); //Response<List<CommunityService>> responceCommunityService = new Response<List<CommunityService>>(); //responceCommunityService =await communityServicesController.GetServicebyCommunityID(Convert.ToInt32(Session["loginCommunityID"].ToString())); return(Json(new { Success = "success" })); }