UC_SetUserPassword.cs
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
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 TheMachine
{
using crc = OnlineStore.CodeResourceControl;
public partial class UC_SetUserPassword : UserControl
{
public UC_SetUserPassword()
{
InitializeComponent();
crc.GetLanguageEvent += Crc_GetLanguageEvent;
OnlineStore.CodeResourceControl.LanguageProcess(this);
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
}
private string Crc_GetLanguageEvent()
{
return Setting_Init.App_Default_Language;
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
if (!this.Created)
return;
OnlineStore.CodeResourceControl.LanguageProcess(this);
this.Invoke((EventHandler)delegate
{
});
}
private void button_ok_Click(object sender, EventArgs e)
{
if (textBox_oldpwd.Text != Setting_Init.User_AdminPassword)
{
MessageBox.Show(crc.GetString("Res0068","旧密码不正确!"));
textBox_oldpwd.Text = "";
return;
}
if (textBox_newpwd.Text != textBox_newpwd2.Text) {
MessageBox.Show(crc.GetString("Res0069","两次输入的新密码不一致,请确认!"));
//textBox_oldpwd.Text = "";
return;
}
if (string.IsNullOrWhiteSpace(textBox_newpwd.Text))
{
MessageBox.Show(crc.GetString("Res0070","新密码不能为空!"));
return;
}
Setting_Init.User_AdminPassword = textBox_newpwd.Text.Trim();
textBox_oldpwd.Text = "";
textBox_newpwd.Text = "";
textBox_newpwd2.Text = "";
MessageBox.Show(crc.GetString("Res0071","密码修改成功!"));
}
}
}