Exemple #1
0
 public void SavePrivacyFlag(PrivacyFlag privacyFlag)
 {
     using (SPKTDataContext spktDC = conn.GetContext())
     {
         if (privacyFlag.PrivacyFlagID > 0)
         {
             spktDC.PrivacyFlags.Attach(privacyFlag, true);
         }
         else
         {
             spktDC.PrivacyFlags.InsertOnSubmit(privacyFlag);
         }
         spktDC.SubmitChanges();
     }
 }
Exemple #2
0
 partial void DeletePrivacyFlag(PrivacyFlag instance);
Exemple #3
0
 partial void UpdatePrivacyFlag(PrivacyFlag instance);
Exemple #4
0
 partial void InsertPrivacyFlag(PrivacyFlag instance);
Exemple #5
0
		private void detach_PrivacyFlags(PrivacyFlag entity)
		{
			this.SendPropertyChanging();
			entity.VisibilityLevel = null;
		}
Exemple #6
0
		private void detach_PrivacyFlags(PrivacyFlag entity)
		{
			this.SendPropertyChanging();
			entity.Profile = null;
		}
Exemple #7
0
		private void attach_PrivacyFlags(PrivacyFlag entity)
		{
			this.SendPropertyChanging();
			entity.Profile = this;
		}
        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);
        }