示例#1
0
 public static void SavePrivacyFlag(PrivacyFlag privacyFlag)
 {
     if (privacyFlag.PrivacyFlagID > 0)
         PrivacyFlag.Update(privacyFlag);
     else
         PrivacyFlag.Add(privacyFlag);
 }
 public void SavePrivacyFlag(int privacyFlagTypeID, int visibilityLevelID)
 {
     foreach (var flag in privacyFlags)
     {
         if (flag.PrivacyFlagTypeID == privacyFlagTypeID)
         {
             flag.VisibilityLevelID = visibilityLevelID;
             PrivacyFlag.SavePrivacyFlag(flag);
             return;
         }
     }
     PrivacyFlag newFlag = new PrivacyFlag();
     newFlag.PrivacyFlagTypeID = privacyFlagTypeID;
     newFlag.VisibilityLevelID = visibilityLevelID;
     newFlag.ProfileID = profile.ProfileID;
     newFlag.CreateDate = DateTime.Now;
     privacyFlags.Add(newFlag);
     PrivacyFlag.SavePrivacyFlag(newFlag);
 }