コード例 #1
0
    public List <Finition> getByGamme(Gamme gamme)
    {
        List <Finition> dtos = new List <Finition>();

        using (var db = new maderaEntities())
        {
            var lierFinition = from a in db.FAIRE_PARTIE where a.GAMME_ID.Equals(gamme.Id) select a;
            foreach (var item in lierFinition)
            {
                var      query    = from a in db.FINITION where a.FINITION_ID.Equals(item.FINITION_ID) select a;
                Finition finition = new Finition();
                finition.Id           = query.First().FINITION_ID;
                finition.Nom          = query.First().FINITION_NOM;
                finition.Description  = query.First().FINITION_DESCRIPTION;
                finition.TypeFinition = typeFinitionRepository.GetOne(query.First().TYPE_FINITION_ID);
                var fichier = from a in db.FINITION_IMAGE where a.FINITION_ID.Equals(finition.Id) select a;
                if (fichier.Count() > 0)
                {
                    finition.Image = fichierRepository.GetOne(fichier.First().FICHIER_ID);
                }
                dtos.Add(finition);
            }
        }

        return(dtos);
    }
コード例 #2
0
ファイル: Edit.cshtml.cs プロジェクト: Laox23/TableauPeinture
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Finition = await _context.Finitions.FirstOrDefaultAsync(m => m.FinitionId == id);

            if (Finition == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Finition = await _context.Finitions.FindAsync(id);

            if (Finition != null)
            {
                _context.Finitions.Remove(Finition);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
コード例 #4
0
    protected void BtnConfigurerProduit_Click(object sender, EventArgs e)
    {
        DropDownList selectToit     = (DropDownList)downPanel.FindControl("selectToit");
        int          idFinitionToit = int.Parse(selectToit.SelectedValue);
        Finition     finitionToit   = finitionRepository.getOne(idFinitionToit);

        produitSelectionne.ModeleDeGamme.Finitions.Add(finitionToit);

        DropDownList selectFinitionInterieure = (DropDownList)downPanel.FindControl("selectFinitionInterieure");
        int          idFinitionIntérieure     = int.Parse(selectFinitionInterieure.SelectedValue);
        Finition     finitionIntérieure       = finitionRepository.getOne(idFinitionIntérieure);

        produitSelectionne.ModeleDeGamme.Finitions.Add(finitionIntérieure);

        DropDownList selectFinitionExterieure = (DropDownList)downPanel.FindControl("selectFinitionExterieure");
        int          idFinitionExterieur      = int.Parse(selectFinitionExterieure.SelectedValue);
        Finition     finitionExterieur        = finitionRepository.getOne(idFinitionExterieur);

        produitSelectionne.ModeleDeGamme.Finitions.Add(finitionExterieur);

        DropDownList selectIsolation     = (DropDownList)downPanel.FindControl("selectIsolation");
        int          idFinitionIsolation = int.Parse(selectIsolation.SelectedValue);
        Finition     finitionIsolation   = finitionRepository.getOne(idFinitionIsolation);

        produitSelectionne.ModeleDeGamme.Finitions.Add(finitionIsolation);

        DropDownList selectPlancher     = (DropDownList)downPanel.FindControl("selectPlancher");
        int          idFinitionPlancher = int.Parse(selectPlancher.SelectedValue);
        Finition     finitionPlancher   = finitionRepository.getOne(idFinitionPlancher);

        produitSelectionne.ModeleDeGamme.Finitions.Add(finitionPlancher);

        DropDownList selectHuisseries    = (DropDownList)downPanel.FindControl("selectHuisseries");
        int          idFinitionHuisserie = int.Parse(selectHuisseries.SelectedValue);
        Finition     finitionHuisserie   = finitionRepository.getOne(idFinitionHuisserie);

        produitSelectionne.ModeleDeGamme.Finitions.Add(finitionHuisserie);

        Session["selectedFinition"] = "finitionSelected";
        Session["downPanelId"]      = "panelModule";
        refreshModulePanel((Gamme)Session["selectedGamme"]);
    }
コード例 #5
0
    public Finition getOne(int id)
    {
        Finition dto = new Finition();

        using (var db = new maderaEntities())
        {
            var query = from a in db.FINITION where a.FINITION_ID.Equals(id) select a;
            dto.Id           = query.First().FINITION_ID;
            dto.Nom          = query.First().FINITION_NOM;
            dto.Description  = query.First().FINITION_DESCRIPTION;
            dto.TypeFinition = typeFinitionRepository.GetOne(query.First().TYPE_FINITION_ID);
            var fichier = from a in db.FINITION_IMAGE where a.FINITION_ID.Equals(dto.Id) select a;
            if (fichier.Count() > 0)
            {
                dto.Image = fichierRepository.GetOne(fichier.First().FICHIER_ID);
            }
        }

        return(dto);
    }