장비관리를 별도의 프로젝트로 분리 -
개별 프로젝트 참조를 위한 뼈대 생성 - 공용은 fcommon 으로 이 관
This commit is contained in:
79
Project/_Common/fUserInfo.cs
Normal file
79
Project/_Common/fUserInfo.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Project._Common
|
||||
{
|
||||
public partial class fUserInfo : Form
|
||||
{
|
||||
public fUserInfo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
private void fUserInfo_Load(object sender, EventArgs e)
|
||||
{
|
||||
// TODO: 이 코드는 데이터를 'dsMSSQL.Users' 테이블에 로드합니다. 필요한 경우 이 코드를 이동하거나 제거할 수 있습니다.
|
||||
this.ta.Fill(this.dsMSSQL.Users);
|
||||
this.bs.Filter = "id='" + FCOMMON.info.Login.no + "'";
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
_Common.fNewPassword f = new fNewPassword(FCOMMON.info.Login.no);
|
||||
if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
var encpassO = Pub.MakePasswordEnc(f.tbPassO.Text);
|
||||
var encpassN = Pub.MakePasswordEnc(f.tbPass1.Text);
|
||||
if (currentPassword != encpassO)
|
||||
{
|
||||
Util.MsgE("Old password error");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Validate();
|
||||
this.bs.EndEdit();
|
||||
var drv = bs.Current as DataRowView;
|
||||
drv["password"] = encpassN;
|
||||
this.bs.EndEdit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string currentPassword = string.Empty;
|
||||
private void bs_CurrentChanged(object sender, EventArgs e)
|
||||
{
|
||||
var drv = bs.Current as DataRowView;
|
||||
currentPassword = string.Empty;
|
||||
if (drv == null) return;
|
||||
var dr = drv.Row as dsMSSQL.UsersRow;
|
||||
currentPassword = dr.password;
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Validate();
|
||||
this.bs.EndEdit();
|
||||
try
|
||||
{
|
||||
var cnt = this.tam.UpdateAll(this.dsMSSQL);
|
||||
Util.MsgI(string.Format("{0}건의 자료가 업데이트 됨", cnt));
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Util.MsgE(ex.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user