示例#1
0
 public bool AddBlockSuperTargetUser(SuperTargetUserVM user)
 {
     try
     {
         var acc = _socialMediaRepo.Get().Include(x => x.AccSettings).Include(x => x.AccSettings.SuperTargetUser).Where(x => x.Id == user.SocailId).FirstOrDefault();
         if (acc.AccSettings == null)
         {
             acc.AccSettings = new AccSettings();
         }
         var check = acc.AccSettings.SuperTargetUser.Where(x => x.SMId.ToString() == user.SMId.ToString()).FirstOrDefault();
         if (check == null)
         {
             acc.AccSettings.SuperTargetUser.Add(new SuperTargetUser {
                 IsBlocked = user.IsBlocked, UserName = user.UserName, SMId = user.SMId.ToString(), Followers = user.Followers
             });
             _unitOfWork.Commit();
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#2
0
 public ActionResult AddBlockSuperTargetUser(SuperTargetUserVM user)
 {
     try
     {
         var result = _twitterService.AddBlockSuperTargetUser(user);
         return(Json(new { status = result }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json(new { status = false }, JsonRequestBehavior.AllowGet));
     }
 }