174 lines
5.8 KiB
C#
174 lines
5.8 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
using ITC81DB_0H.DialogForms;
|
|
using ITC81DB_0H.Forms;
|
|
using ITC81DB_2H_ImageDll;
|
|
using ITC81DB_2H.Datastore;
|
|
|
|
namespace ITC81DB_0H.Controls
|
|
{
|
|
public partial class ControlCenterInforSystem : UserControl
|
|
{
|
|
#region Field
|
|
private FormMenu m_ParentForm;
|
|
#endregion
|
|
|
|
#region Constructor
|
|
public ControlCenterInforSystem(FormMenu parent)
|
|
{
|
|
InitializeComponent();
|
|
|
|
this.ParentForm = parent;
|
|
|
|
this.InitializeDesign();
|
|
this.DefaultSetting();
|
|
}
|
|
#endregion
|
|
|
|
#region Property
|
|
public FormMenu ParentForm
|
|
{
|
|
get { return this.m_ParentForm; }
|
|
private set { this.m_ParentForm = value; }
|
|
}
|
|
#endregion
|
|
|
|
#region Method
|
|
public void InitializeDesign()
|
|
{
|
|
Class1 images = new Class1();
|
|
|
|
if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.English)
|
|
{
|
|
}
|
|
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese)
|
|
{
|
|
}
|
|
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Czech)
|
|
{
|
|
}
|
|
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Russian)
|
|
{
|
|
}
|
|
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German)
|
|
{
|
|
}
|
|
else
|
|
{
|
|
}
|
|
}
|
|
private void DefaultSetting()
|
|
{
|
|
this.labelSerialNo.Text = this.ParentForm.ParentForm.SystemConfig1.SerialNumber;
|
|
this.labelDisplayVer.Text = FormMain.DisplayVersion;
|
|
}
|
|
|
|
public void UpdateMainBoardVersionDisplay(string version)
|
|
{
|
|
if (version.Length < 8)
|
|
return;
|
|
|
|
this.labelControlVer.Text = version;
|
|
}
|
|
|
|
public void DisplayHiddenMenu(bool bValue)
|
|
{
|
|
this.buttonNext.Visible = bValue;
|
|
}
|
|
private void UpdateDisplayUser(UserItem user)
|
|
{
|
|
if (user.Group == Define.E_UserGroup.Developer && this.ParentForm.ParentForm.SystemConfig1.IsLogin == true)
|
|
this.DisplayHiddenMenu(true);
|
|
else
|
|
this.DisplayHiddenMenu(false);
|
|
}
|
|
public void DisplayRefresh(SystemStatus status)
|
|
{
|
|
this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.InforSystem;
|
|
this.ParentForm.ParentForm.SetDisplayMode(Define.E_DisplayMode.Menu);
|
|
this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus);
|
|
|
|
this.smartKeyboard.Hide();
|
|
this.textBoxSerialNo.Text = this.labelSerialNo.Text;
|
|
|
|
this.UpdateDisplayUser(status.CurrentUser);
|
|
|
|
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress.ProgramVersion, "");
|
|
}
|
|
#endregion
|
|
|
|
#region Event Handler
|
|
private void labelSerialNo_Click(object sender, EventArgs e)
|
|
{
|
|
DialogFormPasswordKeyPad password = new DialogFormPasswordKeyPad(4, this.ParentForm.ParentForm.SystemConfig1.Language, this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUserPasswordType);
|
|
DialogResult dialogResult = password.ShowDialog();
|
|
if (dialogResult == DialogResult.OK)
|
|
{
|
|
if (password.Group == Define.E_UserGroup.Admin)
|
|
{
|
|
this.textBoxSerialNo.Visible = true;
|
|
this.smartKeyboard.KeyboardType = SmartX.SmartKeyboard.KEYBOARDTYPES.NORMAL;
|
|
this.smartKeyboard.Left = 15;
|
|
this.smartKeyboard.Top = 118;
|
|
this.smartKeyboard.Width = 680;
|
|
this.smartKeyboard.Height = 268;
|
|
this.smartKeyboard.Hide();
|
|
|
|
this.smartKeyboard.TargetInputObject = this.textBoxSerialNo;
|
|
this.textBoxSerialNo.Text = this.labelSerialNo.Text;
|
|
|
|
this.smartKeyboard.Show();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void smartKeyboard1_OnXKeyClick(object sender, EventArgs e)
|
|
{
|
|
this.smartKeyboard.Hide();
|
|
this.textBoxSerialNo.Text = this.labelSerialNo.Text;
|
|
|
|
this.textBoxSerialNo.Visible = false;
|
|
}
|
|
|
|
private void textBoxSerialNo_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
if (e.KeyChar == '\r')
|
|
{
|
|
e.Handled = true;
|
|
|
|
this.smartKeyboard.Hide();
|
|
|
|
this.textBoxSerialNo.Visible = false;
|
|
|
|
this.labelSerialNo.Text = this.textBoxSerialNo.Text.Trim();
|
|
|
|
this.ParentForm.ParentForm.SystemConfig1.SerialNumber = this.labelSerialNo.Text;
|
|
this.ParentForm.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.ParentForm.SystemConfig1);
|
|
}
|
|
else if (e.KeyChar == 27) // ESC 눌렀을 때
|
|
{
|
|
e.Handled = true;
|
|
|
|
this.smartKeyboard.Hide();
|
|
this.textBoxSerialNo.Text = this.labelSerialNo.Text;
|
|
|
|
this.textBoxSerialNo.Visible = false;
|
|
}
|
|
}
|
|
|
|
private void buttonNext_Click(object sender, EventArgs e)
|
|
{
|
|
this.ParentForm.CenterInforSystem2.DisplayRefresh(this.ParentForm.ParentForm.CurrentSystemStatus);
|
|
this.ParentForm.CenterInforSystem2.BringToFront();
|
|
}
|
|
#endregion
|
|
}
|
|
}
|