// GET: OrganisationOverview
        public ActionResult ListOrganisations()
        {
            List <Organisation> lstOrganisations = OrganisationDA.GetOrganisations();

            ViewBag.Organisations = lstOrganisations;
            return(View());
        }
        public ActionResult ShowAssignedRegisters()
        {
            List <Organisation>          oList  = OrganisationDA.GetOrganisations();
            List <RegistersOrganisation> orList = Register_OrganisationDA.GetOrganisation_Registers();
            List <Register> registers           = new List <Register>();



            List <Register>[] rList = new List <Register> [oList.Count]; int i = 0;
            for (i = 0; i < rList.Length; i++)
            {
                rList[i] = new List <Register>();
            }
            i = 0;

            foreach (Organisation o in oList)
            {
                foreach (RegistersOrganisation or in orList)
                {
                    if (or.Organisationid == o.ID)
                    {
                        rList[i].Add(RegisterDA.GetRegisters(or.RegisterId));
                    }
                }
                i++;
            }

            ViewBag.Organisations = oList;
            ViewBag.Registers     = rList;
            return(View());
        }
        public ActionResult EditOrganisation()
        {
            List <RegisterPM>    AllRegisters     = RegistersDA.GetRegisterPM();
            List <Organisations> AllOrganisations = OrganisationDA.GetOrganisations();

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

            return(View());
        }
        public ActionResult Edit(int id)
        {
            Organisation o = OrganisationDA.GetOrganisations(id);

            o.Login      = Cryptography.Decrypt(o.Login);
            o.Password   = Cryptography.Decrypt(o.Password);
            o.DbName     = Cryptography.Decrypt(o.DbName);
            o.DbLogin    = Cryptography.Decrypt(o.DbLogin);
            o.DbPassword = Cryptography.Decrypt(o.DbPassword);
            return(View(o));
        }
        public ActionResult ViewErrorlog(int regid, int orgid)
        {
            Organisation o = new Organisation();

            o = OrganisationDA.GetOrganisations(orgid);
            ViewBag.register = regid;
            ErrorlogDA.ChangeConnectionString("System.Data.SqlClient", "MCT-NIELS" + @"\DATAMANAGEMENT", Cryptography.Decrypt(o.DbName), Cryptography.Decrypt(o.DbLogin), Cryptography.Decrypt(o.DbPassword));
            List <Errorlog> errorlist = new List <Errorlog>();

            errorlist = ErrorlogDA.GetErrorlogs(regid);

            return(View(errorlist));
        }
        private List <SelectListItem> GetOrganisations()
        {
            List <SelectListItem> items = new List <SelectListItem>();

            foreach (Organisation org in OrganisationDA.GetOrganisations())
            {
                items.Add(new SelectListItem()
                {
                    Value = org.ID.ToString(), Text = org.OrganisationName
                });
            }

            return(items);
        }
        public ActionResult AssignRegister(int id)
        {
            List <Organisation> list = OrganisationDA.GetOrganisations();

            foreach (Organisation o in list)
            {
                o.Login      = Cryptography.Decrypt(o.Login);
                o.Password   = Cryptography.Decrypt(o.Password);
                o.DbLogin    = Cryptography.Decrypt(o.DbLogin);
                o.DbName     = Cryptography.Decrypt(o.DbName);
                o.DbPassword = Cryptography.Decrypt(o.DbPassword);
            }
            ViewBag.Register = id;
            return(View(list));
        }
Beispiel #8
0
        public ActionResult Create()
        {
            OrganisationRegister organistationRegister = new OrganisationRegister();

            //bij het toevoegen van een nieuw register
            //bij gekocht op: dag van vandaag invullen en bij vervalt op: vijf jaar later
            RegisterCompany register = new RegisterCompany()
            {
                PurchaseDate = DateTime.Today,
                ExpiresDate  = DateTime.Today.AddYears(5)
            };

            organistationRegister.Register = register;

            ViewBag.Organisations = OrganisationDA.GetOrganisations();

            return(View(organistationRegister));
        }
