public UserCalendarTerminalUpdate(UserCalendarTerminal entity) { InitializeComponent(); this._calendar = entity.Calendar; this._terminal = entity.Terminal; this.Text = "Modificación de Configuración para el Usuario \"" + entity.UserProfileDescription + "\""; this.txtCalendar.Text = entity.CalendarDescription; this.txtTerminal.Text = entity.TerminalDescription; this.Result = entity; }
public TerminalUpdate(Terminal entity = null) { InitializeComponent(); cmbAddress.DataSource = this.DbContext.Addresses.Where(a => !a.IsDeleted).ToList(); cmbHardwareModel.DataSource = this.DbContext.HardwareModels.Where(a => !a.IsDeleted).ToList(); if (entity == null) { this.Text = "Alta de Terminales"; } else { this.Text = "Modificación de Terminal \"" + entity.IP + "\""; cmbAddress.SelectedValue = entity.Door.Area.AddressID; cmbArea.SelectedValue = entity.Door.AreaID; cmbDoor.SelectedValue = entity.DoorID; txtIP.Text = entity.IP; cmbHardwareModel.SelectedValue = entity.HardwareModelID; } this.Result = entity ?? new Terminal(); }
private void btnSearchTerminal_Click(object sender, EventArgs e) { var searchForm = new TerminalSearch(); var result = searchForm.ShowDialog(); if (result == DialogResult.OK) { this._terminal = searchForm.Result; this.txtTerminal.Text = searchForm.Result.IP; } }
/// <summary> /// Добавление нового терминала /// </summary> /// <param name="id">Идентификатор</param> /// <param name="peak">Максимальное число активных пользователей</param> /// <remarks>По умолчанию добавленный терминал не активен, но сразу же выбирается</remarks> public void AddTerminal(string id, byte peak) { var t = new Terminal(id,peak); Terminals.Add(new Terminal(id,peak)); Logger.Info("К сети подключен новый терминал " + t.ToString(), log ? LogType.File : LogType.Screen); SelectTerminal(id); }