public Control Wrap(ISessionDto obj) { var dto = obj as TerminalDto; var control = new TerminalControl { Text = dto.Name, }; control.ToUI(dto); return(control); }
public Control Wrap(ISessionDto obj) { var dto = obj as MasterDto; var control = new ModbusControl { Text = dto.Name, Dock = DockStyle.Fill, }; control.ToUI(dto); return(control); }
/// <summary> /// Gets the user information. /// </summary> /// <param name="context">The context.</param> /// <param name="sessionToken">The session token.</param> /// <returns></returns> protected virtual IUserDto GetUserInfo(OpenAccessContext context, string sessionToken) { ISessionDto sessionData = this.SessionManager.GetSessionData(context, sessionToken); if (sessionData == null) { return(null); } object user = this.GetUserById(context, sessionData.UserId); if (user == null) { this.SessionManager.RemoveSession(context, sessionToken); context.SaveChanges(); return(null); } IUserDto result = (IUserDto)ObjectProxyFactory.MapTo(this.UserDtoType, user); result.Password = null; result.SessionToken = sessionData.SessionToken; return(result); }