feat: Initial commit for LFP_Manager_DBG (V1.1.0.22)
This commit is contained in:
98
LFP_Manager/Forms/FmxPassword.cs
Normal file
98
LFP_Manager/Forms/FmxPassword.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using DevExpress.Pdf.Native;
|
||||
using DevExpress.XtraEditors;
|
||||
using LFP_Manager.DataStructure;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace LFP_Manager.Forms
|
||||
{
|
||||
public partial class FmxPassword : DevExpress.XtraEditors.XtraForm
|
||||
{
|
||||
#region DELEGATE
|
||||
public delegate void PasswordResut(int result);
|
||||
#endregion
|
||||
|
||||
#region VARIABLES
|
||||
private CommConfig Config;
|
||||
private int result = -1;
|
||||
private int mode = 0;
|
||||
|
||||
public event PasswordResut OnResult = null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region CONSTRUCTORS
|
||||
public FmxPassword(CommConfig aConfig, int aMode)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Config = aConfig;
|
||||
mode = aMode;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region FORM EVENT
|
||||
private void FmxPassword_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
OnResult?.Invoke(result);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BUTTON EVENT
|
||||
private void BtnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void BtnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (mode == 0)
|
||||
{
|
||||
if (Config.DisablePassword == TePassword.Text)
|
||||
{
|
||||
result = 1;
|
||||
MessageBox.Show("Anti-Theft Protect Clear Success", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Wrong Password - Try again", "Result", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
else if (mode == 1)
|
||||
{
|
||||
if (Config.EnablePassword == TePassword.Text)
|
||||
{
|
||||
result = 1;
|
||||
MessageBox.Show("Enable Success", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Wrong Password - Try again", "Result", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
else if (mode == 2)
|
||||
{
|
||||
if (Config.DisablePassword == TePassword.Text)
|
||||
{
|
||||
result = 1;
|
||||
MessageBox.Show("Disable Success", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Wrong Password - Try again", "Result", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user