162 lines
7.9 KiB
C#
162 lines
7.9 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.Forms;
|
|
using ITC81DB_2H_ImageDll;
|
|
using SmartX;
|
|
using ITC81DB_2H.Datastore;
|
|
|
|
namespace ITC81DB_0H.Controls
|
|
{
|
|
public partial class ControlCenterInforHelp : UserControl
|
|
{
|
|
#region Field
|
|
private FormMenu m_ParentForm;
|
|
|
|
private Define.E_MenuBottomInformation CurrentMenu;
|
|
#endregion
|
|
|
|
#region Constructor
|
|
public ControlCenterInforHelp(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)
|
|
{
|
|
this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInformationDisable));
|
|
this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInformationDown));
|
|
this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInformationUp));
|
|
this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpASDisable));
|
|
this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpASDown));
|
|
this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpASUp));
|
|
}
|
|
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese)
|
|
{
|
|
this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInformationDisable));
|
|
this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInformationDown));
|
|
this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInformationUp));
|
|
this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpASDisable));
|
|
this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpASDown));
|
|
this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpASUp));
|
|
}
|
|
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Czech)
|
|
{
|
|
}
|
|
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Russian)
|
|
{
|
|
this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpInformationDisable));
|
|
this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpInformationDown));
|
|
this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpInformationUp));
|
|
this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpASDisable));
|
|
this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpASDown));
|
|
this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpASUp));
|
|
}
|
|
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German)
|
|
{
|
|
this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpInformationDisable));
|
|
this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpInformationDown));
|
|
this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpInformationUp));
|
|
this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpASDisable));
|
|
this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpASDown));
|
|
this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpASUp));
|
|
}
|
|
else
|
|
{
|
|
this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInformationDisable));
|
|
this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInformationDown));
|
|
this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInformationUp));
|
|
this.buttonAS.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpASDisable));
|
|
this.buttonAS.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpASDown));
|
|
this.buttonAS.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpASUp));
|
|
}
|
|
}
|
|
private void DefaultSetting()
|
|
{
|
|
this.CurrentMenu = Define.E_MenuBottomInformation.Help;
|
|
}
|
|
|
|
public void UpdateMenuDisplay(SystemStatus status)
|
|
{
|
|
switch (status.CurrentUser.Group)
|
|
{
|
|
case Define.E_UserGroup.Level1:
|
|
this.buttonAS.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsInforAS;
|
|
this.buttonInformation.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsInforSystem;
|
|
break;
|
|
case Define.E_UserGroup.Level2:
|
|
this.buttonAS.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsInforAS;
|
|
this.buttonInformation.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsInforSystem;
|
|
break;
|
|
case Define.E_UserGroup.Level3:
|
|
this.buttonAS.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsInforAS;
|
|
this.buttonInformation.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsInforSystem;
|
|
break;
|
|
case Define.E_UserGroup.Admin:
|
|
case Define.E_UserGroup.Developer:
|
|
this.buttonAS.Enabled = true;
|
|
this.buttonInformation.Enabled = true;
|
|
break;
|
|
case Define.E_UserGroup.NotLogin:
|
|
this.buttonAS.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsInforAS;
|
|
this.buttonInformation.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsInforSystem;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void DisplayRefresh(SystemStatus status)
|
|
{
|
|
this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.InforHelp;
|
|
this.ParentForm.ParentForm.SetDisplayMode(Define.E_DisplayMode.Menu);
|
|
this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus);
|
|
}
|
|
#endregion
|
|
|
|
#region Event Handler
|
|
private void buttonMenu_Click(object sender, EventArgs e)
|
|
{
|
|
SmartButton button = sender as SmartButton;
|
|
|
|
if (button == null)
|
|
return;
|
|
|
|
if (button == this.buttonInformation)
|
|
this.CurrentMenu = Define.E_MenuBottomInformation.SystemInformation;
|
|
else if (button == this.buttonAS)
|
|
this.CurrentMenu = Define.E_MenuBottomInformation.AS;
|
|
else
|
|
this.CurrentMenu = Define.E_MenuBottomInformation.Help;
|
|
|
|
this.ParentForm.DisplayBottomInformation(this.CurrentMenu);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|