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));
        }
        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 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));
        }