Corrected errors in code that cause application to crash during initial testing.
Added code to allow for resetting security for a database. Added class to Reset Security.
This commit is contained in:
@@ -29,20 +29,25 @@ namespace VEPROMS
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
//_MyUser = pgUser.SelectedObject as User;
|
||||
//if(_MyUser.UserID.StartsWith("["))
|
||||
//{
|
||||
// MessageBox.Show(string.Format("{0} is an invalid UserID",_MyUser.UserID));
|
||||
// return;
|
||||
//}
|
||||
//_MyUser.Save();
|
||||
//this.DialogResult = DialogResult.OK;
|
||||
_MyUser = (pgUser.SelectedObject as SimpleUser).MyUser;
|
||||
if (_MyUser.UserID.StartsWith("["))
|
||||
{
|
||||
MessageBox.Show(string.Format("{0} is an invalid UserID", _MyUser.UserID));
|
||||
return;
|
||||
}
|
||||
if (_MyUser.UserID == string.Empty)
|
||||
{
|
||||
MessageBox.Show("A blank UserID is an invalid UserID");
|
||||
return;
|
||||
}
|
||||
_MyUser.Save();
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
//_MyUser = User.Get(_MyUser.UID);
|
||||
//this.DialogResult = DialogResult.Cancel;
|
||||
_MyUser = User.Get(_MyUser.UID);
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
internal class SimpleUser
|
||||
@@ -90,7 +95,7 @@ namespace VEPROMS
|
||||
public string UserID
|
||||
{
|
||||
get { return _MyUser.UserID; }
|
||||
set { _MyUser.UserID = value; _MyUser.UsrID = value; }
|
||||
set { _MyUser.UserID = value.Trim(); _MyUser.UsrID = value.Trim(); }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user