2020-08-31 02:13:02 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
2023-05-24 04:16:07 +00:00
|
|
|
|
using System.Text.RegularExpressions;
|
2020-08-31 02:13:02 +00:00
|
|
|
|
|
2020-08-31 06:52:43 +00:00
|
|
|
|
using ITC81DB_0H.Forms;
|
2022-07-22 00:43:48 +00:00
|
|
|
|
using ITC81DB_2H_ImageDll;
|
2023-05-24 04:16:07 +00:00
|
|
|
|
using ITC81DB_2H.Datastore;
|
|
|
|
|
using ITC81DB_0H.Part11_UserManager;
|
2020-08-31 02:13:02 +00:00
|
|
|
|
|
2020-08-31 06:52:43 +00:00
|
|
|
|
namespace ITC81DB_0H.DialogForms
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
|
|
|
|
public partial class DialogFormLogOn : Form
|
|
|
|
|
{
|
|
|
|
|
#region Field
|
|
|
|
|
private FormMain m_ParentForm;
|
2023-09-15 08:04:07 +00:00
|
|
|
|
private bool IsLoginMode;
|
|
|
|
|
private bool IsChangePassword;
|
2020-08-31 02:13:02 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Constructor
|
2023-09-15 08:04:07 +00:00
|
|
|
|
public DialogFormLogOn(FormMain parent, bool login, bool changePass)
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
this.ParentForm = parent;
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.IsLoginMode = login;
|
|
|
|
|
this.IsChangePassword = changePass;
|
2020-08-31 02:13:02 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.IsChangePassword == false)
|
|
|
|
|
{
|
|
|
|
|
this.InitializeDesignForLogin();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.textBoxID.PasswordChar = default(char);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.InitializeDesignForChangePassword();
|
|
|
|
|
|
|
|
|
|
this.textBoxID.PasswordChar = '*';
|
|
|
|
|
}
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.InitializeControl();
|
|
|
|
|
this.DefaultSetting();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
2020-08-31 02:13:02 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Property
|
|
|
|
|
public FormMain ParentForm
|
|
|
|
|
{
|
|
|
|
|
get { return this.m_ParentForm; }
|
|
|
|
|
set { this.m_ParentForm = value; }
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
2020-08-31 02:13:02 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Method
|
2023-10-31 05:46:27 +00:00
|
|
|
|
private string ReturnUserStatus(int num)
|
|
|
|
|
{
|
|
|
|
|
string ret = "";
|
|
|
|
|
|
|
|
|
|
switch (num)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
ret = "ID_Not found";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
ret = "ID_Duplication";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
ret = "ID_Too short";
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
ret = "ID_Too long";
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
ret = "ID_Consecutive or duplicate char";
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
ret = "ID_Invalid char";
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
ret = "ID_Lock";
|
|
|
|
|
break;
|
|
|
|
|
case 8:
|
|
|
|
|
ret = "PW_Duplicate prev PW";
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
ret = "PW_Too short";
|
|
|
|
|
break;
|
|
|
|
|
case 10:
|
|
|
|
|
ret = "PW_Too long";
|
|
|
|
|
break;
|
|
|
|
|
case 11:
|
|
|
|
|
ret = "PW_Consecutive or duplicate char";
|
|
|
|
|
break;
|
|
|
|
|
case 12:
|
|
|
|
|
ret = "PW_Invalid char";
|
|
|
|
|
break;
|
|
|
|
|
case 13:
|
|
|
|
|
ret = "PW_Not include char";
|
|
|
|
|
break;
|
|
|
|
|
case 14:
|
|
|
|
|
ret = "PW_Incorrect";
|
|
|
|
|
break;
|
|
|
|
|
case 15:
|
|
|
|
|
ret = "PW_Lock";
|
|
|
|
|
break;
|
|
|
|
|
case 16:
|
|
|
|
|
ret = "PW_Over expire period";
|
|
|
|
|
break;
|
|
|
|
|
case 17:
|
|
|
|
|
ret = "ID_Over expire period";
|
|
|
|
|
break;
|
|
|
|
|
case 18:
|
|
|
|
|
ret = "Auto logout";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ret = "";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
private void InitializeDesignForLogin()
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
|
|
|
|
Class1 images = new Class1();
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.English)
|
|
|
|
|
{
|
|
|
|
|
this.labelTitle1.Text = "User Login";
|
|
|
|
|
this.labelTitle2.Text = "ID";
|
|
|
|
|
this.labelTitle3.Text = "Password";
|
|
|
|
|
|
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginUp));
|
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp));
|
|
|
|
|
}
|
|
|
|
|
else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese)
|
|
|
|
|
{
|
|
|
|
|
this.labelTitle1.Text = "用户登录";
|
|
|
|
|
this.labelTitle2.Text = "ID";
|
|
|
|
|
this.labelTitle3.Text = "密码";
|
|
|
|
|
|
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginLoginDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginLoginDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginLoginUp));
|
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelUp));
|
|
|
|
|
}
|
|
|
|
|
else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German)
|
|
|
|
|
{
|
|
|
|
|
this.labelTitle1.Text = "Einloggen";
|
|
|
|
|
this.labelTitle2.Text = "ID";
|
|
|
|
|
this.labelTitle3.Text = "Passwort";
|
|
|
|
|
|
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginUp));
|
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp));
|
|
|
|
|
}
|
|
|
|
|
else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Spanish)
|
|
|
|
|
{
|
|
|
|
|
this.labelTitle1.Text = "Acceso";
|
|
|
|
|
this.labelTitle2.Text = "ID";
|
|
|
|
|
this.labelTitle3.Text = "Clave";
|
|
|
|
|
|
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginUp));
|
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.labelTitle1.Text = "로그인";
|
|
|
|
|
this.labelTitle2.Text = "ID";
|
|
|
|
|
this.labelTitle3.Text = "비밀번호";
|
|
|
|
|
|
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginUp));
|
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelUp));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void InitializeDesignForChangePassword()
|
|
|
|
|
{
|
|
|
|
|
Class1 images = new Class1();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.English)
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.labelTitle1.Text = "Change Password";
|
|
|
|
|
this.labelTitle2.Text = "New";
|
|
|
|
|
this.labelTitle3.Text = "Verify";
|
2020-08-31 02:13:02 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeUp));
|
2020-08-31 02:13:02 +00:00
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp));
|
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese)
|
|
|
|
|
{
|
|
|
|
|
this.labelTitle1.Text = "更改密码";
|
|
|
|
|
this.labelTitle2.Text = "新密码";
|
|
|
|
|
this.labelTitle3.Text = "验证密码";
|
|
|
|
|
|
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginChangeDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginChangeDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginChangeUp));
|
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelUp));
|
|
|
|
|
}
|
|
|
|
|
else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German)
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.labelTitle1.Text = "Kennwort ändern";
|
|
|
|
|
this.labelTitle2.Text = "Neu";
|
|
|
|
|
this.labelTitle3.Text = "Verifizieren";
|
|
|
|
|
|
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeUp));
|
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp));
|
2020-08-31 02:13:02 +00:00
|
|
|
|
}
|
2023-05-24 04:16:07 +00:00
|
|
|
|
else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Spanish)
|
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.labelTitle1.Text = "Cambiar la contraseña";
|
|
|
|
|
this.labelTitle2.Text = "Nuevo";
|
|
|
|
|
this.labelTitle3.Text = "Verificar";
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeUp));
|
2023-05-24 04:16:07 +00:00
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp));
|
|
|
|
|
}
|
2020-08-31 02:13:02 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.labelTitle1.Text = "비밀번호 변경";
|
|
|
|
|
this.labelTitle2.Text = "새 비밀번호";
|
|
|
|
|
this.labelTitle3.Text = "비밀번호 확인";
|
2020-08-31 02:13:02 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeDisable));
|
|
|
|
|
this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeDown));
|
|
|
|
|
this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeUp));
|
2020-08-31 02:13:02 +00:00
|
|
|
|
this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelDisable));
|
|
|
|
|
this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelDown));
|
|
|
|
|
this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelUp));
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
private void InitializeControl()
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
int x = 0, y = 0;
|
|
|
|
|
|
|
|
|
|
x = Screen.PrimaryScreen.Bounds.Width / 2 - this.Size.Width / 2;
|
|
|
|
|
y = Screen.PrimaryScreen.Bounds.Height / 2 - this.Size.Height / 2;
|
|
|
|
|
|
|
|
|
|
this.Location = new Point(x, y);
|
|
|
|
|
this.Size = new Size(710, 470);
|
|
|
|
|
|
2020-08-31 02:13:02 +00:00
|
|
|
|
this.textBoxID.Text = "";
|
|
|
|
|
this.textBoxPassword.Text = "";
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
//this.smartKeyboard.HanYoungKeyToggle();
|
|
|
|
|
this.smartKeyboard.HanYoungKeyDisable = true;
|
2020-08-31 02:13:02 +00:00
|
|
|
|
this.smartKeyboard.KeyboardType = SmartX.SmartKeyboard.KEYBOARDTYPES.NORMAL;
|
|
|
|
|
this.smartKeyboard.Show();
|
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
private void DefaultSetting()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LogOn()
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
UserManager.UserMgr_user_info_t userInfo = new UserManager.UserMgr_user_info_t();
|
|
|
|
|
|
|
|
|
|
if (this.textBoxID.Text == "")
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Fail : ID blank");
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// ID : 6~20자 입력 하세요
|
|
|
|
|
DialogFormMessage myMsg = new DialogFormMessage(null, 3, this.ParentForm.SystemConfig1.Language);
|
|
|
|
|
myMsg.ShowDialog();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.textBoxPassword.Text == "")
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Fail : PW blank");
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// PASSWORD : 6~20자 입력 하세요
|
|
|
|
|
DialogFormMessage myMsg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig1.Language);
|
|
|
|
|
myMsg.ShowDialog();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-10-31 05:46:27 +00:00
|
|
|
|
|
|
|
|
|
if (this.textBoxID.Text == "admin00" && this.textBoxPassword.Text == "admin20090810")
|
|
|
|
|
{
|
|
|
|
|
DialogFormYesNo dlg = new DialogFormYesNo(this.ParentForm.SystemConfig1.Language, 29);
|
|
|
|
|
if (dlg.ShowDialog() == DialogResult.Yes)
|
|
|
|
|
{
|
|
|
|
|
this.ParentForm.ChildFormMainDisplay.ChangeID = this.textBoxID.Text;
|
|
|
|
|
this.DialogResult = DialogResult.Abort;
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
UserManager.UserManager_UserLoginDirect(this.textBoxID.Text, this.textBoxPassword.Text, ref userInfo);
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (userInfo.status == 0 && userInfo.fFirstPW == 0)
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
//MessageBox.Show("로그인 성공");
|
2023-07-24 04:23:49 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
#region 로그인 성공
|
|
|
|
|
if (userInfo.active_level == 1)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level1;
|
|
|
|
|
else if (userInfo.active_level == 2)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level2;
|
|
|
|
|
else if (userInfo.active_level == 3)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level3;
|
|
|
|
|
else if (userInfo.active_level == 9)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Admin;
|
|
|
|
|
else if (userInfo.active_level == 10)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Developer;
|
|
|
|
|
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.ID = userInfo.user_id;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Password = userInfo.user_pw;
|
|
|
|
|
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.ExpireId = userInfo.id_expire_period;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword = userInfo.password_expire_period;
|
|
|
|
|
|
|
|
|
|
DateTime time = DateTime.ParseExact(userInfo.password_register_date.GetDateTime(), "yyyyMMddHHmmss", null);
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordRegister = time;
|
|
|
|
|
time = DateTime.ParseExact(userInfo.id_login_date.GetDateTime(), "yyyyMMddHHmmss", null);
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdLogin = time;
|
|
|
|
|
time = DateTime.ParseExact(userInfo.id_expire_date.GetDateTime(), "yyyyMMddHHmmss", null);
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdExpire = time;
|
|
|
|
|
time = DateTime.ParseExact(userInfo.password_expire_date.GetDateTime(), "yyyyMMddHHmmss", null);
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire = time;
|
|
|
|
|
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockAccount = userInfo.id_flock_status == 0 ? false : true;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockPassword = userInfo.password_flock_status == 0 ? false : true;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel = userInfo.active_level;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.IsFirstPassword = userInfo.fFirstPW;
|
|
|
|
|
#endregion
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Success");
|
|
|
|
|
|
2023-05-24 04:16:07 +00:00
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
this.Close();
|
2023-09-15 08:04:07 +00:00
|
|
|
|
}
|
|
|
|
|
else if (userInfo.fFirstPW == 1)
|
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "First login");
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// 최초 로그인 시 비밀번호 변경
|
|
|
|
|
this.ParentForm.ChildFormMainDisplay.ChangeID = this.textBoxID.Text;
|
|
|
|
|
this.DialogResult = DialogResult.Abort;
|
|
|
|
|
this.Close();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
DialogFormMessage myMsg = new DialogFormMessage(null, userInfo.status, this.ParentForm.SystemConfig1.Language);
|
|
|
|
|
myMsg.ShowDialog();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// 비밀번호 만료 시
|
|
|
|
|
if (userInfo.status == 15)
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Password expiration");
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.ParentForm.ChildFormMainDisplay.ChangeID = this.textBoxID.Text;
|
|
|
|
|
this.DialogResult = DialogResult.Abort;
|
|
|
|
|
this.Close();
|
2020-08-31 02:13:02 +00:00
|
|
|
|
}
|
2023-10-31 05:46:27 +00:00
|
|
|
|
else
|
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Fail : " + this.ReturnUserStatus(userInfo.status));
|
2020-08-31 02:13:02 +00:00
|
|
|
|
}
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
private void ChangePassword()
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
int ret = 0;
|
|
|
|
|
string id = "", pass = "";
|
|
|
|
|
UserManager.UserMgr_user_info_t userInfo = new UserManager.UserMgr_user_info_t();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.textBoxID.Text == "")
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Fail : TextBox1 blank");
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// New Password : 6~20자 입력 하세요
|
|
|
|
|
DialogFormMessage myMsg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig1.Language);
|
|
|
|
|
myMsg.ShowDialog();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
return;
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.textBoxPassword.Text == "")
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Fail : TextBox2 blank");
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// New Password Confirmation : 6~20자 입력 하세요
|
|
|
|
|
DialogFormMessage myMsg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig1.Language);
|
|
|
|
|
myMsg.ShowDialog();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
return;
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.textBoxID.Text.Equals(this.textBoxPassword.Text) == false)
|
2020-08-31 02:13:02 +00:00
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Fail : Diffrent char");
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// 비밀번호를 확인하세요
|
|
|
|
|
DialogFormMessage myMsg = new DialogFormMessage(null, 14, this.ParentForm.SystemConfig1.Language);
|
|
|
|
|
myMsg.ShowDialog();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
return;
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.IsLoginMode == true)
|
|
|
|
|
{
|
|
|
|
|
id = this.ParentForm.CurrentSystemStatus.CurrentUser.ID;
|
|
|
|
|
pass = this.textBoxID.Text;
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
//Console.WriteLine(string.Format("UserManager_UserModifyPW : {0}, {1}", id, pass));
|
|
|
|
|
ret = UserManager.UserManager_UserModifyPWDirect(id, pass);
|
|
|
|
|
}
|
|
|
|
|
else
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
id = this.ParentForm.ChildFormMainDisplay.ChangeID;
|
|
|
|
|
pass = this.textBoxID.Text;
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
//Console.WriteLine(string.Format("UserManager_UserModifyPW : {0}, {1}", id, pass));
|
|
|
|
|
ret = UserManager.UserManager_UserModifyPWDirect(id, pass);
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// 비밀번호 변경이 완료 되면 로그인 시도
|
|
|
|
|
if (ret == 0)
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
UserManager.UserManager_UserLoginDirect(id, pass, ref userInfo);
|
|
|
|
|
|
|
|
|
|
if (userInfo.status == 0)
|
2023-07-24 04:23:49 +00:00
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
//MessageBox.Show("로그인 성공");
|
|
|
|
|
|
|
|
|
|
#region 로그인 성공
|
|
|
|
|
if (userInfo.active_level == 1)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level1;
|
|
|
|
|
else if (userInfo.active_level == 2)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level2;
|
|
|
|
|
else if (userInfo.active_level == 3)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level3;
|
|
|
|
|
else if (userInfo.active_level == 9)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Admin;
|
|
|
|
|
else if (userInfo.active_level == 10)
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Developer;
|
|
|
|
|
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.ID = userInfo.user_id;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.Password = userInfo.user_pw;
|
|
|
|
|
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.ExpireId = userInfo.id_expire_period;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword = userInfo.password_expire_period;
|
|
|
|
|
|
|
|
|
|
DateTime time = DateTime.ParseExact(userInfo.password_register_date.GetDateTime(), "yyyyMMddHHmmss", null);
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordRegister = time;
|
|
|
|
|
time = DateTime.ParseExact(userInfo.id_login_date.GetDateTime(), "yyyyMMddHHmmss", null);
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdLogin = time;
|
|
|
|
|
time = DateTime.ParseExact(userInfo.id_expire_date.GetDateTime(), "yyyyMMddHHmmss", null);
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdExpire = time;
|
|
|
|
|
time = DateTime.ParseExact(userInfo.password_expire_date.GetDateTime(), "yyyyMMddHHmmss", null);
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire = time;
|
|
|
|
|
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockAccount = userInfo.id_flock_status == 0 ? false : true;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockPassword = userInfo.password_flock_status == 0 ? false : true;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel = userInfo.active_level;
|
|
|
|
|
this.ParentForm.CurrentSystemStatus.CurrentUser.IsFirstPassword = userInfo.fFirstPW;
|
|
|
|
|
#endregion
|
2023-07-24 04:23:49 +00:00
|
|
|
|
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Success");
|
|
|
|
|
|
2023-07-24 04:23:49 +00:00
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Fail : " + this.ReturnUserStatus(ret));
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
DialogFormMessage myMsg = new DialogFormMessage(null, ret, this.ParentForm.SystemConfig1.Language);
|
|
|
|
|
myMsg.ShowDialog();
|
|
|
|
|
}
|
2020-08-31 02:13:02 +00:00
|
|
|
|
}
|
2023-09-15 08:04:07 +00:00
|
|
|
|
else
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
2023-10-31 05:46:27 +00:00
|
|
|
|
this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, "Failure change password");
|
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
// 비밀번호 변경 실패 시 메시지??
|
|
|
|
|
DialogFormMessage myMsg = new DialogFormMessage(null, ret, this.ParentForm.SystemConfig1.Language);
|
|
|
|
|
myMsg.ShowDialog();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Event Handler
|
2023-09-15 08:04:07 +00:00
|
|
|
|
private void buttonLogOn_Click(object sender, EventArgs e)
|
2023-05-24 04:16:07 +00:00
|
|
|
|
{
|
|
|
|
|
// Automatic Logout Reset
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
|
2023-09-15 08:04:07 +00:00
|
|
|
|
if (this.IsChangePassword == false)
|
|
|
|
|
this.LogOn();
|
2023-05-24 04:16:07 +00:00
|
|
|
|
else
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.ChangePassword();
|
2020-08-31 02:13:02 +00:00
|
|
|
|
}
|
|
|
|
|
private void buttonCancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.DialogResult = DialogResult.Cancel;
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void smartKeyboard_OnXKeyClick(object sender, EventArgs e)
|
|
|
|
|
{
|
2023-09-15 08:04:07 +00:00
|
|
|
|
this.smartKeyboard.Show();
|
2020-09-14 08:43:49 +00:00
|
|
|
|
}
|
2023-07-24 04:23:49 +00:00
|
|
|
|
#endregion
|
2020-08-31 02:13:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|