ITC81DB_2H/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.cs

1984 lines
91 KiB
C#
Raw Normal View History

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;
2023-05-24 04:16:07 +00:00
using System.Threading;
using ITC81DB_0H.Forms;
using ITC81DB_0H.Controls;
using ITC81DB_0H.DialogForms;
using ITC81DB_2H_ImageDll;
2023-05-24 04:16:07 +00:00
using ITC81DB_2H.Datastore;
using ITC81DB_0H.Part11_UserManager;
namespace ITC81DB_0H.Controls
{
public partial class ControlCenterEquipUser : UserControl
{
#region Field
private FormMenu m_ParentForm;
2023-05-24 04:16:07 +00:00
private bool IsNew;
private object LockObject = new object();
2023-05-24 04:16:07 +00:00
private bool PasswordChar;
2023-05-24 04:16:07 +00:00
private UserItem m_SelectedUserItem;
#endregion
#region Constructor
public ControlCenterEquipUser(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; }
}
2023-05-24 04:16:07 +00:00
public UserItem SelectedUserItem
{
2023-05-24 04:16:07 +00:00
get { return this.m_SelectedUserItem; }
private set { this.m_SelectedUserItem = value; }
}
#endregion
#region Method
public void InitializeDesign()
{
Class1 images = new Class1();
2023-05-24 04:16:07 +00:00
if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.English
|| this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Spanish)
{
this.labelTitleID.Text = "ID";
this.labelTitlePassword.Text = "Password";
2023-05-24 04:16:07 +00:00
this.labelTitleExpiryDateOfAccount.Text = "Expiry date(ID)";
this.labelTitleExpiryDateOfPassword.Text = "Expiry date(PW)";
this.labelTitleAutomaticLogoutTime.Text = "Auto Logout";
this.labelAutoLogoutWarning.Text = "* Applies to all ID";
this.labelTitleAccessRight.Text = "Access right";
this.labelTitleMain.Text = "Main";
this.labelTitleMenu.Text = "Menu";
this.checkBoxChangeNo.Text = "Change No.";
this.checkBoxChangeWeight.Text = "Change Weight";
this.checkBoxClear.Text = "Clear";
this.checkBoxSubMenu.Text = "SubMenu";
this.checkBoxTime.Text = "Time setting";
this.checkBoxProduct.Text = "Product settings";
this.checkBoxDataStat.Text = "Data stats";
this.checkBoxSerial.Text = "Serial port";
this.checkBoxEthernet.Text = "Ethernet";
this.checkBoxCalibration.Text = "Calibration";
this.checkBoxJudgment.Text = "Judgment";
this.checkBoxSorter.Text = "Sorter settings";
this.checkBoxAutoZero.Text = "Auto zero";
this.checkBoxIOTest.Text = "I/O test";
this.checkBoxExternalOutput.Text = "External output";
this.checkBoxUpdate.Text = "Update";
this.checkBoxInitialization.Text = "Initialization";
this.checkBoxFeature.Text = "Feature settings";
this.checkBoxUser.Text = "User setting permission";
this.checkBoxLog.Text = "Log";
}
2023-05-24 04:16:07 +00:00
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese)
{
this.labelTitleID.Text = "用户名";
this.labelTitlePassword.Text = "密码";
2023-05-24 04:16:07 +00:00
this.labelTitleExpiryDateOfAccount.Text = "到期日(用户名)";
this.labelTitleExpiryDateOfPassword.Text = "到期日(密码)";
this.labelTitleAutomaticLogoutTime.Text = "自动注销";
this.labelAutoLogoutWarning.Text = "* 适用于所有身份证";
this.labelTitleAccessRight.Text = "访问权";
this.labelTitleMain.Text = "主屏幕";
this.labelTitleMenu.Text = "菜单";
this.checkBoxChangeNo.Text = "产品变化";
this.checkBoxChangeWeight.Text = "体重设定";
this.checkBoxClear.Text = "消除";
this.checkBoxSubMenu.Text = "子菜单";
this.checkBoxTime.Text = "时间设定";
this.checkBoxProduct.Text = "产品设置";
this.checkBoxDataStat.Text = "数据统计";
this.checkBoxSerial.Text = "串行端口";
this.checkBoxEthernet.Text = "以太网";
this.checkBoxCalibration.Text = "校准";
this.checkBoxJudgment.Text = "判断设置";
this.checkBoxSorter.Text = "筛选设定";
this.checkBoxAutoZero.Text = "自动零点跟踪";
this.checkBoxIOTest.Text = "I/O测试";
this.checkBoxExternalOutput.Text = "外部输出";
this.checkBoxUpdate.Text = "更新";
this.checkBoxInitialization.Text = "工厂初期化";
this.checkBoxFeature.Text = "功能设定";
this.checkBoxUser.Text = "用户设置权限";
this.checkBoxLog.Text = "日志";
}
2023-05-24 04:16:07 +00:00
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Czech)
{
}
2023-05-24 04:16:07 +00:00
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Russian)
{
this.labelTitleID.Text = "ID";
this.labelTitlePassword.Text = "Пароль";
2023-05-24 04:16:07 +00:00
this.labelTitleExpiryDateOfAccount.Text = "Истечения(ID)";
this.labelTitleExpiryDateOfPassword.Text = "Истечения(Пароль)";
this.labelTitleAutomaticLogoutTime.Text = "Автоматический выход";
this.labelAutoLogoutWarning.Text = "* Все идентификаторы";
this.labelTitleAccessRight.Text = "Право доступа";
this.labelTitleMain.Text = "Зернистый";
this.labelTitleMenu.Text = "Меню";
this.checkBoxChangeNo.Text = "Изменять товар";
this.checkBoxChangeWeight.Text = "Настройки вектора";
this.checkBoxClear.Text = "Сброс";
this.checkBoxSubMenu.Text = "Подменю";
this.checkBoxTime.Text = "Настройки времени";
this.checkBoxProduct.Text = "Настройки продукта";
this.checkBoxDataStat.Text = "Статистика данных";
this.checkBoxSerial.Text = "Послед. порт";
this.checkBoxEthernet.Text = "Локальная сеть";
this.checkBoxCalibration.Text = "Калибровка";
this.checkBoxJudgment.Text = "Oтбраковки";
this.checkBoxSorter.Text = "Cортировки";
this.checkBoxAutoZero.Text = "Автоотслеживание нуля";
this.checkBoxIOTest.Text = "Тест ввода/вывода";
this.checkBoxExternalOutput.Text = "Внешний выход";
this.checkBoxUpdate.Text = "Обновить";
this.checkBoxInitialization.Text = "Инициализация";
this.checkBoxFeature.Text = "Функция";
this.checkBoxUser.Text = "Пользователь";
this.checkBoxLog.Text = "Бревно";
}
2023-05-24 04:16:07 +00:00
else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German)
{
this.labelTitleID.Text = "ID";
this.labelTitlePassword.Text = "Passwort";
2023-05-24 04:16:07 +00:00
this.labelTitleExpiryDateOfAccount.Text = "Verfallsdatum(ID)";
this.labelTitleExpiryDateOfPassword.Text = "Verfallsdatum(PW)";
this.labelTitleAutomaticLogoutTime.Text = "Automatische Abmeldung";
this.labelAutoLogoutWarning.Text = "* Gilt für alle ID";
this.labelTitleAccessRight.Text = "Zugangsberechtigung";
this.labelTitleMain.Text = "Hauptbildschirm";
this.labelTitleMenu.Text = "Menü";
this.checkBoxChangeNo.Text = "Warenwechsel";
this.checkBoxChangeWeight.Text = "Gewichts-Einstellungen";
this.checkBoxClear.Text = "Löschen";
this.checkBoxSubMenu.Text = "Untermenü";
this.checkBoxTime.Text = "Zeiteinstellung";
this.checkBoxProduct.Text = "Produkt";
this.checkBoxDataStat.Text = "Statistik";
this.checkBoxSerial.Text = "Seriell";
this.checkBoxEthernet.Text = "Ethernet";
this.checkBoxCalibration.Text = "Kalibrierung";
this.checkBoxJudgment.Text = "Beurteilung";
this.checkBoxSorter.Text = "Sorter";
this.checkBoxAutoZero.Text = "Automatische Nullung";
this.checkBoxIOTest.Text = "I/O Test";
this.checkBoxExternalOutput.Text = "Externer Ausgang";
this.checkBoxUpdate.Text = "Aktualisierung";
this.checkBoxInitialization.Text = "Werkseinstellung";
this.checkBoxFeature.Text = "Besonderheit";
this.checkBoxUser.Text = "Benutzer";
this.checkBoxLog.Text = "Protokoll";
}
else
{
this.labelTitleID.Text = "ID";
2023-05-24 04:16:07 +00:00
this.labelTitlePassword.Text = "비밀번호";
this.labelTitleExpiryDateOfAccount.Text = "만료일(ID)";
this.labelTitleExpiryDateOfPassword.Text = "만료일(PW)";
this.labelTitleAutomaticLogoutTime.Text = "자동 로그아웃";
this.labelAutoLogoutWarning.Text = "* 모든 ID에 적용됨";
this.labelTitleAccessRight.Text = "접근 권한";
this.labelTitleMain.Text = "메인화면";
this.labelTitleMenu.Text = "메뉴화면";
this.checkBoxChangeNo.Text = "품번변경";
this.checkBoxChangeWeight.Text = "중량설정";
this.checkBoxClear.Text = "소거";
this.checkBoxSubMenu.Text = "서브메뉴";
this.checkBoxTime.Text = "시간설정";
this.checkBoxProduct.Text = "품목설정";
this.checkBoxDataStat.Text = "데이터집계";
this.checkBoxSerial.Text = "시리얼통신";
this.checkBoxEthernet.Text = "이더넷통신";
this.checkBoxCalibration.Text = "중량조정";
this.checkBoxJudgment.Text = "판정설정";
this.checkBoxSorter.Text = "선별기설정";
this.checkBoxAutoZero.Text = "자동영점";
this.checkBoxIOTest.Text = "I/O테스트";
this.checkBoxExternalOutput.Text = "외부출력";
this.checkBoxUpdate.Text = "업데이트";
this.checkBoxInitialization.Text = "공장초기화";
this.checkBoxFeature.Text = "기능설정";
this.checkBoxUser.Text = "유저설정권한";
this.checkBoxLog.Text = "로그";
}
}
private void DefaultSetting()
{
2023-05-24 04:16:07 +00:00
this.IsNew = false;
this.PasswordChar = false;
this.DisplayOnlyPart11Item();
this.smartKeyboard.KeyboardType = SmartX.SmartKeyboard.KEYBOARDTYPES.NORMAL;
this.smartKeyboard.Show();
2023-05-24 04:16:07 +00:00
}
private bool UI_Invoke(ThreadStart invoker)
{
try
{
if (this.InvokeRequired)
{
if (this.IsDisposed)
return true;
this.Invoke(invoker);
}
else
{
invoker();
}
2023-05-24 04:16:07 +00:00
return true;
}
catch (Exception e)
{
return false;
}
}
2023-05-24 04:16:07 +00:00
public void DisplayOnlyPart11Item()
{
2023-05-24 04:16:07 +00:00
if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true)
{
this.labelTitleExpiryDateOfAccount.Visible = true;
this.labelExpiryDateOfAccount.Visible = true;
this.labelExpiryDateOfAccount2.Visible = true;
this.labelTitleExpiryDateOfPassword.Visible = true;
this.labelExpiryDateOfPassword.Visible = true;
this.labelExpiryDateOfPassword2.Visible = true;
this.labelTitleAutomaticLogoutTime.Visible = true;
this.labelAutomaticLogoutTime.Visible = true;
this.smartLabel3.Visible = true;
this.smartLabel8.Visible = true;
this.smartLabel11.Visible = true;
this.labelAutoLogoutWarning.Visible = true;
}
else
{
this.labelTitleExpiryDateOfAccount.Visible = false;
this.labelExpiryDateOfAccount.Visible = false;
this.labelExpiryDateOfAccount2.Visible = false;
this.labelTitleExpiryDateOfPassword.Visible = false;
this.labelExpiryDateOfPassword.Visible = false;
this.labelExpiryDateOfPassword2.Visible = false;
this.labelTitleAutomaticLogoutTime.Visible = false;
this.labelAutomaticLogoutTime.Visible = false;
this.smartLabel3.Visible = false;
this.smartLabel8.Visible = false;
this.smartLabel11.Visible = false;
this.labelAutoLogoutWarning.Visible = false;
}
}
2023-05-24 04:16:07 +00:00
private void SetTextBoxPasswordChar(bool bValue)
{
if (bValue == false)
this.textBoxPassword.PasswordChar = '*';
else
this.textBoxPassword.PasswordChar = default(char);
}
public void DisplayHiddenMenu(bool bValue)
{
this.PasswordChar = bValue;
this.SetTextBoxPasswordChar(this.PasswordChar);
}
2023-05-24 04:16:07 +00:00
private void SetEnableID(bool value)
{
this.textBoxID.Enabled = value;
this.buttonIDEdit.Enabled = value;
2023-05-24 04:16:07 +00:00
if (value == true)
this.textBoxID.BackColor = Color.White;
else
this.textBoxID.BackColor = Color.Silver;
}
private void SetEnablePassword(bool value)
{
this.textBoxPassword.Enabled = value;
this.buttonPasswordEdit.Enabled = value;
2023-05-24 04:16:07 +00:00
if (value == true)
this.textBoxPassword.BackColor = Color.White;
else
this.textBoxPassword.BackColor = Color.Silver;
}
2023-05-24 04:16:07 +00:00
private void SetEnableAccessRightButton(bool value)
{
2023-05-24 04:16:07 +00:00
this.buttonLevel1.Enabled = value;
this.buttonLevel2.Enabled = value;
this.buttonLevel3.Enabled = value;
2023-05-24 04:16:07 +00:00
this.buttonLevel1.ButtonUp();
this.buttonLevel2.ButtonUp();
this.buttonLevel3.ButtonUp();
}
2023-05-24 04:16:07 +00:00
private void SetEnableOnlyPart11Value(bool value)
{
this.labelExpiryDateOfAccount.Enabled = value;
this.labelExpiryDateOfPassword.Enabled = value;
2023-05-24 04:16:07 +00:00
if (value == true)
{
this.labelExpiryDateOfAccount.BackColor = Color.White;
this.labelExpiryDateOfPassword.BackColor = Color.White;
}
else
{
this.labelExpiryDateOfAccount.BackColor = Color.Silver;
this.labelExpiryDateOfPassword.BackColor = Color.Silver;
}
}
private void SetEnableControl(bool value)
{
2023-05-24 04:16:07 +00:00
this.listBoxUserList.Enabled = value;
2023-05-24 04:16:07 +00:00
this.buttonLevel1.Enabled = value;
this.buttonLevel2.Enabled = value;
this.buttonLevel3.Enabled = value;
2023-05-24 04:16:07 +00:00
this.buttonNew.Enabled = value;
this.buttonDelete.Enabled = value;
this.buttonSave.Enabled = value;
2023-05-24 04:16:07 +00:00
this.buttonChangeLevelName.Enabled = value;
this.buttonGroupEditor.Enabled = value;
this.SetEnableOnlyPart11Value(value);
}
2023-05-24 04:16:07 +00:00
private void KeyboardClose()
{
this.smartKeyboard.Hide();
2023-05-24 04:16:07 +00:00
this.SetEnableControl(true);
this.SetEnablePassword(true);
}
private void UserNew()
{
this.UpdateInitializeUserDisplay(this.ParentForm.ParentForm.SystemConfig2);
}
private void SaveUserDll()
{
string detail = "";
string code = "", message1 = "", message2 = "";
#region listbox 미선택 시 신규 유저 등록, 선택 시 기존 유저 정보 수정
if (this.IsNew == true)
{
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
code = "유저 설정";
message1 = "신규 사용자 추가 하시겠습니까?";
message2 = "";
break;
case Define.E_LanguageID.English:
code = "User Editor";
message1 = "Would you like to register as a user?";
message2 = "";
break;
case Define.E_LanguageID.Chinese:
code = "用户设置";
message1 = "您想注册为用户吗?";
message2 = "";
break;
case Define.E_LanguageID.Russian:
code = "Пользовательские настройки";
message1 = "Хотите зарегистрироваться как пользователь?";
message2 = "";
break;
case Define.E_LanguageID.German:
code = "Benutzereinstellungen";
message1 = "Sie möchten sich als Benutzer registrieren?";
message2 = "";
break;
case Define.E_LanguageID.Spanish:
code = "Ajustes de usuario";
message1 = "¿Quieres registrarte como usuario?";
message2 = "";
break;
default:
break;
}
}
else
{
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
code = "유저 설정";
message1 = "선택된 사용자의 정보를 수정 하시겠습니까?";
message2 = "";
break;
case Define.E_LanguageID.English:
code = "User Editor";
message1 = "Are you sure you want to edit the";
message2 = "selected user's information?";
break;
case Define.E_LanguageID.Chinese:
code = "用户设置";
message1 = "您确定要编辑所选用户的信息吗?";
message2 = "";
break;
case Define.E_LanguageID.Russian:
code = "Пользовательские настройки";
message1 = "Вы уверены, что хотите изменить";
message2 = "информацию о выбранном пользователе?";
break;
case Define.E_LanguageID.German:
code = "Benutzereinstellungen";
message1 = "Möchten Sie die Informationen des";
message2 = "ausgewählten Benutzers wirklich bearbeiten?";
break;
case Define.E_LanguageID.Spanish:
code = "Ajustes de usuario";
message1 = "¿Está seguro de que desea editar";
message2 = "la información del usuario seleccionado?";
break;
default:
break;
}
}
#endregion
DialogFormYesNo dlg = new DialogFormYesNo(Define.E_MessageBoxIcon.Question, code, message1, message2);
if (dlg.ShowDialog() == DialogResult.Yes)
{
UserItem item = new UserItem();
DateTime time = DateTime.Now;
UserManager.MenuID_t menuId = new UserManager.MenuID_t();
#region ID, Password 검사
// Check ID
if (this.IsNew == true)
{
if (this.textBoxID.Text.Length < 6)
{
// ID : 6~20자 입력하세요
DialogFormMessage msg = new DialogFormMessage(null, 3, this.ParentForm.ParentForm.SystemConfig1.Language);
msg.ShowDialog();
return;
}
}
// Check Password
if (this.textBoxPassword.Text.Length < 6)
{
// PASSWORD : 6~20자 입력하세요
DialogFormMessage msg = new DialogFormMessage(null, 9, this.ParentForm.ParentForm.SystemConfig1.Language);
msg.ShowDialog();
return;
}
if (this.labelAccessRight.Text == "")
{
// 필수 설정 항목을 설정해 주십시오
DialogFormMessage msg = new DialogFormMessage(null, 16, this.ParentForm.ParentForm.SystemConfig1.Language);
msg.ShowDialog();
return;
}
if (this.labelExpiryDateOfAccount.Text == "000")
{
// 필수 설정 항목을 설정해 주십시오
DialogFormMessage msg = new DialogFormMessage(null, 16, this.ParentForm.ParentForm.SystemConfig1.Language);
msg.ShowDialog();
return;
}
if (this.labelExpiryDateOfPassword.Text == "00")
{
// 필수 설정 항목을 설정해 주십시오
DialogFormMessage msg = new DialogFormMessage(null, 16, this.ParentForm.ParentForm.SystemConfig1.Language);
msg.ShowDialog();
return;
}
#endregion
item.ID = this.textBoxID.Text;
item.SetPassword(this.textBoxPassword.Text);
item.ExpireAccount = int.Parse(this.labelExpiryDateOfAccount.Text);
item.ExpirePassword = int.Parse(this.labelExpiryDateOfPassword.Text);
if (this.buttonLevel1.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
item.ActiveLevel = 1;
else if (this.buttonLevel2.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
item.ActiveLevel = 2;
else if (this.buttonLevel3.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
item.ActiveLevel = 3;
else if (this.SelectedUserItem.Group == Define.E_UserGroup.Admin)
{
if(this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true)
item.ActiveLevel = 9;
}
menuId.fMenu = new bool[UserManager.USER_MENU_ID_MAX];
for (int i = 0; i < UserManager.USER_MENU_ID_MAX; i++)
menuId.fMenu[i] = false;
if (this.IsNew == true)
{
#region 신규 등록
if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true)
{
if (item.ActiveLevel == 1 || item.ActiveLevel == 2 || item.ActiveLevel == 3)
UserManager.UserManager_UserNew(item.ID, item.Password, 0, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId);
else
UserManager.UserManager_UserNew(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId);
}
else // Part11 미사용, Login 사용 시, 항상 관리자로 지정
UserManager.UserManager_UserNew(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId);
// Part 11
detail = string.Format("Add : {0}", item.ID);
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail);
#endregion
}
else
{
#region 유저 수정
if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true)
{
if (item.ActiveLevel == 1 || item.ActiveLevel == 2 || item.ActiveLevel == 3)
UserManager.UserManager_UserModify(item.ID, item.Password, 0, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId);
else
UserManager.UserManager_UserModify(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId);
}
else // Part11 미사용, Login 사용 시, 항상 관리자로 지정
UserManager.UserManager_UserModify(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId);
// Part 11
detail = string.Format("Modify : {0}", item.ID);
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail);
#endregion
}
this.buttonSave.Visible = false;
}
}
public void UpdateLevelNameDisplay(SystemConfigurationItem2 system)
{
2023-05-24 04:16:07 +00:00
this.buttonLevel1.Text = this.textBoxLevel1.Text = system.UserGroupLevel1Name;
this.buttonLevel2.Text = this.textBoxLevel2.Text = system.UserGroupLevel2Name;
this.buttonLevel3.Text = this.textBoxLevel3.Text = system.UserGroupLevel3Name;
}
private void UpdateInitializeUserDisplay(SystemConfigurationItem2 system)
{
this.SelectedUserItem = new UserItem();
this.IsNew = true;
this.textBoxID.Text = "";
this.textBoxPassword.Text = "";
this.labelExpiryDateOfAccount.Text = "180";
this.labelExpiryDateOfPassword.Text = "90";
this.labelExpiryDateOfAccount2.Text = "yyyy.mm.DD";
this.labelExpiryDateOfPassword2.Text = "yyyy.mm.DD";
this.labelAccessRight.Text = "";
this.labelExpiryDateOfAccount2.ForeColor = Color.White;
this.labelExpiryDateOfPassword2.ForeColor = Color.White;
this.checkBoxChangeNo.Checked = false;
this.checkBoxChangeWeight.Checked = false;
this.checkBoxClear.Checked = false;
this.checkBoxSubMenu.Checked = false;
this.checkBoxTime.Checked = false;
this.checkBoxProduct.Checked = false;
this.checkBoxDataStat.Checked = false;
this.checkBoxSerial.Checked = false;
this.checkBoxEthernet.Checked = false;
this.checkBoxCalibration.Checked = false;
this.checkBoxJudgment.Checked = false;
this.checkBoxSorter.Checked = false;
this.checkBoxAutoZero.Checked = false;
this.checkBoxIOTest.Checked = false;
this.checkBoxExternalOutput.Checked = false;
this.checkBoxUpdate.Checked = false;
this.checkBoxInitialization.Checked = false;
this.checkBoxFeature.Checked = false;
this.checkBoxUser.Checked = false;
this.checkBoxLog.Checked = false;
this.KeyboardClose();
this.SetEnableID(true);
this.SetEnableAccessRightButton(true);
this.SetTextBoxPasswordChar(this.PasswordChar);
this.buttonDelete.Visible = false;
this.buttonSave.Visible = false;
this.buttonChangeLevelName.Visible = false;
this.listBoxUserList.SelectedIndexChanged -= new EventHandler(this.listBoxUserList_SelectedIndexChanged);
this.listBoxUserList.SelectItemIndex = -1;
this.listBoxUserList.SelectedIndexChanged += new EventHandler(this.listBoxUserList_SelectedIndexChanged);
}
private void UpdateCurrentUserItem(UserManager.UserMgr_user_list_t item)
{
try
{
2023-05-24 04:16:07 +00:00
// CurrentUserItem SET
this.SelectedUserItem.ID = item.user_id;
this.SelectedUserItem.Password = item.user_pw;
this.SelectedUserItem.ExpireAccount = item.expire_period_account;
this.SelectedUserItem.ExpirePassword = item.expire_period_pw;
if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true)
this.SelectedUserItem.IsAdmin = item.fadmin == 0 ? false : true;
else
this.SelectedUserItem.IsAdmin = true;
this.SelectedUserItem.ActiveLevel = item.active_level;
if (this.SelectedUserItem.ActiveLevel == 1)
this.SelectedUserItem.Group = Define.E_UserGroup.Level1;
else if (this.SelectedUserItem.ActiveLevel == 2)
this.SelectedUserItem.Group = Define.E_UserGroup.Level2;
else if (this.SelectedUserItem.ActiveLevel == 3)
this.SelectedUserItem.Group = Define.E_UserGroup.Level3;
else if (this.SelectedUserItem.ActiveLevel == 9)
this.SelectedUserItem.Group = Define.E_UserGroup.Admin;
else if (this.SelectedUserItem.ActiveLevel == 10)
this.SelectedUserItem.Group = Define.E_UserGroup.Developer;
else
this.SelectedUserItem.Group = Define.E_UserGroup.None;
if (this.SelectedUserItem.Group == Define.E_UserGroup.Admin
|| this.SelectedUserItem.Group == Define.E_UserGroup.Developer)
{
this.SelectedUserItem.DateRegister = DateTime.Now;
this.SelectedUserItem.DateLogin = DateTime.Now;
this.SelectedUserItem.DateExpireRegister = DateTime.Now;
this.SelectedUserItem.DateExpireLogin = DateTime.Now;
}
else
{
2023-05-24 04:16:07 +00:00
DateTime time = DateTime.ParseExact(item.register_date.GetDateTime(), "yyyyMMddHHmmss", null);
this.SelectedUserItem.DateRegister = time;
time = DateTime.ParseExact(item.login_date.GetDateTime(), "yyyyMMddHHmmss", null);
this.SelectedUserItem.DateLogin = time;
time = DateTime.ParseExact(item.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null);
this.SelectedUserItem.DateExpireLogin = time;
time = DateTime.ParseExact(item.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null);
this.SelectedUserItem.DateExpireRegister = time;
}
2023-05-24 04:16:07 +00:00
this.SelectedUserItem.IsLockAccount = item.flock_status_account == 0 ? false : true;
this.SelectedUserItem.IsLockPassword = item.flock_status_password == 0 ? false : true;
}
catch (Exception ex)
{
FormMain.Exception(ex);
}
}
private void UpdateCurrentUserItem(UserManager.UserMgr_user_info_t item)
{
// CurrentUserItem SET
this.SelectedUserItem.ID = item.user_id;
this.SelectedUserItem.Password = item.user_pw;
this.SelectedUserItem.ExpireAccount = item.expire_period_account;
this.SelectedUserItem.ExpirePassword = item.expire_period_pw;
DateTime time = DateTime.ParseExact(item.register_date.GetDateTime(), "yyyyMMddHHmmss", null);
this.SelectedUserItem.DateRegister = time;
time = DateTime.ParseExact(item.login_date.GetDateTime(), "yyyyMMddHHmmss", null);
this.SelectedUserItem.DateLogin = time;
time = DateTime.ParseExact(item.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null);
this.SelectedUserItem.DateExpireLogin = time;
time = DateTime.ParseExact(item.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null);
this.SelectedUserItem.DateExpireRegister = time;
this.SelectedUserItem.IsLockAccount = item.flock_status_account == 0 ? false : true;
this.SelectedUserItem.IsLockPassword = item.flock_status_password == 0 ? false : true;
if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true)
this.SelectedUserItem.IsAdmin = item.fadmin == 0 ? false : true;
else
this.SelectedUserItem.IsAdmin = true;
this.SelectedUserItem.ActiveLevel = item.active_level;
if (item.active_level == 1)
this.SelectedUserItem.Group = Define.E_UserGroup.Level1;
else if (item.active_level == 2)
this.SelectedUserItem.Group = Define.E_UserGroup.Level2;
else if (item.active_level == 3)
this.SelectedUserItem.Group = Define.E_UserGroup.Level3;
else if (item.active_level == 9)
this.SelectedUserItem.Group = Define.E_UserGroup.Admin;
else if (item.active_level == 10)
this.SelectedUserItem.Group = Define.E_UserGroup.Developer;
}
private void UpdateSelectUserDisplay(UserItem item)
{
this.SetEnableID(false);
this.SetEnablePassword(true);
this.SetEnableControl(true);
2023-05-24 04:16:07 +00:00
this.textBoxID.Text = item.ID;
this.textBoxPassword.Text = item.Password;
if (this.listBoxUserList.SelectItemIndex == 0)
{
this.labelExpiryDateOfAccount.Text = "0";
this.labelExpiryDateOfPassword.Text = "0";
this.labelExpiryDateOfAccount2.Text = "-";
this.labelExpiryDateOfPassword2.Text = "-";
this.labelExpiryDateOfAccount2.ForeColor = Color.White;
this.labelExpiryDateOfPassword2.ForeColor = Color.White;
this.buttonDelete.Visible = false;
this.SetEnableAccessRightButton(false);
this.SetEnableOnlyPart11Value(false);
if (this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Admin
|| this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Developer)
this.SetEnablePassword(true);
else
this.SetEnablePassword(false);
}
else
{
this.labelExpiryDateOfAccount.Text = item.ExpireAccount.ToString();
this.labelExpiryDateOfPassword.Text = item.ExpirePassword.ToString();
this.SetEnableOnlyPart11Value(true);
2023-05-24 04:16:07 +00:00
if (this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel < item.ActiveLevel)
{
this.buttonDelete.Visible = false;
this.SetEnableAccessRightButton(false);
this.SetEnableOnlyPart11Value(false);
this.SetEnablePassword(false);
}
if (item.IsLockAccount == true)
{
this.labelExpiryDateOfAccount2.ForeColor = Color.Red;
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
this.labelExpiryDateOfAccount2.Text = "계정 만료";
break;
case Define.E_LanguageID.English:
this.labelExpiryDateOfAccount2.Text = "Account expiration";
break;
case Define.E_LanguageID.Chinese:
this.labelExpiryDateOfAccount2.Text = "账户过期";
break;
case Define.E_LanguageID.Russian:
this.labelExpiryDateOfAccount2.Text = "Срок действия учетной записи";
break;
case Define.E_LanguageID.German:
this.labelExpiryDateOfAccount2.Text = "Kontoablauf";
break;
case Define.E_LanguageID.Spanish:
this.labelExpiryDateOfAccount2.Text = "Caducidad de la cuenta";
break;
default:
break;
}
}
else
{
this.labelExpiryDateOfAccount2.ForeColor = Color.White;
this.labelExpiryDateOfAccount2.Text = string.Format("{0:yy/MM/dd} ~ {1:yy/MM/dd}", item.DateLogin, item.DateExpireLogin);
}
2023-05-24 04:16:07 +00:00
if (item.IsLockPassword == true)
{
this.labelExpiryDateOfPassword2.ForeColor = Color.Red;
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
this.labelExpiryDateOfPassword2.Text = "비밀번호 만료";
break;
case Define.E_LanguageID.English:
this.labelExpiryDateOfPassword2.Text = "Password expiration";
break;
case Define.E_LanguageID.Chinese:
this.labelExpiryDateOfPassword2.Text = "密码过期";
break;
case Define.E_LanguageID.Russian:
this.labelExpiryDateOfPassword2.Text = "Срок действия пароля";
break;
case Define.E_LanguageID.German:
this.labelExpiryDateOfPassword2.Text = "Kennwortablauf";
break;
case Define.E_LanguageID.Spanish:
this.labelExpiryDateOfPassword2.Text = "Caducidad de la contraseña";
break;
default:
break;
}
}
else
{
this.labelExpiryDateOfPassword2.ForeColor = Color.White;
this.labelExpiryDateOfPassword2.Text = string.Format("{0:yy/MM/dd} ~ {1:yy/MM/dd}", item.DateRegister, item.DateExpireRegister);
}
}
2023-05-24 04:16:07 +00:00
this.CheckBoxCheckedAsLevel(item.Group);
//this.cbAdministrator.Visible = true;
//this.cbAdministrator.Checked = item.IsAdmin;
}
2023-05-24 04:16:07 +00:00
private void UpdateUserListBoxDisplay(List<string> items)
{
2023-05-24 04:16:07 +00:00
this.listBoxUserList.ClearAll();
for (int i = 1; i < items.Count; i++)
this.listBoxUserList.AddItem(items[i]);
}
private void CheckBoxCheckedAsLevel(Define.E_UserGroup level)
{
switch (level)
{
case Define.E_UserGroup.Level1:
this.buttonLevel1.ButtonDown();
this.buttonLevel2.ButtonUp();
this.buttonLevel3.ButtonUp();
this.labelAccessRight.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel1Name;
this.checkBoxChangeNo.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayProductNo;
this.checkBoxChangeWeight.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting;
this.checkBoxClear.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayClear;
this.checkBoxSubMenu.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplaySubMenu;
this.checkBoxTime.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsBasicTime;
this.checkBoxProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsBasicProduct;
this.checkBoxDataStat.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsBasicDataStatistics;
this.checkBoxSerial.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsConfiSerial;
this.checkBoxEthernet.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsConfiEthernet;
this.checkBoxCalibration.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsSystemCalibration;
this.checkBoxJudgment.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsSystemJudgmentSetting;
this.checkBoxSorter.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsSystemSorterSetting;
this.checkBoxAutoZero.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsSystemAutoZero;
this.checkBoxIOTest.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsSystemIOTest;
this.checkBoxExternalOutput.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsSystemExternalOutput;
this.checkBoxUpdate.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsEquipUpdate;
this.checkBoxInitialization.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsEquipInitialize;
this.checkBoxFeature.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsEquipFunctionSetting;
this.checkBoxUser.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsEquipUserSetting;
this.checkBoxLog.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsLogEnable;
break;
case Define.E_UserGroup.Level2:
this.buttonLevel1.ButtonUp();
this.buttonLevel2.ButtonDown();
this.buttonLevel3.ButtonUp();
this.labelAccessRight.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel2Name;
this.checkBoxChangeNo.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayProductNo;
this.checkBoxChangeWeight.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting;
this.checkBoxClear.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayClear;
this.checkBoxSubMenu.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplaySubMenu;
this.checkBoxTime.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsBasicTime;
this.checkBoxProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsBasicProduct;
this.checkBoxDataStat.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsBasicDataStatistics;
this.checkBoxSerial.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsConfiSerial;
this.checkBoxEthernet.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsConfiEthernet;
this.checkBoxCalibration.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsSystemCalibration;
this.checkBoxJudgment.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsSystemJudgmentSetting;
this.checkBoxSorter.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsSystemSorterSetting;
this.checkBoxAutoZero.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsSystemAutoZero;
this.checkBoxIOTest.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsSystemIOTest;
this.checkBoxExternalOutput.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsSystemExternalOutput;
this.checkBoxUpdate.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsEquipUpdate;
this.checkBoxInitialization.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsEquipInitialize;
this.checkBoxFeature.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsEquipFunctionSetting;
this.checkBoxUser.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsEquipUserSetting;
this.checkBoxLog.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsLogEnable;
break;
case Define.E_UserGroup.Level3:
this.buttonLevel1.ButtonUp();
this.buttonLevel2.ButtonUp();
this.buttonLevel3.ButtonDown();
this.labelAccessRight.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel3Name;
this.checkBoxChangeNo.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayProductNo;
this.checkBoxChangeWeight.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.checkBoxClear.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayClear;
this.checkBoxSubMenu.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplaySubMenu;
this.checkBoxTime.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsBasicTime;
this.checkBoxProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsBasicProduct;
this.checkBoxDataStat.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsBasicDataStatistics;
this.checkBoxSerial.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsConfiSerial;
this.checkBoxEthernet.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsConfiEthernet;
this.checkBoxCalibration.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsSystemCalibration;
this.checkBoxJudgment.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsSystemJudgmentSetting;
this.checkBoxSorter.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsSystemSorterSetting;
this.checkBoxAutoZero.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsSystemAutoZero;
this.checkBoxIOTest.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsSystemIOTest;
this.checkBoxExternalOutput.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsSystemExternalOutput;
this.checkBoxUpdate.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsEquipUpdate;
this.checkBoxInitialization.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsEquipInitialize;
this.checkBoxFeature.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsEquipFunctionSetting;
this.checkBoxUser.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsEquipUserSetting;
this.checkBoxLog.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsLogEnable;
break;
case Define.E_UserGroup.Admin:
this.SetEnableAccessRightButton(false);
this.labelAccessRight.Text = "Administrator";
this.checkBoxChangeNo.Checked = true;
this.checkBoxChangeWeight.Checked = true;
this.checkBoxClear.Checked = true;
this.checkBoxSubMenu.Checked = true;
this.checkBoxTime.Checked = true;
this.checkBoxProduct.Checked = true;
this.checkBoxDataStat.Checked = true;
this.checkBoxSerial.Checked = true;
this.checkBoxEthernet.Checked = true;
this.checkBoxCalibration.Checked = true;
this.checkBoxJudgment.Checked = true;
this.checkBoxSorter.Checked = true;
this.checkBoxAutoZero.Checked = true;
this.checkBoxIOTest.Checked = true;
this.checkBoxExternalOutput.Checked = true;
this.checkBoxUpdate.Checked = true;
this.checkBoxInitialization.Checked = true;
this.checkBoxFeature.Checked = true;
this.checkBoxUser.Checked = true;
this.checkBoxLog.Checked = true;
break;
case Define.E_UserGroup.Developer:
this.SetEnableAccessRightButton(false);
this.labelAccessRight.Text = "Developer";
this.checkBoxChangeNo.Checked = true;
this.checkBoxChangeWeight.Checked = true;
this.checkBoxClear.Checked = true;
this.checkBoxSubMenu.Checked = true;
this.checkBoxTime.Checked = true;
this.checkBoxProduct.Checked = true;
this.checkBoxDataStat.Checked = true;
this.checkBoxSerial.Checked = true;
this.checkBoxEthernet.Checked = true;
this.checkBoxCalibration.Checked = true;
this.checkBoxJudgment.Checked = true;
this.checkBoxSorter.Checked = true;
this.checkBoxAutoZero.Checked = true;
this.checkBoxIOTest.Checked = true;
this.checkBoxExternalOutput.Checked = true;
this.checkBoxUpdate.Checked = true;
this.checkBoxInitialization.Checked = true;
this.checkBoxFeature.Checked = true;
this.checkBoxUser.Checked = true;
this.checkBoxLog.Checked = true;
break;
default:
this.SetEnableAccessRightButton(false);
this.labelAccessRight.Text = "";
this.checkBoxChangeNo.Checked = false;
this.checkBoxChangeWeight.Checked = false;
this.checkBoxClear.Checked = false;
this.checkBoxSubMenu.Checked = false;
this.checkBoxTime.Checked = false;
this.checkBoxProduct.Checked = false;
this.checkBoxDataStat.Checked = false;
this.checkBoxSerial.Checked = false;
this.checkBoxEthernet.Checked = false;
this.checkBoxCalibration.Checked = false;
this.checkBoxJudgment.Checked = false;
this.checkBoxSorter.Checked = false;
this.checkBoxAutoZero.Checked = false;
this.checkBoxIOTest.Checked = false;
this.checkBoxExternalOutput.Checked = false;
this.checkBoxUpdate.Checked = false;
this.checkBoxInitialization.Checked = false;
this.checkBoxFeature.Checked = false;
this.checkBoxUser.Checked = false;
this.checkBoxLog.Checked = false;
break;
}
}
public void CallBackGetUserData(UserManager.UserMgr_user_list_t user)
{
this.UpdateCurrentUserItem(user);
this.UI_Invoke(delegate
{
this.UpdateSelectUserDisplay(this.SelectedUserItem);
});
}
public void CallBackUserListNewData(UserManager.UserMgr_user_info_t user)
{
string code = "", message1 = "", message2 = "";
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
code = "유저설정";
message1 = "사용자 추가 완료!";
message2 = "";
break;
case Define.E_LanguageID.English:
code = "User settings";
message1 = "User addition complete!";
message2 = "";
break;
case Define.E_LanguageID.Chinese:
code = "用户设置";
message1 = "用户添加完成!";
message2 = "";
break;
case Define.E_LanguageID.Russian:
code = "Пользовательские настройки";
message1 = "Добавление пользователя завершено!";
message2 = "";
break;
case Define.E_LanguageID.German:
code = "Benutzereinstellungen";
message1 = "Benutzerhinzufügung abgeschlossen!";
message2 = "";
break;
case Define.E_LanguageID.Spanish:
code = "Ajustes de usuario";
message1 = "Adición de usuario completa!";
message2 = "";
break;
default:
break;
}
if (user.status == (int)UserManager.E_user_mgr_status.USER_MGR_STATUS_OK)
{
this.UI_Invoke(delegate
{
this.UpdateCurrentUserItem(user);
this.UpdateSelectUserDisplay(this.SelectedUserItem);
this.ParentForm.ParentForm.ListDllUserName.Add(user.user_id);
this.UpdateUserListBoxDisplay(this.ParentForm.ParentForm.ListDllUserName);
this.listBoxUserList.SelectItemIndex = this.listBoxUserList.ItemCount - 1;
this.SetEnableID(false);
this.SetEnablePassword(false);
this.SetEnableOnlyPart11Value(false);
this.buttonLevel1.Enabled = this.buttonLevel2.Enabled = this.buttonLevel3.Enabled = false;
this.labelAutomaticLogoutTime.Enabled = false;
DialogFormMessage dlg = new DialogFormMessage(Define.E_MessageBoxIcon.Asterisk, code, message1, message2, 0);
dlg.ShowDialog();
});
}
else
{
DialogFormMessage msg = new DialogFormMessage(null, user.status, this.ParentForm.ParentForm.SystemConfig1.Language);
msg.ShowDialog();
}
}
public void CallBackUserModifyUserData(UserManager.UserMgr_user_modify_t user)
{
string code = "", message1 = "", message2 = "";
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
code = "유저설정";
message1 = "사용자 정보 수정 완료!";
message2 = "";
break;
case Define.E_LanguageID.English:
code = "User settings";
message1 = "User information modified!";
message2 = "";
break;
case Define.E_LanguageID.Chinese:
code = "用户设置";
message1 = "用户信息修改!";
message2 = "";
break;
case Define.E_LanguageID.Russian:
code = "Пользовательские настройки";
message1 = "Информация о пользователе изменена!";
message2 = "";
break;
case Define.E_LanguageID.German:
code = "Benutzereinstellungen";
message1 = "Benutzerinformationen geändert!";
message2 = "";
break;
case Define.E_LanguageID.Spanish:
code = "Ajustes de usuario";
message1 = "¡Información de usuario modificada!";
message2 = "";
break;
default:
break;
}
if (user.status == (int)UserManager.E_user_mgr_status.USER_MGR_STATUS_OK)
{
2023-05-24 04:16:07 +00:00
this.UI_Invoke(delegate
{
2023-05-24 04:16:07 +00:00
// 메시지 박스 교체
UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[this.listBoxUserList.SelectItemIndex]);
2023-05-24 04:16:07 +00:00
DialogFormMessage dlg = new DialogFormMessage(Define.E_MessageBoxIcon.Asterisk, code, message1, message2, 0);
dlg.ShowDialog();
});
}
else
{
DialogFormMessage msg = new DialogFormMessage(null, user.status, this.ParentForm.ParentForm.SystemConfig1.Language);
msg.ShowDialog();
}
}
public void CallBackUserListLockDataEvent(UserManager.UserMgr_user_lock_t user)
{
if (user.user_id == this.SelectedUserItem.ID)
{
this.SelectedUserItem.IsLockAccount = user.flock_status_account == 0 ? false : true;
this.SelectedUserItem.IsLockPassword = user.flock_status_password == 0 ? false : true;
2023-05-24 04:16:07 +00:00
UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[this.listBoxUserList.SelectItemIndex]);
}
}
public void CallBackUserListDeleteDataEvent(UserManager.UserMgr_user_del_t user)
{
string code = "", message1 = "", message2 = "", detail = "";
2023-05-24 04:16:07 +00:00
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
code = "유저설정";
message1 = string.Format("{0} 사용자 삭제 완료!", user.user_id);
message2 = "";
break;
case Define.E_LanguageID.English:
code = "User settings";
message1 = string.Format("{0} User deletion complete!", user.user_id);
message2 = "";
break;
case Define.E_LanguageID.Chinese:
code = "用户设置";
message1 = string.Format("{0} 用户添加完成!", user.user_id);
message2 = "";
break;
case Define.E_LanguageID.Russian:
code = "Пользовательские настройки";
message1 = string.Format("{0} Добавление пользователя завершено!", user.user_id);
message2 = "";
break;
case Define.E_LanguageID.German:
code = "Benutzereinstellungen";
message1 = string.Format("{0} Benutzerhinzufügung abgeschlossen!", user.user_id);
message2 = "";
break;
case Define.E_LanguageID.Spanish:
code = "Ajustes de usuario";
message1 = string.Format("{0} Adición de usuario completa!", user.user_id);
message2 = "";
break;
default:
break;
}
2023-05-24 04:16:07 +00:00
if (user.status == 0)
{
for (int i = 0; i < this.ParentForm.ParentForm.ListDllUserName.Count; i++)
{
if (this.ParentForm.ParentForm.ListDllUserName[i] == user.user_id)
{
this.ParentForm.ParentForm.ListDllUserName.RemoveAt(i);
break;
}
}
2023-05-24 04:16:07 +00:00
this.UI_Invoke(delegate
{
this.UpdateUserListBoxDisplay(this.ParentForm.ParentForm.ListDllUserName);
this.UserNew();
DialogFormMessage dlg = new DialogFormMessage(Define.E_MessageBoxIcon.Asterisk, code, message1, message2, 0);
dlg.ShowDialog();
});
//// Part 11
//if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
//{
detail = string.Format("Delete : {0}", user.user_id);
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail);
//}
}
else
{
DialogFormMessage msg = new DialogFormMessage(null, user.status, this.ParentForm.ParentForm.SystemConfig1.Language);
msg.ShowDialog();
}
}
2023-05-24 04:16:07 +00:00
public void CallBackUserListModifyInfoDataEvent(UserManager.UserMgr_user_info_t user)
{
2023-05-24 04:16:07 +00:00
try
{
if (user.status == 0)
{
string detail = "", code = "", message1 = "", message2 = "";
// Part 11
detail = string.Format("Modify Password : {0}", user.user_id);
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail);
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
code = "비밀번호 변경";
message1 = "비밀번호가 변경되었습니다.";
message2 = "";
break;
case Define.E_LanguageID.English:
code = "Change Password";
message1 = "Password has been changed.";
message2 = "";
break;
case Define.E_LanguageID.Chinese:
code = "更改密码";
message1 = "您的密码已被更改。";
message2 = "";
break;
case Define.E_LanguageID.Russian:
code = "Изменить пароль";
message1 = "Ваш пароль был изменен.";
message2 = "";
break;
case Define.E_LanguageID.German:
code = "Kennwort ändern";
message1 = "Ihr Passwort wurde geändert.";
message2 = "";
break;
case Define.E_LanguageID.Spanish:
code = "Cambiar la contraseña";
message1 = "Tu contraseña ha sido cambiada.";
message2 = "";
break;
default:
break;
}
2023-05-24 04:16:07 +00:00
// 비밀번호가 변경되었습니다.
DialogFormMessage dlg = new DialogFormMessage(Define.E_MessageBoxIcon.Asterisk, code, message1, message2, 0);
dlg.ShowDialog();
}
else
{
DialogFormMessage myMsg = new DialogFormMessage(null, user.status, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
}
catch (Exception ex)
{
2023-05-24 04:16:07 +00:00
FormMain.Exception(ex);
}
}
2023-05-24 04:16:07 +00:00
public void DisplayRefresh(SystemStatus status)
{
this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.EquipUser;
this.ParentForm.ParentForm.SetDisplayMode(Define.E_DisplayMode.Menu);
this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus);
2023-05-24 04:16:07 +00:00
this.PasswordChar = false;
this.labelAutomaticLogoutTime.Text = this.ParentForm.ParentForm.SystemConfig2.UserAutomaticLogout.ToString();
this.labelAutomaticLogoutTime.Enabled = true;
2023-05-24 04:16:07 +00:00
this.UpdateUserListBoxDisplay(this.ParentForm.ParentForm.ListDllUserName);
this.UpdateLevelNameDisplay(this.ParentForm.ParentForm.SystemConfig2);
this.UpdateInitializeUserDisplay(this.ParentForm.ParentForm.SystemConfig2);
}
#endregion
2023-05-24 04:16:07 +00:00
#region Event Handler
private void listBoxUserList_SelectedIndexChanged(object sender, EventArgs e)
{
int index = this.listBoxUserList.SelectItemIndex;
this.IsNew = false;
this.SetEnableAccessRightButton(true);
this.SetEnablePassword(true);
this.SetTextBoxPasswordChar(this.PasswordChar);
this.labelAutomaticLogoutTime.Enabled = true;
if (index == 0)
{
UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[index]);
this.CheckBoxCheckedAsLevel(Define.E_UserGroup.Admin);
}
else if (index < 0)
{
this.UpdateInitializeUserDisplay(this.ParentForm.ParentForm.SystemConfig2);
}
else if (index > 0)
{
if (this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.ID == this.listBoxUserList.Items[index])
this.buttonDelete.Visible = false;
else
2023-05-24 04:16:07 +00:00
this.buttonDelete.Visible = true;
this.SetEnableID(false);
this.SetEnableControl(true);
this.SetEnablePassword(true);
UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[index]);
}
}
private void textBoxID_GotFocus(object sender, EventArgs e)
{
this.smartKeyboard.TargetInputObject = this.textBoxID;
this.textBoxID.Select(this.textBoxID.Text.Length, 0);
}
private void textBoxPassword_GotFocus(object sender, EventArgs e)
{
this.smartKeyboard.TargetInputObject = this.textBoxPassword;
this.textBoxPassword.Select(this.textBoxPassword.Text.Length, 0);
}
2023-05-24 04:16:07 +00:00
private void textBoxID_KeyPress(object sender, KeyPressEventArgs e)
{
2023-05-24 04:16:07 +00:00
if (e.KeyChar == '\r')
{
e.Handled = true;
2023-05-24 04:16:07 +00:00
this.KeyboardClose();
if (this.buttonSave.Visible == false)
this.buttonSave.Visible = true;
}
else if (e.KeyChar == 27)
{
e.Handled = true;
this.textBoxID.Text = this.SelectedUserItem.ID;
this.KeyboardClose();
}
else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?'
|| e.KeyChar == '*' || e.KeyChar == ':' || e.KeyChar == '/' || e.KeyChar == '\\')
{
e.Handled = true;
}
}
private void textBoxPassword_KeyPress(object sender, KeyPressEventArgs e)
{
2023-05-24 04:16:07 +00:00
if (e.KeyChar == '\r')
{
e.Handled = true;
if(this.PasswordChar == false)
this.SetTextBoxPasswordChar(this.PasswordChar);
this.KeyboardClose();
2023-05-24 04:16:07 +00:00
if (this.IsNew == true)
this.SetEnableID(true);
if (this.buttonSave.Visible == false)
this.buttonSave.Visible = true;
}
else if (e.KeyChar == 27)
{
e.Handled = true;
if (this.PasswordChar == false)
this.SetTextBoxPasswordChar(this.PasswordChar);
if (this.IsNew == true)
this.SetEnableID(true);
this.textBoxPassword.Text = this.SelectedUserItem.Password;
this.KeyboardClose();
}
else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?'
|| e.KeyChar == '*' || e.KeyChar == ':' || e.KeyChar == '/' || e.KeyChar == '\\')
{
e.Handled = true;
}
}
private void smartKeyboard_OnXKeyClick(object sender, EventArgs e)
{
if (this.smartKeyboard.TargetInputObject == this.textBoxPassword)
{
this.textBoxPassword.Text = this.SelectedUserItem.Password;
if (this.PasswordChar == false)
this.SetTextBoxPasswordChar(this.PasswordChar);
}
else if (this.smartKeyboard.TargetInputObject == this.textBoxLevel1
|| this.smartKeyboard.TargetInputObject == this.textBoxLevel2
|| this.smartKeyboard.TargetInputObject == this.textBoxLevel3)
{
2023-05-24 04:16:07 +00:00
if (this.buttonLevel1.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
{
2023-05-24 04:16:07 +00:00
this.textBoxLevel1.Visible = false;
}
else if (this.buttonLevel2.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
{
this.textBoxLevel2.Visible = false;
}
else if (this.buttonLevel3.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
{
this.textBoxLevel3.Visible = false;
}
2023-05-24 04:16:07 +00:00
this.UpdateLevelNameDisplay(this.ParentForm.ParentForm.SystemConfig2);
this.buttonChangeLevelName.Visible = true;
}
this.KeyboardClose();
if (this.IsNew == true)
this.SetEnableID(true);
}
private void textBoxLevel1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
{
e.Handled = true;
this.KeyboardClose();
this.textBoxLevel1.Visible = false;
if (this.textBoxLevel1.Text == ""
|| this.textBoxLevel1.Text == this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel2Name
|| this.textBoxLevel1.Text == this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel3Name)
{
this.UpdateLevelNameDisplay(this.ParentForm.ParentForm.SystemConfig2);
this.buttonChangeLevelName.Visible = true;
}
2023-05-24 04:16:07 +00:00
else
{
2023-05-24 04:16:07 +00:00
this.buttonLevel1.Text = this.textBoxLevel1.Text;
this.labelAccessRight.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel1Name = this.buttonLevel1.Text;
this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2);
2023-05-24 04:16:07 +00:00
this.ParentForm.ParentForm.ChildFormMainDisplay.UpdateDisplayUser(this.ParentForm.ParentForm.CurrentSystemStatus);
this.ParentForm.ParentForm.ChildFormMenu.UpdateDisplayUser(this.ParentForm.ParentForm.CurrentSystemStatus);
}
}
else if (e.KeyChar == 27)
{
e.Handled = true;
2023-05-24 04:16:07 +00:00
this.textBoxLevel1.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel1Name;
this.KeyboardClose();
}
else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?'
|| e.KeyChar == '*' || e.KeyChar == ':' || e.KeyChar == '/' || e.KeyChar == '\\')
{
e.Handled = true;
}
}
private void textBoxLevel2_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
{
e.Handled = true;
this.KeyboardClose();
this.textBoxLevel2.Visible = false;
if (this.textBoxLevel2.Text == ""
|| this.textBoxLevel2.Text == this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel1Name
|| this.textBoxLevel2.Text == this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel3Name)
{
this.UpdateLevelNameDisplay(this.ParentForm.ParentForm.SystemConfig2);
this.buttonChangeLevelName.Visible = true;
}
else
2023-05-24 04:16:07 +00:00
{
this.buttonLevel2.Text = this.textBoxLevel2.Text;
this.labelAccessRight.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel2Name = this.buttonLevel2.Text;
this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2);
this.ParentForm.ParentForm.ChildFormMainDisplay.UpdateDisplayUser(this.ParentForm.ParentForm.CurrentSystemStatus);
this.ParentForm.ParentForm.ChildFormMenu.UpdateDisplayUser(this.ParentForm.ParentForm.CurrentSystemStatus);
}
2023-05-24 04:16:07 +00:00
}
else if (e.KeyChar == 27)
{
e.Handled = true;
this.textBoxLevel2.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel2Name;
this.KeyboardClose();
}
else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?'
|| e.KeyChar == '*' || e.KeyChar == ':' || e.KeyChar == '/' || e.KeyChar == '\\')
{
e.Handled = true;
}
}
private void textBoxLevel3_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
{
e.Handled = true;
this.KeyboardClose();
2023-05-24 04:16:07 +00:00
this.textBoxLevel3.Visible = false;
if (this.textBoxLevel3.Text == ""
|| this.textBoxLevel3.Text == this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel1Name
|| this.textBoxLevel3.Text == this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel2Name)
{
2023-05-24 04:16:07 +00:00
this.UpdateLevelNameDisplay(this.ParentForm.ParentForm.SystemConfig2);
this.buttonChangeLevelName.Visible = true;
}
else
{
this.buttonLevel3.Text = this.textBoxLevel3.Text;
this.labelAccessRight.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel3Name = this.buttonLevel3.Text;
this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2);
this.ParentForm.ParentForm.ChildFormMainDisplay.UpdateDisplayUser(this.ParentForm.ParentForm.CurrentSystemStatus);
this.ParentForm.ParentForm.ChildFormMenu.UpdateDisplayUser(this.ParentForm.ParentForm.CurrentSystemStatus);
}
}
else if (e.KeyChar == 27)
{
e.Handled = true;
this.textBoxLevel3.Text = this.ParentForm.ParentForm.SystemConfig2.UserGroupLevel3Name;
this.KeyboardClose();
}
else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?'
|| e.KeyChar == '*' || e.KeyChar == ':' || e.KeyChar == '/' || e.KeyChar == '\\')
{
e.Handled = true;
}
}
private void buttonPassword_Click(object sender, EventArgs e)
{
this.SetTextBoxPasswordChar(true);
this.textBoxPassword.Text = "user1004!";
2023-05-24 04:16:07 +00:00
if (this.buttonSave.Visible == false)
this.buttonSave.Visible = true;
}
private void buttonNew_Click(object sender, EventArgs e)
{
this.UserNew();
}
private void buttonSave_Click(object sender, EventArgs e)
{
this.SaveUserDll();
}
private void buttonDelete_Click(object sender, EventArgs e)
{
if (this.listBoxUserList.SelectItemIndex == -1)
return;
// 사용자를 삭제 하시겠습니까?
DialogFormYesNo dlg = new DialogFormYesNo(this.ParentForm.ParentForm.SystemConfig1.Language, 14);
if (dlg.ShowDialog() == DialogResult.Yes)
{
if (this.listBoxUserList.Items.Count <= 1)
return;
2023-05-24 04:16:07 +00:00
if (this.listBoxUserList.SelectItemIndex <= 0)
return;
string id = this.listBoxUserList.Items[this.listBoxUserList.SelectItemIndex];
UserManager.UserManager_UserDel(id);
this.buttonDelete.Visible = false;
}
}
private void buttonIDEdit_Click(object sender, EventArgs e)
{
this.smartKeyboard.KeyboardType = SmartX.SmartKeyboard.KEYBOARDTYPES.NORMAL;
this.smartKeyboard.Location = new Point(3, 43);
this.smartKeyboard.Size = new Size(704, 276);
this.smartKeyboard.Hide();
this.smartKeyboard.TargetInputObject = this.textBoxID;
this.smartKeyboard.Show();
this.textBoxID.Select(this.textBoxID.Text.Length, 0);
this.listBoxUserList.Enabled = false;
this.SetEnableControl(false);
this.SetEnablePassword(false);
}
private void buttonPasswordEdit_Click(object sender, EventArgs e)
{
this.smartKeyboard.KeyboardType = SmartX.SmartKeyboard.KEYBOARDTYPES.NORMAL;
this.smartKeyboard.Location = new Point(3, 74);
this.smartKeyboard.Size = new Size(704, 276);
this.smartKeyboard.Hide();
this.smartKeyboard.TargetInputObject = this.textBoxPassword;
this.smartKeyboard.Show();
this.SetTextBoxPasswordChar(true);
this.textBoxPassword.Select(this.textBoxPassword.Text.Length, 0);
this.SetEnableControl(false);
this.SetEnableID(false);
}
private void labelExpiryDateOfAccount_Click(object sender, EventArgs e)
{
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelExpiryDateOfAccount.Text, 3, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.IntValue <= 0)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
2023-05-24 04:16:07 +00:00
else if (myKeyPad.IntValue > 180)
{
this.labelExpiryDateOfAccount.Text = "180";
2023-05-24 04:16:07 +00:00
if (this.buttonSave.Visible == false)
this.buttonSave.Visible = true;
}
else
{
2023-05-24 04:16:07 +00:00
this.labelExpiryDateOfAccount.Text = myKeyPad.StringValue;
if (this.buttonSave.Visible == false)
this.buttonSave.Visible = true;
}
}
}
private void labelExpiryDateOfPassword_Click(object sender, EventArgs e)
{
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelExpiryDateOfPassword.Text, 3, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
2023-05-24 04:16:07 +00:00
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.IntValue <= 0)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
2023-05-24 04:16:07 +00:00
else if (myKeyPad.IntValue > 90)
{
2023-05-24 04:16:07 +00:00
this.labelExpiryDateOfPassword.Text = "90";
2023-05-24 04:16:07 +00:00
if (this.buttonSave.Visible == false)
this.buttonSave.Visible = true;
}
else
{
2023-05-24 04:16:07 +00:00
this.labelExpiryDateOfPassword.Text = myKeyPad.StringValue;
2023-05-24 04:16:07 +00:00
if (this.buttonSave.Visible == false)
this.buttonSave.Visible = true;
}
}
}
2023-05-24 04:16:07 +00:00
private void labelAutomaticLogoutTime_Click(object sender, EventArgs e)
{
2023-05-24 04:16:07 +00:00
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelAutomaticLogoutTime.Text, 2, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.IntValue < 0)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
else if (myKeyPad.IntValue > 90)
{
this.labelAutomaticLogoutTime.Text = "90";
}
else
{
this.labelAutomaticLogoutTime.Text = myKeyPad.StringValue;
}
this.ParentForm.ParentForm.SystemConfig2.UserAutomaticLogout = myKeyPad.IntValue;
if (this.ParentForm.ParentForm.SystemConfig2.UserAutomaticLogout == 1)
this.ParentForm.ParentForm.FlagAutomaticLogoutWarningTime = 30;
else
this.ParentForm.ParentForm.FlagAutomaticLogoutWarningTime = 60;
this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2);
UserManager.UserManager_AutoLogoutSetTimeout(this.ParentForm.ParentForm.SystemConfig2.UserAutomaticLogout, this.ParentForm.ParentForm.FlagAutomaticLogoutWarningTime);
}
}
private void labelExpiryDateOfAccount2_Click(object sender, EventArgs e)
{
string code = "", message1 = "", message2 = "";
string detail = "";
2023-05-24 04:16:07 +00:00
if (this.labelExpiryDateOfAccount2.ForeColor == Color.White)
{
2023-05-24 04:16:07 +00:00
if (this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel < (int)Define.E_UserGroup.Level3)
return;
2023-05-24 04:16:07 +00:00
UserManager.UserManager_UserLockRelease(this.SelectedUserItem.ID, true, false);
// Part 11
detail = string.Format("Extension of ID expiry date : {0}", this.SelectedUserItem.ID);
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail);
}
else
{
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
case Define.E_LanguageID.Korean:
code = "유저설정";
message1 = "사용자 잠금 해제 하시겠습니까?";
message2 = "";
break;
case Define.E_LanguageID.English:
code = "User settings";
message1 = "Do you want to unlock user?";
message2 = "";
break;
case Define.E_LanguageID.Chinese:
code = "用户设置";
message1 = "你想解锁用户吗?";
message2 = "";
break;
case Define.E_LanguageID.Russian:
code = "Пользовательские настройки";
message1 = "Вы хотите разблокировать пользователя?";
message2 = "";
break;
case Define.E_LanguageID.German:
code = "Benutzereinstellungen";
message1 = "Möchten Sie Benutzer entsperren?";
message2 = "";
break;
case Define.E_LanguageID.Spanish:
code = "Ajustes de usuario";
message1 = "¿Quieres desbloquear usuario?";
message2 = "";
break;
default:
break;
}
2023-05-24 04:16:07 +00:00
DialogFormYesNo dlg = new DialogFormYesNo(Define.E_MessageBoxIcon.Question, code, message1, message2);
if (dlg.ShowDialog() == DialogResult.Yes)
{
2023-05-24 04:16:07 +00:00
UserManager.UserManager_UserLockRelease(this.SelectedUserItem.ID, true, false);
2023-05-24 04:16:07 +00:00
// Part 11
detail = string.Format("ID Release : {0}", this.SelectedUserItem.ID);
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail);
}
2023-05-24 04:16:07 +00:00
}
}
private void labelExpiryDateOfPassword2_Click(object sender, EventArgs e)
{
string code = "", message1 = "", message2 = "";
string detail = "";
if (this.labelExpiryDateOfPassword2.ForeColor == Color.White)
{
if (this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel < (int)Define.E_UserGroup.Level3)
return;
UserManager.UserManager_UserLockRelease(this.SelectedUserItem.ID, false, true);
// Part 11
detail = string.Format("Extension of PW expiry date : {0}", this.SelectedUserItem.ID);
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail);
}
else
{
switch (this.ParentForm.ParentForm.SystemConfig1.Language)
{
2023-05-24 04:16:07 +00:00
case Define.E_LanguageID.Korean:
code = "유저설정";
message1 = "비밀번호 잠금 해제 하시겠습니까?";
message2 = "";
break;
case Define.E_LanguageID.English:
code = "User settings";
message1 = "Do you want to unlock password?";
message2 = "";
break;
case Define.E_LanguageID.Chinese:
code = "用户设置";
message1 = "你想解锁密码吗?";
message2 = "";
break;
case Define.E_LanguageID.Russian:
code = "Пользовательские настройки";
message1 = "Хотите разблокировать пароль?";
message2 = "";
break;
case Define.E_LanguageID.German:
code = "Benutzereinstellungen";
message1 = "Möchten Sie das Passwort entsperren?";
message2 = "";
break;
case Define.E_LanguageID.Spanish:
code = "Ajustes de usuario";
message1 = "¿Quieres desbloquear la contraseña?";
message2 = "";
break;
default:
break;
}
DialogFormYesNo dlg = new DialogFormYesNo(Define.E_MessageBoxIcon.Question, code, message1, message2);
if (dlg.ShowDialog() == DialogResult.Yes)
{
UserManager.UserManager_UserLockRelease(this.SelectedUserItem.ID, false, true);
// Part 11
detail = string.Format("PW Release : {0}", this.SelectedUserItem.ID);
this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail);
}
}
}
private void buttonGroupEditor_Click(object sender, EventArgs e)
{
2023-05-24 04:16:07 +00:00
this.ParentForm.CenterEquipUserGroupEditor.Visible = true;
this.ParentForm.CenterEquipUserGroupEditor.BringToFront();
this.ParentForm.CenterEquipUserGroupEditor.DisplayRefresh(this.ParentForm.ParentForm.CurrentSystemStatus);
}
private void buttonLevel_Click(object sender, EventArgs e)
{
SmartX.SmartButton button = sender as SmartX.SmartButton;
if (button == this.buttonLevel1)
{
this.CheckBoxCheckedAsLevel(Define.E_UserGroup.Level1);
}
else if (button == this.buttonLevel2)
{
this.CheckBoxCheckedAsLevel(Define.E_UserGroup.Level2);
}
else if (button == this.buttonLevel3)
{
this.CheckBoxCheckedAsLevel(Define.E_UserGroup.Level3);
}
this.buttonChangeLevelName.Visible = true;
if (this.buttonSave.Visible == false)
this.buttonSave.Visible = true;
}
private void buttonChangeLevelName_Click(object sender, EventArgs e)
{
this.SetEnableID(false);
this.SetEnablePassword(false);
this.SetEnableControl(false);
if(this.buttonSave.Visible == true)
this.buttonSave.Visible = false;
this.smartKeyboard.KeyboardType = SmartX.SmartKeyboard.KEYBOARDTYPES.NORMAL;
this.smartKeyboard.Location = new Point(3, 137);
this.smartKeyboard.Size = new Size(704, 276);
this.smartKeyboard.Hide();
if (this.buttonLevel1.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
{
this.textBoxLevel1.Visible = true;
this.textBoxLevel1.BringToFront();
this.smartKeyboard.TargetInputObject = this.textBoxLevel1;
this.textBoxLevel1.Select(this.textBoxLevel1.Text.Length, 0);
}
else if (this.buttonLevel2.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
{
this.textBoxLevel2.Visible = true;
this.textBoxLevel2.BringToFront();
this.smartKeyboard.TargetInputObject = this.textBoxLevel2;
this.textBoxLevel2.Select(this.textBoxLevel2.Text.Length, 0);
}
else if (this.buttonLevel3.ButtonStatus == SmartX.SmartButton.BUTSTATUS.DOWN)
{
this.textBoxLevel3.Visible = true;
this.textBoxLevel3.BringToFront();
this.smartKeyboard.TargetInputObject = this.textBoxLevel3;
this.textBoxLevel3.Select(this.textBoxLevel3.Text.Length, 0);
}
this.smartKeyboard.Show();
this.buttonChangeLevelName.Visible = false;
}
#endregion
}
}