示例#1
0
 public ActionResult DeleteOrganization(long id)
 {
     using (AdministrationRepository repo = new AdministrationRepository())
     {
         if (repo.DeleteOrganization(id))
         {
             repo.Save();
             return(View("DeleteOrganizationConfirmation"));
         }
     }
     return(View("Error"));
 }
示例#2
0
        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"));
        }
示例#3
0
        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"));
        }