public ActionResult Delete(int id) { if (User.Identity.Name == "") { return(RedirectToAction("ErrorLogin", "Home")); } Organisation organisation = DAOrganisation.GetOrganisationById(id); return(View(organisation)); }
public ActionResult Register(int id) { if (User.Identity.Name == "") { return(RedirectToAction("ErrorLogin", "Home")); } ViewBag.Register = DAOrganisationRegister.GetOrganisationRegisterById(id); ViewBag.Organisation = DAOrganisation.GetOrganisationById(id); return(View()); }
public ActionResult Edit(int id) { if (User.Identity.Name == "") { return(RedirectToAction("ErrorLogin", "Home")); } PMOrganisation organisation = DAOrganisation.GetOrganisationById(id); ViewBag.Organisation = organisation; ViewBag.Id = id; return(View(organisation)); }
// GET: Vereniging public ActionResult Index() { if (User.Identity.Name == "") { return(RedirectToAction("ErrorLogin", "Home")); } List <Organisation> organisations = DAOrganisation.GetOrganisations(); ViewBag.Organisations = organisations; return(View()); }
public ActionResult Edit(PMOrganisation organisation, int id) { if (User.Identity.Name == "") { return(RedirectToAction("ErrorLogin", "Home")); } if (ModelState.IsValid) { DAOrganisation.UpdateOrganisation(id, organisation); return(RedirectToAction("Index")); } return(RedirectToAction("Edit", new { organisation = organisation, id = id })); }
public ActionResult NewRegister(int id) { if (User.Identity.Name == "") { return(RedirectToAction("ErrorLogin", "Home")); } PMOrganisationRegister organisationRegister = new PMOrganisationRegister(); organisationRegister.NewRegister = new MultiSelectList(DARegister.GetRegisters(), "Id", "RegisterName", "Device"); organisationRegister.OrganisationID = id; ViewBag.Organisation = DAOrganisation.GetOrganisationById(id); return(View(organisationRegister)); }
public ActionResult NewOrganisation(PMOrganisation organisation) { if (User.Identity.Name == "") { return(RedirectToAction("ErrorLogin", "Home")); } if (ModelState.IsValid) { if (DAOrganisation.InsertOrganisation(organisation) < 0) { return(View(organisation)); } return(RedirectToAction("Index")); } return(View(organisation)); }
public ActionResult EditRegister(int organisationID, int registerID) { if (User.Identity.Name == "") { return(RedirectToAction("ErrorLogin", "Home")); } PMOrganisationRegister organisationRegister = new PMOrganisationRegister(); organisationRegister.NewOrganisation = new MultiSelectList(DAOrganisation.GetOrganisations(), "Id", "OrganisationName"); OrganisationRegister or = DAOrganisationRegister.GetOrganisationRegisterByIds(organisationID, registerID); organisationRegister.Device = or.Device; organisationRegister.FromDate = or.FromDate; organisationRegister.Login = or.Login; organisationRegister.OrganisationID = or.OrganisationID; organisationRegister.OrganisationName = or.OrganisationName; organisationRegister.RegisterID = or.RegisterID; organisationRegister.RegisterName = or.RegisterName; organisationRegister.UntilDate = or.UntilDate; ViewBag.Organisation = DAOrganisation.GetOrganisationById(organisationID); ViewBag.oldId = organisationID; return(View(organisationRegister)); }
public ActionResult DeleteItem(int Id) { DAOrganisation.DeleteOrganisation(Id); return(RedirectToAction("Index")); }