Beispiel #9
0
        public ActionResult Edit(int?id)
        {
            if (!id.HasValue)
            {
                return(RedirectToAction("Index"));
            }

            OrganisationRegister organisationRegister = RegisterDA.GetRegisterByID(id.Value);

            if (organisationRegister.ID == 0)
            {
                return(RedirectToAction("Index"));
            }

            ViewBag.Organisations = OrganisationDA.GetOrganisations();

            return(View(organisationRegister));
        }
        public ActionResult AssignToOrganisation(int regid, int orgid)
        {
            RegistersOrganisation ro = new RegistersOrganisation()
            {
                RegisterId = regid, Organisationid = orgid, From = DateTime.Now.Date, Untill = DateTime.Now.Date.AddYears(10)
            };

            Register_OrganisationDA.InsertOrganisation_Register(ro);
            Register_OrganisationDA.ModifyRegisterAssignValue(regid);
            Organisation o = OrganisationDA.GetOrganisations(orgid);
            Register     r = RegisterDA.GetRegisters(regid);


            RegisterClientDAcs.ChangeConnectionString("System.Data.SqlClient", "MCT-NIELS" + @"\DATAMANAGEMENT", Cryptography.Decrypt(o.DbName), Cryptography.Decrypt(o.DbLogin), Cryptography.Decrypt(o.DbPassword));
            RegisterClientDAcs.InsertRegister(r);



            return(View("Succeeded"));
        }
Beispiel #11
0
        //geen httpget of httppost bijzetten --> eerste keer laden: get, inladen met dropdownlist --> post
        public ActionResult Index(string sort)
        {
            List <OrganisationRegister> organisationsRegisters = new List <OrganisationRegister>();

            organisationsRegisters = RegisterDA.GetOrganisationsWithRegisters();

            //vereniging die geen vereniging is niet in viewbag plaatsen
            //--> wordt handmatig in dropdownlist (view) geplaatst voor beter naamgeving
            ViewBag.Organisations = OrganisationDA.GetOrganisations().Where(r => r.ID != -1);

            //bij het opstarten en bij het klikken op alle kassa's --> alles weergeven
            if (sort == null || sort == "allRegisters")
            {
                ViewBag.titleRegisters = "Alle kassa's";
                return(View(organisationsRegisters));

                //bij het klikken op beschikbare kassa's --> enkel records weergeven zonder organisatie
            }
            else if (sort == "availableRegisters")
            {
                ViewBag.titleRegisters = "Beschikbare kassa's";
                return(View(organisationsRegisters.Where(or => or.Organisation.ID == -1)));

                //standaard sorteren op de aangeklikte organisatie
            }
            else
            {
                Organisation organisation = OrganisationDA.GetOrganisationByID(Convert.ToInt32(sort));
                if (organisation == null)
                {
                    return(RedirectToAction("Index"));
                }

                ViewBag.titleRegisters = "Kassa's van vereniging " + organisation.OrganisationName;
                return(View(organisationsRegisters.Where(or => or.Organisation.ID == Convert.ToInt32(sort))));
            }
        }
Beispiel #12
0
        // GET: Organisation
        public ActionResult Index()
        {
            List <Organisation> organisations = OrganisationDA.GetOrganisations();

            return(View(organisations));
        }
Beispiel #13
0
        public ActionResult Index()
        {
            List <Organisations> list = OrganisationDA.GetOrganisations();

            return(View(list));
        }
Beispiel #14
0
 public ActionResult Index()
 {
     //vereniging die geen vereniging voorstel niet tonen
     return(View(OrganisationDA.GetOrganisations().Where(r => r.ID != -1)));
 }
Beispiel #15
0
 // GET: api/Organisation
 public List <Organisation> Get()
 {
     return(OrganisationDA.GetOrganisations());
 }