コード例 #1
0
        public ActionResult PerformEbayService()
        {
            try
            {
                if (this.User.Identity.IsAuthenticated)
                {
                    var user = UserManager.FindByEmail(User.Identity.Name);

                    if (Utility.AdminRoleId == user.AspNetRoles.FirstOrDefault().Id)
                    {
                        var oClient = new LocalEbayIntegrationWS.TmdEbayIntegrationServiceClient();
                        oClient.StartEbayLoadByToken(user.Id);
                        //oClient.StartEbayLoad("*****@*****.**","123456");
                        return(new HttpStatusCodeResult(HttpStatusCode.OK));
                    }
                    throw new Exception("User Role is not Admin");
                }
                throw new Exception("User is not Authenticated");
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.ExpectationFailed, e.Message.ToString()));
            }
        }
コード例 #2
0
        public ActionResult PerformEbayService()
        {
            try
              {

              if (this.User.Identity.IsAuthenticated)
              {
                  var user = UserManager.FindByEmail(User.Identity.Name);

                  if (Utility.AdminRoleId == user.AspNetRoles.FirstOrDefault().Id)
                  {
                      var oClient = new LocalEbayIntegrationWS.TmdEbayIntegrationServiceClient();
                      oClient.StartEbayLoadByToken(user.Id);
                      //oClient.StartEbayLoad("*****@*****.**","123456");
                      return new HttpStatusCodeResult(HttpStatusCode.OK);
                  }
                  throw new Exception("User Role is not Admin");
              }
              throw new Exception("User is not Authenticated");
              }
              catch (Exception e)
              {

                  return new HttpStatusCodeResult(HttpStatusCode.ExpectationFailed,e.Message.ToString());
              }
        }