ITC81DB_2H/ITC81DB_0H/Controls/CenterLog/ControlCenterLogHelp.cs

196 lines
12 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 ITC81DB_2H.Datastore;
using SmartX;
namespace ITC81DB_0H.Controls
{
public partial class ControlCenterLogHelp : UserControl
{
#region Field
private FormMenu m_ParentForm;
private Define.E_MenuBottomLog CurrentMenu;
#endregion
#region Constructor
public ControlCenterLogHelp(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.buttonLogInspection.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogInspectionDisable));
this.buttonLogInspection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogInspectionDown));
this.buttonLogInspection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogInspectionUp));
this.buttonLogHistory.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogHistoryDisable));
this.buttonLogHistory.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogHistoryDown));
this.buttonLogHistory.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogHistoryUp));
this.buttonLogOthers.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDisable));
this.buttonLogOthers.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDown));
this.buttonLogOthers.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersUp));
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese)
{
this.buttonLogInspection.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpLogInspectionDisable));
this.buttonLogInspection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpLogInspectionDown));
this.buttonLogInspection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpLogInspectionUp));
this.buttonLogHistory.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpLogHistoryDisable));
this.buttonLogHistory.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpLogHistoryDown));
this.buttonLogHistory.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpLogHistoryUp));
this.buttonLogOthers.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDisable));
this.buttonLogOthers.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDown));
this.buttonLogOthers.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersUp));
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Czech)
{
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Russian)
{
this.buttonLogInspection.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpLogInspectionDisable));
this.buttonLogInspection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpLogInspectionDown));
this.buttonLogInspection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpLogInspectionUp));
this.buttonLogHistory.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpLogHistoryDisable));
this.buttonLogHistory.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpLogHistoryDown));
this.buttonLogHistory.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpLogHistoryUp));
this.buttonLogOthers.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDisable));
this.buttonLogOthers.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDown));
this.buttonLogOthers.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersUp));
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German)
{
this.buttonLogInspection.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpLogInspectionDisable));
this.buttonLogInspection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpLogInspectionDown));
this.buttonLogInspection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpLogInspectionUp));
this.buttonLogHistory.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpLogHistoryDisable));
this.buttonLogHistory.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpLogHistoryDown));
this.buttonLogHistory.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpLogHistoryUp));
this.buttonLogOthers.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDisable));
this.buttonLogOthers.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDown));
this.buttonLogOthers.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersUp));
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Spanish)
{
this.buttonLogInspection.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogInspectionDisable));
this.buttonLogInspection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogInspectionDown));
this.buttonLogInspection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogInspectionUp));
this.buttonLogHistory.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogHistoryDisable));
this.buttonLogHistory.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogHistoryDown));
this.buttonLogHistory.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpLogHistoryUp));
this.buttonLogOthers.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDisable));
this.buttonLogOthers.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDown));
this.buttonLogOthers.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersUp));
}
else
{
this.buttonLogInspection.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogInspectionDisable));
this.buttonLogInspection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogInspectionDown));
this.buttonLogInspection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogInspectionUp));
this.buttonLogHistory.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogHistoryDisable));
this.buttonLogHistory.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogHistoryDown));
this.buttonLogHistory.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogHistoryUp));
this.buttonLogOthers.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDisable));
this.buttonLogOthers.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersDown));
this.buttonLogOthers.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpLogOthersUp));
}
}
private void DefaultSetting()
{
this.CurrentMenu = Define.E_MenuBottomLog.Help;
}
public void UpdateMenuDisplay(SystemStatus status)
{
switch (status.CurrentUser.Group)
{
case Define.E_UserGroup.Level1:
this.buttonLogInspection.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsLogJudge;
this.buttonLogHistory.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsLogHistory;
this.buttonLogOthers.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsLogOthers;
break;
case Define.E_UserGroup.Level2:
this.buttonLogInspection.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsLogJudge;
this.buttonLogHistory.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsLogHistory;
this.buttonLogOthers.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsLogOthers;
break;
case Define.E_UserGroup.Level3:
this.buttonLogInspection.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsLogJudge;
this.buttonLogHistory.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsLogHistory;
this.buttonLogOthers.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsLogOthers;
break;
case Define.E_UserGroup.Admin:
case Define.E_UserGroup.Developer:
this.buttonLogInspection.Enabled = true;
this.buttonLogHistory.Enabled = true;
this.buttonLogOthers.Enabled = true;
break;
case Define.E_UserGroup.NotLogin:
this.buttonLogInspection.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsLogJudge;
this.buttonLogHistory.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsLogHistory;
this.buttonLogOthers.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsLogOthers;
break;
default:
break;
}
}
public void DisplayRefresh(SystemStatus status)
{
this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.LogHelp;
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.buttonLogInspection)
this.CurrentMenu = Define.E_MenuBottomLog.LogInspection;
else if (button == this.buttonLogHistory)
this.CurrentMenu = Define.E_MenuBottomLog.LogHistory;
else if (button == this.buttonLogOthers)
this.CurrentMenu = Define.E_MenuBottomLog.LogOthers;
else
this.CurrentMenu = Define.E_MenuBottomLog.Help;
this.ParentForm.DisplayBottomLog(this.CurrentMenu);
}
#endregion
}
}