Пример #1
0
 public static bool LoadSender(string sessionKey,out string error,out Sender sender)
 {
     error = string.Empty;
     sender = new Sender();
     bool isSuccess = false;
     try
     {
         ITopClient client = new DefaultTopClient(Constants.ApiUrl, Constants.AppKey, Constants.AppSecret);
         UserSellerGetRequest req = new UserSellerGetRequest();
         req.Fields = "user_id,sex";
         UserSellerGetResponse response = client.Execute(req, sessionKey);
         sender.User_Id = response.User.UserId;
         sender.Sender_Nick = response.User.Nick;
         isSuccess = true;
     }
     catch (Exception ex)
     {
         error = ex.Message;
     }
     return isSuccess;
 }
Пример #2
0
 public ActionResult ChangeSenderSettings(Sender sender)
 {
     IService<Sender> senderService = ServiceUtilizer.GetCurrentService<Sender>();
     if (senderService.UpdateEntity(sender))
     {
         return RedirectToAction("ViewSenderSettings");
     }
     else
     {
         return Content(senderService.ErrorMsg);
     }
 }