/// <summary> /// Sets the user information. /// </summary> /// <param name="age">The age.</param> /// <param name="sexType">Type of the sex.</param> public void SetUserInformation(int age, SexType sexType) { try { User user = new User(age, sexType, StatusType.Pending, this.applicationId, this.sessionId, this.applicationVersion); this.iStorageDal.Save(user); this.setItemsWaitingToBeUploaded(); if (this.uploadType == UploadType.WhileUsingAsync) { this.uploadIntelligent(); } } catch (ExceptionDatabaseLayer ex) { this.logSystemError(ex); throw ex; } }
/// <summary> /// Users the specified device id. /// </summary> /// <param name="deviceId">The device id.</param> /// <param name="user">The user.</param> /// <returns></returns> public WebServiceResponseCodeType User(Guid deviceId, User user) { KeyValuePair<string, string>[] keyValuePairs = new KeyValuePair<string, string>[] { new KeyValuePair<string, string>(QueryStringKeyType.DEVICE_GUID, deviceId.ToString()), new KeyValuePair<string, string>(QueryStringKeyType.APPLICATION_GUID, user.ApplicationId.ToString()), new KeyValuePair<string, string>(QueryStringKeyType.DATE_CREATED, user.DateCreatedFormatted), new KeyValuePair<string, string>(QueryStringKeyType.VERSION, user.Version), new KeyValuePair<string, string>(QueryStringKeyType.AGE, user.Age.ToString()), new KeyValuePair<string, string>(QueryStringKeyType.SEX_TYPE, ((int)user.Sex).ToString()), new KeyValuePair<string, string>(QueryStringKeyType.SESSION_ID, user.SessionId.ToString()) }; return this.webServiceCall(this.baseUrl, WebServiceType.User, keyValuePairs); }
/// <summary> /// Updates the specified user. /// </summary> /// <param name="user">The user.</param> public void Update(User user) { try { threadQueue.WaitOne(); this.SubmitChanges(); } catch (Exception ex) { throw new ExceptionDatabaseLayer(ex); } finally { threadQueue.Set(); } }