private void ShowAdminMenu(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_SYSTEM_ADMIN_MENU) { return; } RadialMenuContainer menuContainer = null; if (MainForm.m_pMainWndTemp.metroTileItemSystemAdmin.SubItems.Count == 0) { menuContainer = new RadialMenuContainer(); menuContainer.Font = new Font(MainForm.m_pMainWndTemp.Font.FontFamily, 15); // 五角星 // 主页 // X // √ // 返回 // 问号 ? // 完成 // 红旗 // \uf040 笔 menuContainer.SubItems.Add(CreateItem("WIFI", "")); menuContainer.SubItems.Add(CreateItem("亮度", "\uf040")); menuContainer.SubItems.Add(CreateItem("电量", "")); menuContainer.Diameter = 280; MainForm.m_pMainWndTemp.metroTileItemSystemAdmin.SubItems.Add(menuContainer); } else { menuContainer = (RadialMenuContainer)MainForm.m_pMainWndTemp.metroTileItemSystemAdmin.SubItems[0]; } menuContainer.MenuLocation = new Point(Control.MousePosition.X - menuContainer.Diameter / 2, Control.MousePosition.Y - menuContainer.Diameter / 2); menuContainer.Expanded = true; }
private void MAINFORMCLOSING(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_INTERFACE_CLOSE_FORM) { return; } }
public void HandleMessage(Message m_message) { switch (m_message.GetMessageType()) { default: break; } }
private void ShowLoginForm(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_INTERFACE_LOGIN) { return; } LoginFormNew m_loginInForm = new LoginFormNew(); m_loginInForm.ShowDialog(); }
public void ShowRegisterForm(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_INTERFACE_REGISTER) { return; } RegistStep1Form resStep1Form = new RegistStep1Form("", "", ""); //resStep1Form.TopMost = false; resStep1Form.Show(); }
public void StartReadProcess(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_REGISTER_ID_CARD_READ_PROCESS) { return; } ReadCardHandler mc = new ReadCardHandler(CVRSDK.ReadCard); IAsyncResult result = mc.BeginInvoke(null, null); CVRSDK.CardInfo m_cardInfo = mc.EndInvoke(result);//用于接收返回值 MessageBox.Show(m_cardInfo.address); }
public void HandleMessage(Message m_message) { switch (m_message.GetMessageType()) { case MessageType.MSG_SYSTEM_ADMIN_MENU: ShowAdminMenu(m_message); break; default: break; } }
public void HandleMessage(Message m_message) { switch (m_message.GetMessageType()) { case MessageType.MSG_GYMNASTIC_SHOW_FORM: ShowForm(m_message); break; default: break; } }
public void InitializeDevice(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_REGISTER_ID_CARD_INITIALIZE) { return; } CVRSDK.InitializeDevice(); if (CVRSDK.iRetCOM == 1 && CVRSDK.iRetUSB == 1) { MainForm.m_pMainWnd.m_isReadIdCard = true; Message newMessage = new Message(MessageType.MSG_REGISTER_ID_CARD_READ_PROCESS); MainForm.m_pMainWnd.m_sharedDataAndMethod.SendMessage(newMessage); } return; }
public void UpdateMainFrameUI(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_INTERFACE_UPDATE_UI) { return; } // MainForm mainForm = (MainForm)Control.FromHandle(Process.GetCurrentProcess().MainWindowHandle); if (MainForm.m_pMainWnd != null) { MainForm.m_pMainWnd.metroTileItemProfessionalVideo.Enabled = MainForm.m_isLegalUser; MainForm.m_pMainWnd.metroTileItemGym.Enabled = MainForm.m_isLegalUser; MainForm.m_pMainWnd.metroTileItemmotion.Enabled = MainForm.m_isLegalUser; MainForm.m_pMainWnd.metroTileItemSystemAdmin.Enabled = MainForm.m_isLegalUser; MainForm.m_pMainWnd.m_MainFramemetroTileItemKangFuCao.Enabled = MainForm.m_isLegalUser; MainForm.m_pMainWnd.metroTileItemLoQuestionaire.Enabled = MainForm.m_isLegalUser; } }
public void HandleMessage(Message m_message) { switch (m_message.GetMessageType()) { case MessageType.MSG_LOGIN_SHOW_USER_INFO: ShowUerInfo(m_message); break; case MessageType.MSG_LOGIN_OUT: LogOut(m_message); break; case MessageType.MSG_SHOW_HISTROTY_DATA: ShowUserHistoryData(m_message); break; default: break; } }
public void HandleMessage(Message m_message) { switch (m_message.GetMessageType()) { case MessageType.MSG_INTERFACE_PEOPLE_COUNT: GetPeopleCount(m_message); break; case MessageType.MSG_INTERFACE_REGISTER: ShowRegisterForm(m_message); break; case MessageType.MSG_INTERFACE_UPDATE_UI: UpdateMainFrameUI(m_message); break; case MessageType.MSG_INTERFACE_LOGIN: ShowLoginForm(m_message); break; case MessageType.MSG_REGISTER_ID_CARD_INITIALIZE: InitializeDevice(m_message); break; case MessageType.MSG_REGISTER_ID_CARD_READ_PROCESS: StartReadProcess(m_message); break; case MessageType.MSG_INTERFACE_CLOSE_FORM: MAINFORMCLOSING(m_message); break; case MessageType.MSG_INTERFACE_QUESTIONARE_ONE: ShowQuestionOne(m_message); break; default: break; } }
private void ShowQuestionOne(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_INTERFACE_QUESTIONARE_ONE) { return; } RadialMenuContainer menuContainer = null; if (MainForm.m_pMainWndTemp.metroTileItemLoQuestionaire.SubItems.Count == 0) { menuContainer = new RadialMenuContainer(); menuContainer.Font = new Font(MainForm.m_pMainWndTemp.Font.FontFamily, 15); // 五角星 // 主页 // X // √ // 返回 // 问号 ? // 完成 // 红旗 // \uf040 笔 menuContainer.SubItems.Add(CreateItem("痴呆", "")); menuContainer.SubItems.Add(CreateItem("早癌", "\uf040")); menuContainer.SubItems.Add(CreateItem("脑卒中", "")); menuContainer.SubItems.Add(CreateItem("工伤康复", "\uf040")); menuContainer.SubItems.Add(CreateItem("其他", "")); //menuContainer.SubItems.Add(CreateItem("狐臭", "\uf02e")); menuContainer.Diameter = 280; MainForm.m_pMainWndTemp.metroTileItemLoQuestionaire.SubItems.Add(menuContainer); } else { menuContainer = (RadialMenuContainer)MainForm.m_pMainWndTemp.metroTileItemLoQuestionaire.SubItems[0]; } menuContainer.MenuLocation = new Point(Control.MousePosition.X - menuContainer.Diameter / 2, Control.MousePosition.Y - menuContainer.Diameter / 2); menuContainer.Expanded = true; }
public void GetPeopleCount(Message m_message) { if (m_message.GetMessageType() != MessageType.MSG_INTERFACE_PEOPLE_COUNT) { return; } //SQL连接 MySqlConnection m_sqlCon = new MySqlConnection(); m_sqlCon.ConnectionString = "server=localhost;database=heilscare;uid=root;pwd=heils"; try { m_sqlCon.Open(); } catch (Exception e) { MessageBox.Show("数据库连接出错! \r\n " + e.ToString()); throw; } //SQL指令 MySqlCommand m_sqlCommand = new MySqlCommand(); m_sqlCommand.Connection = m_sqlCon; m_sqlCommand.CommandType = CommandType.Text; m_sqlCommand.CommandText = "SELECT * FROM UserTable where id=1"; //SQL结果 MySqlDataReader m_sqlReader = m_sqlCommand.ExecuteReader();//执行SQL语句 while (m_sqlReader.Read()) { MessageBox.Show(m_sqlReader["Name"].ToString()); } m_sqlReader.Close(); //关闭执行 m_sqlCon.Close(); //关闭数据库 }
public void SendMessage(Message m_message) { //界面消息处理 if (m_message.GetMessageType() >= MessageType.MSG_INTERFACE_MIN && m_message.GetMessageType() <= MessageType.MSG_INTERFACE_MAX) { m_InterInterActionHandler.HandleMessage(m_message); return; } //注册消息 if (m_message.GetMessageType() >= MessageType.MSG_REGISTER_MIN && m_message.GetMessageType() <= MessageType.MSG_REGISTER_MAX) { return; } //登陆消息 if (m_message.GetMessageType() >= MessageType.MSG_LOGIN_MIN && m_message.GetMessageType() <= MessageType.MSG_LOGIN_MAX) { m_loginHandler.HandleMessage(m_message); return; } //问卷消息 if (m_message.GetMessageType() >= MessageType.MSG_QUESTIONAR_MIN && m_message.GetMessageType() <= MessageType.MSG_QUESTIONAR_MAX) { return; } //体感操消息 if (m_message.GetMessageType() >= MessageType.MSG_GYMNASTIC_MIN && m_message.GetMessageType() <= MessageType.MSG_GYMNASTIC_MAX) { m_GymnasicHandler.HandleMessage(m_message); return; } //运动控制消息 if (m_message.GetMessageType() >= MessageType.MSG_MOTION_MIN && m_message.GetMessageType() <= MessageType.MSG_MOTION_MAX) { return; } //系统管理消息 if (m_message.GetMessageType() >= MessageType.MSG_SYSTEM_ADMIN_MIN && m_message.GetMessageType() <= MessageType.MSG_SYSTEM_ADMIN_MAX) { m_systemAdminHandler.HandleMessage(m_message); return; } }