本文整理汇总了C#中UserStatus类的典型用法代码示例。如果您正苦于以下问题:C# UserStatus类的具体用法?C# UserStatus怎么用?C# UserStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserStatus类属于命名空间,在下文中一共展示了UserStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateUserRoleAndStatus
public async Task<int> UpdateUserRoleAndStatus(CompetentAuthorityUser user, Role role, UserStatus status)
{
user.UpdateUserStatus(status.ToDomainEnumeration<Domain.User.UserStatus>());
user.UpdateRole(role);
return await context.SaveChangesAsync();
}
开发者ID:EnvironmentAgency,项目名称:prsd-weee,代码行数:7,代码来源:UpdateCompetentAuthorityUserRoleAndStatusDataAccess.cs
示例2: ChatListSubItem
public ChatListSubItem()
{
this.status = UserStatus.Online;
this.displayName = "displayName";
this.nicName = "nicName";
this.personalMsg = "Personal Message ...";
}
示例3: User
/// <summary>
/// Initializes a new instance of the <see cref="User" /> class.
/// Default constructor.
/// </summary>
public User()
{
this.personData = new Person();
this.priceUAH = 0;
this.priceUSD = 0;
this.status = UserStatus.NotLogged;
}
示例4: GetUserDetails
public static List<User> GetUserDetails(UserStatus status)
{
List<User> Users = new List<User>();
using (sqlDBConnection = new SqlConnection(ConfigurationManager.ConnectionStrings[Connection.ConnectionName].ConnectionString))
{
StringBuilder sqlstmt = new StringBuilder("select id,username,password,firstname,lastname,address,contactnumber,dateofbirth,emailid,securityquestion,answer,addressproof,photoidentity,status,rewardpoints from [dbo].[User] where status = @status");
//sqlstmt.Append(Convert.ToString(userid));
SqlCommand myCommand = new SqlCommand(sqlstmt.ToString(), sqlDBConnection);
myCommand.CommandType = CommandType.Text;
myCommand.Parameters.AddWithValue("@status", (int)status);
sqlDBConnection.Open();
using (SqlDataReader myReader = myCommand.ExecuteReader())
{
User user;
while (myReader.Read())
{
user = FillDataRecord(myReader);
Users.Add(user);
}
myReader.Close();
}
sqlDBConnection.Close();
}
return Users;
}
示例5: CompetentAuthorityUser
public CompetentAuthorityUser(string userId, Guid competentAuthorityId, UserStatus userStatus, Role role)
{
UserId = userId;
CompetentAuthorityId = competentAuthorityId;
UserStatus = userStatus;
Role = role;
}
示例6: ToString
/// <summary>
/// Convert UserStatus to string status name.
/// </summary>
/// <param name="status">Enum UserStatus.</param>
/// <returns>Status name.</returns>
public static String ToString(UserStatus status)
{
String statusName = String.Empty;
switch (status)
{
case UserStatus.Offline:
{
statusName = "offline";
}
break;
case UserStatus.Online:
{
statusName = "online";
}
break;
case UserStatus.AtHome:
{
statusName = "at home";
}
break;
case UserStatus.AtWork:
{
statusName = "at work";
}
break;
case UserStatus.Busy:
{
statusName = "busy";
}
break;
}
return statusName;
}
示例7: SetStatusMessage
/// <summary>
/// Set new status message.
/// </summary>
/// <param name="userID">User identificator.</param>
/// <param name="message">Message content.</param>
/// <param name="status">Type of status.</param>
public static void SetStatusMessage(Guid userID, String message, UserStatus status)
{
using (SocialNetworkDBEntities record = new SocialNetworkDBEntities())
{
record.spInsStatus(userID, message, (Int32)status);
}
}
示例8: User
public User(int uid, String username, String email, UserStatus status)
{
Username = username;
Email = email;
UID = uid;
Status = status;
}
示例9: SetUserStatus
public void SetUserStatus(UserStatus status) {
logger.debug("set status {0} to user {1}", status, FullName);
switch(user.Constructor) {
case Constructor.userEmpty:
break;
case Constructor.userSelf:
((UserSelfConstructor) user).status = status;
break;
case Constructor.userContact:
((UserContactConstructor) user).status = status;
break;
case Constructor.userRequest:
((UserRequestConstructor) user).status = status;
break;
case Constructor.userForeign:
((UserForeignConstructor) user).status = status;
break;
case Constructor.userDeleted:
break;
default:
throw new InvalidDataException("invalid constructor");
}
OnPropertyChanged("Status");
}
示例10: SetUserStatusStatement
public SetUserStatusStatement(string userName, UserStatus status)
{
if (String.IsNullOrEmpty(userName))
throw new ArgumentNullException("userName");
UserName = userName;
Status = status;
}
示例11: User
public User(string username, string password, UserAuthorization authorization, UserStatus status) {
this._mongoServer = MyMongoDB.GetServer();
this._username = username;
this._password = password;
this._authorization = authorization;
this._status = status;
}
示例12: UpdateStatus
/// <summary>
/// 更新用户状态
/// </summary>
/// <param name="sysNo">用户编号</param>
/// <param name="status">用户状态</param>
/// <returns></returns>
public static bool UpdateStatus(int sysNo, UserStatus status)
{
DataCommand cmd = DataCommandManager.GetDataCommand("Users_UpdateStatus");
cmd.SetParameterValue("@Status", (int)status);
cmd.SetParameterValue("@SysNo", sysNo);
cmd.ExecuteNonQuery();
return true;
}
示例13: LockUser
public void LockUser()
{
Assert.DoesNotThrow(() => QueryContext.SetUserStatus("tester", UserStatus.Locked));
UserStatus status = new UserStatus();
Assert.DoesNotThrow(() => status = QueryContext.GetUserStatus("tester"));
Assert.AreEqual(UserStatus.Locked, status);
}
示例14: User
public User()
{
this.CreatedAt = DateTime.Now;
this.ID = Guid.NewGuid();
this.status = UserStatus.Pending;
this.Logs = new List<UserActivityLog>();
this.MailerLogs = new List<UserMailerLog>();
}
示例15: CreateUser
private void CreateUser(UserGender gender, UserStatus status)
{
((App)App.Current).Client.CreateUserAsync((user, callbackParams) =>
{
Utilities.HandleAsyncResults(user, callbackParams, () => { this.UserCreated(user); }, "Create user failed. Please try again.");
}, this.Name.Text, this.Password.Password, gender: gender, age: this.GetAge(),
email: this.Email.Text, status: status);
}