コード例 #1
0
        public IActionResult AddValues(int id)
        {
            var newCreateValueVM = new CreateValueViewModel()
            {
                IdTable     = id,
                ListeChamps = ChampsService.GetChampsFromTable(id).Select(w => new ChampsCreateValueViewModel()
                {
                    Id  = w.Id,
                    Nom = w.Name,
                }).ToList(),
            };

            return(View(newCreateValueVM));
        }
コード例 #2
0
        public IActionResult DeleteChampsToTable(int id)
        {
            var champs = new TableForDeleteChampsViewModel
            {
                Id          = id,
                ListeChamps = ChampsService.GetChampsFromTable(id).Select(w => new ChampViewModel
                {
                    Id  = w.Id,
                    Nom = w.Name,
                }).ToList()
            };

            return(View(champs));
        }
コード例 #3
0
        /// <summary>
        /// Montre les champs et les valeurs d'une table pour un utilisateur séléctionné
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public IActionResult TableIndex(int id)
        {
            var indexTable = new IndexTableViewModel()
            {
                NameTable   = TableService.GetTableById(id).Nom,
                ListeChamps = ChampsService.GetChampsFromTable(id).Select(p => new ChampViewModel
                {
                    Id  = p.Id,
                    Nom = p.Name,
                }).ToList(),
                ListeLiaison = LiaisonValueService.GetAllLiaison().Where(p => p.IdTable == id).Select(w => new LiaisonTableIndexViewModel
                {
                    Id         = w.Id,
                    ListeValue = ValueService.GetValueFromLiaison(w.Id).Select(a => new ValuesViewModel
                    {
                        Nom      = a.Name,
                        IdChamps = a.ChampsId
                    }).ToList(),
                }).ToList(),
            };

            return(View(indexTable));
        }