コード例 #1
0
ファイル: Journey.svc.cs プロジェクト: thomaschacko/project01
 public XElement GetJourneyList(string account_guid)
 {
     Guid? accountId = Guid.Parse(account_guid);
     XElement journeyXml = null;
     using (JourneyDbDataContext journeyDbContext = new JourneyDbDataContext())
     {
         journeyDbContext.GetJourneyList(accountId, ref journeyXml);
     }
     return journeyXml;
 }
コード例 #2
0
ファイル: Journey.svc.cs プロジェクト: thomaschacko/project01
 public void PostJourneyLeg(string account_guid,string journey_guid, string leg_guid, XElement journeyLeg)
 {
     //Guid? accountId =  Guid.NewGuid();
     Guid? accountId = Guid.Parse(account_guid);
     Guid? journeyId = Guid.Parse(journey_guid);
     Guid? legId = Guid.Parse(leg_guid);
     using (JourneyDbDataContext journeyDbContext = new JourneyDbDataContext())
     {
         journeyDbContext.AddLeg(accountId, journeyId, legId, journeyLeg);
     }
 }
コード例 #3
0
ファイル: Journey.svc.cs プロジェクト: thomaschacko/project01
        public AccountResponse IdentifyAccount(AccountRequest accountRequest)
        {
            Guid? account_id=null;
            using (JourneyDbDataContext journeyDbContext = new JourneyDbDataContext())
            {
                journeyDbContext.GetAccount(accountRequest.GigyaUID, accountRequest.EmailId, accountRequest.Password, ref account_id);
            }

            AccountResponse ar = new AccountResponse();
            if(account_id.HasValue)
                ar.AccountId = account_id.Value;
            ar.Configuration = new AccountConfiguration();

            return ar;
        }
コード例 #4
0
ファイル: Journey.svc.cs プロジェクト: thomaschacko/project01
        public AccountResponse StartANewAccount(AccountRequest accountRequest)
        {
            string uid = accountRequest.GigyaUID;

            string methodName = "socialize.getUserInfo";

            string apiKey = ConfigurationManager.AppSettings["apikey"];
            string secretKey = ConfigurationManager.AppSettings["secretkey"];

            GSRequest request = new GSRequest(apiKey, secretKey, methodName, false);
            // Step 2 - Adding parameters
            request.setParam("uid", uid);  // set the "uid" parameter to user's ID
            // Step 3 - Sending the request
            GSResponse response = request.send();
            string nickname = response.getString("nickname", "");

            string City = response.getString("city", "");
            string CountryName = response.getString("country", "");
            string FirstName = response.getString("firstName", "");
            string LastName = response.getString("lastName", "");
            string GigyaLoginProvider = response.getString("loginProvider", "");
            string NickName = response.getString("nickname", "");

            Guid? account_id=null;
            using (JourneyDbDataContext journeyDbContext = new JourneyDbDataContext())
            {
                journeyDbContext.AddAccount(accountRequest.GigyaUID, accountRequest.EmailId, accountRequest.Password, accountRequest.DeviceId, accountRequest.CountryCode, GigyaLoginProvider, NickName, FirstName, LastName, City, CountryName, ref account_id);

            }

            AccountResponse ar = new AccountResponse();
            if (account_id.HasValue)
                ar.AccountId = account_id.Value;
            ar.Configuration = new AccountConfiguration();
            return ar;
        }