Exemple #1
0
 public void AddProfileAction(ProfileAction addAction)
 {
     Profile profile = context.Profiles.Where(m => m.ProfileId == addAction.ProfileId).FirstOrDefault();
     if (profile != null)
     {
         addAction.Date = addAction.Date != null ? addAction.Date : DateTime.Now;
         context.ProfileActions.Add(addAction);
         context.SaveChanges();
     }
 }
Exemple #2
0
        public ActionResult AddAction(ProfileAction value)
        {
            LoadProfileActionResult result = new LoadProfileActionResult();

            if ((value != null) && (user.ProfileId == value.ProfileWhoId))
            {
                value.Date = DateTime.Now;
                ProfileRepository.AddProfileAction(value);
            }
            result.CommentsCount = commentsCount;
            result.Profile = ProfileRepository.GetProfile(user.ProfileId);
            result.ProfileAction = ProfileRepository.GetProfileAction(value.ProfileActionId);
            result.ProfileActionComments = new List<ProfileActionComment>();
            return PartialView("LoadAction", result);
        }
Exemple #3
0
 public void RemoveAction(ProfileAction value)
 {
     ProfileAction check = ProfileRepository.GetProfileAction(value.ProfileActionId);
     if ((check!=null)&&(user.ProfileId == check.ProfileWhoId) || (user.ProfileId == check.ProfileId))
     {
         ProfileRepository.RemoveProfileAction(value.ProfileActionId);
     }
 }