Ejemplo n.º 1
0
		/// <summary>
		/// Updates the user info.
		/// </summary>
		/// <returns><c>true</c>, if user info was updated, <c>false</c> otherwise.</returns>
		/// <param name="user">User.</param>
		private async Task<bool> UpdateUserInfo(InfomationOfUser user)
		{
			var result = await App.DataManeger.ModifyUserAsync(user.OldNickName
				                                             , user.NickName
				                                             , user.OldMailAddress
				                                             , user.MailAddress
				                                             , user.UserID);
			return result;
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Sets the user info.
		/// </summary>
		/// <returns><c>true</c>, if user info was set, <c>false</c> otherwise.</returns>
		/// <param name="user">User.</param>
		public bool SetUserInfo(InfomationOfUser user)
		{
			bool returnValue = false;
			try
			{
				if (HasUserAsync(user).Result)
				{
					_vm.SetUserInfo(user);
					returnValue = UpdateUserInfo(user).Result;
				}
				else
				{
					_vm.SetUserInfo(user);
					returnValue = CreateUserInfoAsync(user).Result;
				}
			}
			catch
			{
				returnValue = false;
			}
			return returnValue;
		}
Ejemplo n.º 3
0
 public bool SetUserInfo(InfomationOfUser user)
 {
     try
     {
         var target = new InfomationOfUser()
         {
             UserID = user.UserID,
             NickName = user.NickName,
             MailAddress = user.MailAddress,
             IsLogicalDelete = false,
             GroupID01 = user.GroupID01,
             GroupName01 = user.GroupName01,
             OldNickName = user.NickName,
             OldMailAddress = user.MailAddress,
             OldGroupName01 = user.GroupName01
         };
         App.Current.Properties.Add("UserInfo", target);
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Ejemplo n.º 4
0
 public bool SetUserInfo(InfomationOfUser user)
 {
     return _model.SetUserInfo(user);
 }
Ejemplo n.º 5
0
		private async Task<InfomationOfUser> SearchUserInfoAsync(InfomationOfUser user)
		{
			var result = await App.DataManeger.SearchUserDataAsync(user.NickName, user.MailAddress);
			return result;
		}
Ejemplo n.º 6
0
		private async Task<bool> HasUserAsync(InfomationOfUser user)
		{
			var result = await App.DataManeger.HasUserWithoutIdAsync(user.NickName, user.MailAddress);
			return result;
		}
Ejemplo n.º 7
0
		private async Task<bool> CreateUserInfoAsync(InfomationOfUser user)
		{
			var result = await App.DataManeger.CreateUserAsync(user.NickName, user.MailAddress);
			return result;
		}