public static bool AddNew_DisplaySetting(BOL.Display_Settings.objDisplaySettings display_setting) { using (var conn = DAL.Base.ConnectionManager.Connection) { var statement = "INSERT INTO " + "display_settings " + "(terminal_name_fontsize, queue_number_fontsize, terminal_width, terminal_height, header_background_color, header_title_color, header_title_fontsize, header_date_color, header_date_fontsize, header_time_color, header_time_fontsize) " + "VALUES " + "(@terminal_name_fontsize, @queue_number_fontsize, @terminal_width, @terminal_height, @header_background_color, @header_title_color, @header_title_fontsize, @header_date_color, @header_date_fontsize, @header_time_color, @header_time_fontsize)"; conn.Execute(statement, new { terminal_name_fontsize = display_setting.terminal_name_fontsize, queue_number_fontsize = display_setting.queue_number_fontsize, terminal_width = display_setting.terminal_width, terminal_height = display_setting.terminal_height, header_background_color = display_setting.header_background_color, header_title_color = display_setting.header_title_color, header_title_fontsize = display_setting.header_title_fontsize, header_date_color = display_setting.header_date_color, header_date_fontsize = display_setting.header_date_fontsize, header_time_color = display_setting.header_time_color, header_time_fontsize = display_setting.header_time_fontsize }); conn.Close(); conn.Dispose(); return(true); } }
void Load_Terminals() { BOL.Display_Settings.objDisplaySettings DisplaySetting = DAL.Dislay_Settings.DisplaySettings_Repository.GetCurrentDisplaySettings(); foreach (Windows.Controls.TerminalControl obj in TerminalPanel.Children) { obj.Remove_Handler(); } TerminalPanel.Children.Clear(); List <BOL.Terminal.objTerminal> Terminals = DAL.Terminal.Terminal_Repository.GetActiveTerminals(); foreach (BOL.Terminal.objTerminal terminal in Terminals) { TerminalPanel.Children.Add(new Windows.Controls.TerminalControl(this.MainEvent, terminal, DisplaySetting)); } }
public static BOL.Display_Settings.objDisplaySettings GetCurrentDisplaySettings() { using (var conn = DAL.Base.ConnectionManager.Connection) { var statement = "SELECT " + "* " + "FROM " + "display_settings " + "ORDER BY " + "id DESC " + "LIMIT 1"; BOL.Display_Settings.objDisplaySettings Current = conn.Query <BOL.Display_Settings.objDisplaySettings>(statement).SingleOrDefault(); conn.Close(); conn.Dispose(); if (Current == null) { Current = new BOL.Display_Settings.objDisplaySettings(); } return(Current); } }
public TerminalControl(COMMON.DataEvent main_event, BOL.Terminal.objTerminal terminal, BOL.Display_Settings.objDisplaySettings display_setting) { InitializeComponent(); this.Width = display_setting.terminal_width; this.Height = display_setting.terminal_height; this.TerminalTitle.FontSize = display_setting.terminal_name_fontsize; this.lblQueueNumber.FontSize = display_setting.queue_number_fontsize; this.Voice = new System.Speech.Synthesis.SpeechSynthesizer() { Volume = 100 }; this.MainEvent = main_event; this.Terminal = terminal; this.DefaultFontsize = lblQueueNumber.FontSize; this.Timer = new System.Windows.Threading.DispatcherTimer() { Interval = new TimeSpan(0, 0, 1) }; this.NotificationSound = new SoundPlayer(Properties.Resources.doorbell_sound); this.Timer.Tick += Timer_Tick; this.MainEvent.OnDataConfirm += MainEvent_OnDataConfirm; Initialize_Window(); }