Exemple #1
0
 public void DelUser(UserItem user, Action<Exception> callback)
 {
     try
     {
         ServiceLocator.Current.GetInstance<IUserService>().GetLoginUser((lu, ex) =>
         {
             if (ex != null)
             {
                 callback(ex);
                 return;
             }
             var users = WebUtil.Delete<UserItem>(string.Format("api/users/{0}", lu.Domain), user);
             callback(null);
         });
     }
     catch (Exception ex)
     {
         logger.Warn(ex);
         callback(ex);
     }
 }
Exemple #2
0
 public UserViewModel()
 {
     this._user = new UserItem();
 }
Exemple #3
0
        private IEnumerable<BookItem> MergeCheckout(UserItem lu, IEnumerable<BookItem> books)
        {
            // TODO: CheckoutService を呼ぶようにする
            var courl = string.Format("api/checkouts/{0}?start={3}&limit={4}&sort={1}&checkin={2}", lu.Domain, @"[{ ""property"": ""from_date"", ""direction"": ""ASC"" }]", 0, 0, -1);
            courl += string.Format("&fromregno={0}", books.Min(t => t.regno));
            courl += string.Format("&toregno={0}", books.Max(t => t.regno));
            var checkouts = WebUtil.Get<CheckoutItems>(courl);

            return books.GroupJoin(checkouts.Checkouts, b => b.regno, c => c.regno, (b, c) => new { b, c })
                .SelectMany(x => x.c.DefaultIfEmpty(), (x, c) =>
                {
                    x.b.IsCheckout = c != null;
                    return x.b;
                });
        }
Exemple #4
0
 public UserViewModel(UserItem user)
 {
     this._user = user;
 }