Exemple #1
0
 private void SaveFancyApps(string[] roleAppTag)
 {
     var userid = GetCookie().FirstOrDefault();
     var fancyApps = this._userFancyAppService.GetUserFancyAppByUserId(int.Parse(userid)).ToList();
     this._userFancyAppService.Delete(fancyApps);
     var ufs = new List<UserFancyApp>();
     roleAppTag.ToList().ForEach(m =>
     {
         var model = new UserFancyApp { UserId = int.Parse(userid), AppId = int.Parse(m), AddTime = DateTime.Now };
         ufs.Add(model);
     });
     this._userFancyAppService.Add(ufs);
 }
Exemple #2
0
 private void SaveNewAddedUerFancyApp(UserProfile user)
 {
     var d = this._roleAppService.GetRoleAppByRoleId(2).Select(m => m.AppId);
     var ufs = new List<UserFancyApp>();
     d.ToList().ForEach(s =>
     {
         var model1 = new UserFancyApp { UserId = user.Id, AppId = s, AddTime = DateTime.Now, DisplayOrder = 0 };
         ufs.Add(model1);
     });
     this._userFancyAppService.Add(ufs);
 }
Exemple #3
0
 private void SaveUserFancies(string[] roleAppTag, string[] userTag)
 {
     userTag.ToList().ForEach(m =>
     {
         var ufs = new List<UserFancyApp>();
         roleAppTag.ToList().ForEach(s=>
         {
             var model = new UserFancyApp { UserId = int.Parse(m), AppId = int.Parse(s), AddTime = DateTime.Now,DisplayOrder=0 };
             ufs.Add(model);
         });
         this._userFancyAppService.Add(ufs);
     });
 }