Example #1
0
 public static string GetChannelOwner(int userId)
 {
     using (RentItServiceClient proxy = new RentItServiceClient())
     {
         return proxy.GetUser(userId).Username;
     }
 }
Example #2
0
 public static GuiComment ConvertComment(Comment c)
 {
     GuiComment comment = new GuiComment()
     {
         UserId = c.UserId,
         Content = c.Content,
         Date = c.PostTime,
         ChannelId = c.ChannelId
     };
     using (RentItServiceClient proxy = new RentItServiceClient())
     {
         comment.UserName = proxy.GetUser(comment.UserId).Username;
     }
     return comment;
 }
Example #3
0
 public ActionResult Edit(int? userId)
 {
     if (userId.HasValue)
     {
         using (RentItServiceClient proxy = new RentItServiceClient())
         {
             User user = proxy.GetUser(userId.Value);
             if (user != null)
             {
                 Account acc = new Account();
                 acc.UserId = user.Id;
                 acc.CurrentEmail = user.Email;
                 acc.CurrentUsername = user.Username;
                 return View(acc);
             }
         }
     }
     return RedirectToAction("Index", "Home");
 }