public ActionResult DeleteOrganization(long id) { using (AdministrationRepository repo = new AdministrationRepository()) { if (repo.DeleteOrganization(id)) { repo.Save(); return(View("DeleteOrganizationConfirmation")); } } return(View("Error")); }
public ActionResult CreateEmployee(Employee employee) { bool success = false; if (ModelState.IsValid) { using (AdministrationRepository repo = new AdministrationRepository()) { success = repo.CreateEmployee(employee); repo.Save(); if (success) { View("CreateEmployeeConfirmation"); } } } return(View("Error")); }
public ActionResult CreateOrganization(Organization organization) { if (ModelState.IsValid) { using (AdministrationRepository repo = new AdministrationRepository()) { string asp_id = User.Identity.GetUserId(); Employee e = repo.GetEmployeeByAspId(asp_id); organization.CreatedBy = e.Id; bool success = repo.CreateOrganization(organization); repo.Save(); if (success) { return(View("CreateOrganizationConfirmation")); } } } return(View("Error")); }