/// <summary> /// Recherche des entités /// </summary> /// <param name="form"></param> /// <returns></returns> public List <Entity> SearchEntity(FORM.EntityForm form) { Dictionary <string, object> insaddr = new Dictionary <string, object>(); if (!string.IsNullOrWhiteSpace(form.EntityLabel)) { insaddr.Add("EntityLabel", form.EntityLabel); } return(base.GetListAllDefault <Entity>(paramKeySearch: insaddr)); }
/// <summary> /// Creation Entité /// </summary> /// <param name="form">Poco</param> /// <returns></returns> public Entity CreateEntity(FORM.EntityForm form) { try { Entity nouveau = new Entity(); nouveau.EntityLabel = form.EntityLabel; nouveau.IDCentity = form.IDCEntity; // Insert base.InsertBubble(nouveau);//, false, true); return(nouveau); } catch (Exception ex) { throw new Exception("CreateEntity" + ex.Message, ex); } }
/// <summary> /// Mise à jour /// </summary> /// <param name="form"></param> /// <returns></returns> public Entity UpdateEntity(FORM.EntityForm form) { try { Entity retour = this.GetEntity(form.IDCEntity); if (retour == null) { throw new Exception("Adresse not found"); } retour.EntityLabel = form.EntityLabel; base.SaveBubble(retour); retour = this.GetEntity(form.IDCEntity); return(retour); } catch (Exception ex) { throw new Exception("UpdateAdresse " + ex.Message, ex); } }