public void SavePrivacyFlag(PrivacyFlag privacyFlag) { using (SPKTDataContext dc = conn.GetContext()) { if (privacyFlag.PrivacyFlagID > 0) { dc.PrivacyFlags.Attach(privacyFlag, true); } else { dc.PrivacyFlags.InsertOnSubmit(privacyFlag); } dc.SubmitChanges(); } }
public void SavePrivacyFlag(int privacyTypeID, int visibilityID) { foreach (PrivacyFlag flag in _listPrivacyFlags) { if (flag.PrivacyFlagTypeID == privacyTypeID) { flag.VisibilityLevelID = visibilityID; _privacyRepository.SavePrivacyFlag(flag); return; } } PrivacyFlag newFlag = new PrivacyFlag(); newFlag.PrivacyFlagTypeID = privacyTypeID; newFlag.VisibilityLevelID = visibilityID; newFlag.ProfileID = profile.ProfileID; newFlag.CreateDate = DateTime.Now; _listPrivacyFlags.Add(newFlag); _privacyRepository.SavePrivacyFlag(newFlag); }
public static string ModifyGroup(int groupId, string name, PrivacyFlag flag) { bool p = flag == PrivacyFlag.Private ? false : true; NameValueCollection parameters = new NameValueCollection(); parameters.Add("name", name); parameters.Add("private", p.ToString()); string response = Yammer.APIWrapper.HttpUtility.Put(Resources.Groups.Modify(groupId.ToString()), parameters); return response; }
public void Modify(string name, PrivacyFlag flag) { Group.ModifyGroup(int.Parse(this._group.Id), name, flag); this._group.Name = name; this._group.Privacy = flag.ToString().ToLower(); }
public static string CreateGroup(string name, PrivacyFlag flag) { Group g = null; bool p = flag == PrivacyFlag.Private ? true : false; NameValueCollection parameters = new NameValueCollection(); parameters.Add("name", name); parameters.Add("private", p.ToString().ToLower()); string response = Yammer.APIWrapper.HttpUtility.Post(Resources.Groups.Create, parameters, true); return response; }
public static Group ModifyGroup(int groupId, string name, PrivacyFlag flag) { bool p = flag == PrivacyFlag.Private ? false : true; NameValueCollection parameters = new NameValueCollection(); parameters.Add("name", name); parameters.Add("private", p.ToString()); string response = Json.ModifyGroup(groupId, name, flag); return Yammer.APIWrapper.Group.GetGroupById(groupId); }
public static Group CreateGroup(string name, PrivacyFlag flag) { Group g = null; string response = Json.CreateGroup(name, flag); Uri uri; bool successful = Uri.TryCreate(response, UriKind.Absolute, out uri); if (successful) { string groupId = uri.Segments[uri.Segments.Length - 1]; g = Yammer.APIWrapper.Group.GetGroupById(int.Parse(groupId)); } return g; }