Beispiel #1
0
        public async Task<int> SavePanel(Panel panel)
        {
            if (panel.PanelID == 0)
            {
                context.Panels.Add(panel);
            }
            else
            {
                Panel dbentry = context.Panels.Find(panel.PanelID);
                if (dbentry != null)
                {
                    dbentry.Libelle = panel.Libelle;
                    dbentry.Acces = panel.Acces;
                    dbentry.Contact = panel.Contact;
                    dbentry.Typologie_Panel = panel.Typologie_Panel;
                    dbentry.Laboratoire = panel.Laboratoire;
                    dbentry.Domicile = panel.Domicile;
                    //dbentry.Ouverture = panel.Ouverture;
                    //dbentry.Lieu = panel.Lieu;
                   
                }
            }

            return await context.SaveChangesAsync();
        }
Beispiel #2
0
        public async Task<IHttpActionResult> PostCommunaute(Panel panel)
        {
            try
            {
                await repositoryPanel.SavePanel(panel);
            }
            catch (Exception er)
            {

            }
            return Ok();
        }