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 ShowAvailableRegisters()
        {
            List <Register> lijst = RegisterDA.GetRegisters();

            if (lijst.Count > 0)
            {
                return(View(lijst));
            }
            else
            {
                return(View("Error"));
            }
        }
        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"));
        }
 public List <Registers> Get()
 {
     return(RegisterDA.GetRegisters());
 }
示例#5
0
        public List <RegisterClient> Get()
        {
            ClaimsPrincipal p = RequestContext.Principal as ClaimsPrincipal;

            return(RegisterDA.GetRegisters(p.Claims));
        }
        public ActionResult Index()
        {
            List <OrganisationRegister> registers = RegisterDA.GetRegisters();

            return(View(registers));
        }