public ActionResult EditOrganisation()
        {
            List <RegisterPM>    AllRegisters     = RegistersDA.GetRegisterPM();
            List <Organisations> AllOrganisations = OrganisationDA.GetOrganisations();

            ViewBag.Registers     = AllRegisters;
            ViewBag.Organisations = AllOrganisations;

            return(View());
        }
        public ActionResult Create(Registers r)
        {
            int validInsert = RegistersDA.InsertRegisters(r);

            if (validInsert != 0)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
 public ActionResult Edit(Registers r)
 {
     if (r.Device != null & r.RegisterName != null & r.PurchaseDate != null & r.ExpiresDate != null)
     {
         int validUpdate = RegistersDA.UpdateRegisters(r);
         if (validUpdate != 0)
         {
             return(RedirectToAction("Index"));
         }
     }
     return(View());
 }
 public ActionResult Edit(int?id)
 {
     if (id != null)
     {
         Registers r = RegistersDA.GetRegister(Convert.ToInt32(id));
         return(View(r));
     }
     else
     {
         return(RedirectToAction("Index"));
     }
 }
 public ActionResult Search(int?id)
 {
     if (id != null)
     {
         Organisations o = OrganisationDA.GetOrganisation(Convert.ToInt32(id));
         ViewBag.Titel = "Kassas voor " + o.OrganisationName;
         List <RegisterPM> list = RegistersDA.GetRegistersPM(o.ID);
         return(View(list));
     }
     else
     {
         return(RedirectToAction("Index", "Organisations"));
     }
 }
        public ActionResult EditOrganisation(int kassa, int vereniging)
        {
            RegisterPM r = RegistersDA.GetRegisterPM(kassa);
            int        OldOrganisation;

            if (r.Vereniging != null)
            {
                OldOrganisation = r.Vereniging.ID;
            }
            else
            {
                OldOrganisation = 0;
            }

            int validUpdate  = RegistersDA.InsertRegisterPM(kassa, vereniging);
            int validUpdate2 = RegistersDA.UpdateOrganisationDatabase(kassa, vereniging, OldOrganisation);

            if (validUpdate > 0 & validUpdate2 > 0)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
        public ActionResult Index()
        {
            List <RegisterPM> list = RegistersDA.GetRegisterPM();

            return(View(list));
        }