public ActionResult Create(CentreViewModel centreViewModel) { var organisationId = UserOrganisationId; if (ModelState.IsValid) { centreViewModel.Centre = EgharpayBusinessService.CreateCentre(UserOrganisationId, centreViewModel.Centre); return(RedirectToAction("Index")); } return(View(centreViewModel)); }
// protected int UserEnquiryId => ApplicationUser?.EnquiryId?? 0; protected override void OnActionExecuted(ActionExecutedContext filterContext) { var viewModel = filterContext.Controller.ViewData.Model as BaseViewModel; if (viewModel != null) { var organisation = UserManager.TenantOrganisation; viewModel.OrganisationName = organisation?.Name ?? string.Empty; viewModel.CentreName = EgharpayBusinessService.RetrieveCentre(UserOrganisationId, UserCentreId, e => true)?.Name ?? viewModel.OrganisationName; viewModel.PersonnelId = UserPersonnelId; viewModel.CentreId = UserCentreId; // viewModel.EnquiryId = UserEnquiryId; } base.OnActionExecuted(filterContext); }
// GET: Centre/Edit/{id} public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var centre = EgharpayBusinessService.RetrieveCentre(UserOrganisationId, id.Value); if (centre == null) { return(HttpNotFound()); } var viewModel = new CentreViewModel { Centre = centre }; return(View(viewModel)); }
public ActionResult Index() { var organisationId = UserOrganisationId; var personnelId = UserPersonnelId; var centreId = UserCentreId; bool isSuperAdmin = User.IsSuperAdmin(); var permissions = EgharpayBusinessService.RetrievePersonnelPermissions(User.IsInRole("Admin"), organisationId, personnelId); if (User.IsInRole("User") && !permissions.IsManager) { return(RedirectToAction("Profile", "Personnel", new { id = personnelId })); } var viewModel = new HomeViewModel { Permissions = permissions, }; return(View(viewModel)); }
public ActionResult Create() { var centres = EgharpayBusinessService.RetrieveCentres(UserOrganisationId, e => true); var viewModel = new PersonnelProfileViewModel { Centres = new SelectList(centres, "CentreId", "Name"), Personnel = new Personnel { OrganisationId = UserOrganisationId, DOB = DateTime.Today, Title = "Mr", Forenames = "A", Surname = "B", Email = string.Format("{0}@hr.com", Guid.NewGuid()), Address1 = "Address1", Postcode = "POST CODE", Telephone = "12345678", }, }; return(View(viewModel)); }
public ActionResult DocumentTypes() { return(this.JsonNet(EgharpayBusinessService.RetrieveDocumentTypes(UserOrganisationId))); }
public ActionResult Download(Guid id) { var document = EgharpayBusinessService.RetrieveDocument(UserOrganisationId, id); return(File(System.IO.File.ReadAllBytes(document.Location), "application/pdf", document.FileName)); }
public ActionResult StudentDocument(string studentCode, Paging paging, List <OrderBy> orderBy) { return(this.JsonNet(EgharpayBusinessService.RetrieveDocuments(UserOrganisationId, e => e.CentreId == UserCentreId && e.StudentCode == studentCode, orderBy, paging))); }
public ActionResult List(Paging paging, List <OrderBy> orderBy) { return(this.JsonNet(EgharpayBusinessService.RetrieveCentres(UserOrganisationId, orderBy, paging))); }
public ActionResult GetCentres() { var data = EgharpayBusinessService.RetrieveCentres(UserOrganisationId); return(this.JsonNet(data)); }