public static bool UpdateSocial(DBO.Social social) { using (IziWatchEntities bdd = new IziWatchEntities()) { try { T_Social t_social = bdd.T_Social.Where(x => x.id == social.Id).FirstOrDefault(); if (t_social != null) { t_social.id = social.Id; t_social.type = social.Type; t_social.account = social.Account; t_social.identifier = social.Identifier; bdd.SaveChanges(); return(true); } else { return(false); } } catch (Exception e) { return(false); } } }
public static bool CreateSocial(DBO.Social social) { using (IziWatchEntities bdd = new IziWatchEntities()) { try { T_Social t_social = new T_Social() { id = social.Id, type = social.Type, account = social.Account, identifier = social.Identifier }; bdd.T_Social.Add(t_social); bdd.SaveChanges(); return(true); } catch (Exception e) { return(false); } } }