370 lines
19 KiB
C#
370 lines
19 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using System.Windows.Forms;
|
|
using GZTW.AyaNova.BLL;
|
|
using Infragistics.Win;
|
|
using log4net;
|
|
|
|
namespace AyaNova
|
|
{
|
|
/// <summary>
|
|
/// Summary description for UserInfoChangePassword.
|
|
/// </summary>
|
|
public class UserInfoChangePassword : System.Windows.Forms.Form
|
|
{
|
|
// Create a logger for use in this class
|
|
//case 1039 private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager tbManager;
|
|
private System.Windows.Forms.Panel UserInfoChangePassword_Fill_Panel;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _UserInfoChangePassword_Toolbars_Dock_Area_Left;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _UserInfoChangePassword_Toolbars_Dock_Area_Right;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _UserInfoChangePassword_Toolbars_Dock_Area_Top;
|
|
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _UserInfoChangePassword_Toolbars_Dock_Area_Bottom;
|
|
private Infragistics.Win.Misc.UltraLabel lblName;
|
|
private Infragistics.Win.Misc.UltraLabel ultraLabel1;
|
|
private Infragistics.Win.Misc.UltraLabel ultraLabel2;
|
|
private Infragistics.Win.UltraWinEditors.UltraTextEditor edLogin;
|
|
private Infragistics.Win.UltraWinEditors.UltraTextEditor edPassword1;
|
|
private Infragistics.Win.UltraWinEditors.UltraTextEditor edPassword2;
|
|
private System.ComponentModel.IContainer components;
|
|
|
|
public UserInfoChangePassword()
|
|
{
|
|
//
|
|
// Required for Windows Form Designer support
|
|
//
|
|
InitializeComponent();
|
|
|
|
//
|
|
//
|
|
//
|
|
}
|
|
|
|
/// <summary>
|
|
/// Clean up any resources being used.
|
|
/// </summary>
|
|
protected override void Dispose( bool disposing )
|
|
{
|
|
if( disposing )
|
|
{
|
|
if(components != null)
|
|
{
|
|
components.Dispose();
|
|
}
|
|
}
|
|
base.Dispose( disposing );
|
|
}
|
|
|
|
#region Windows Form Designer generated code
|
|
/// <summary>
|
|
/// Required method for Designer support - do not modify
|
|
/// the contents of this method with the code editor.
|
|
/// </summary>
|
|
private void InitializeComponent()
|
|
{
|
|
this.components = new System.ComponentModel.Container();
|
|
Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("UltraToolbar1");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.OK");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Cancel");
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.Cancel");
|
|
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("LT:UI.Command.OK");
|
|
Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
|
|
Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
|
|
this.tbManager = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
|
|
this.UserInfoChangePassword_Fill_Panel = new System.Windows.Forms.Panel();
|
|
this.edPassword2 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
|
this.ultraLabel2 = new Infragistics.Win.Misc.UltraLabel();
|
|
this.edPassword1 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
|
this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
|
|
this.edLogin = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
|
|
this.lblName = new Infragistics.Win.Misc.UltraLabel();
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
|
|
((System.ComponentModel.ISupportInitialize)(this.tbManager)).BeginInit();
|
|
this.UserInfoChangePassword_Fill_Panel.SuspendLayout();
|
|
((System.ComponentModel.ISupportInitialize)(this.edPassword2)).BeginInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edPassword1)).BeginInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edLogin)).BeginInit();
|
|
this.SuspendLayout();
|
|
//
|
|
// tbManager
|
|
//
|
|
this.tbManager.DesignerFlags = 1;
|
|
this.tbManager.DockWithinContainer = this;
|
|
this.tbManager.DockWithinContainerBaseType = typeof(System.Windows.Forms.Form);
|
|
this.tbManager.ShowFullMenusDelay = 500;
|
|
ultraToolbar1.DockedColumn = 0;
|
|
ultraToolbar1.DockedRow = 0;
|
|
ultraToolbar1.NonInheritedTools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
|
|
buttonTool1,
|
|
buttonTool2});
|
|
ultraToolbar1.Text = "WorkorderSelectorToolbar";
|
|
this.tbManager.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
|
|
ultraToolbar1});
|
|
this.tbManager.ToolbarSettings.AllowCustomize = Infragistics.Win.DefaultableBoolean.False;
|
|
appearance1.Image = global::AyaNova.Resource1.Cancel32;
|
|
buttonTool3.SharedPropsInternal.AppearancesLarge.Appearance = appearance1;
|
|
appearance2.Image = global::AyaNova.Resource1.Cancel16;
|
|
buttonTool3.SharedPropsInternal.AppearancesSmall.Appearance = appearance2;
|
|
buttonTool3.SharedPropsInternal.Caption = "LT:UI.Command.Cancel";
|
|
appearance3.Image = global::AyaNova.Resource1.OK32;
|
|
buttonTool4.SharedPropsInternal.AppearancesLarge.Appearance = appearance3;
|
|
appearance4.Image = global::AyaNova.Resource1.OK16;
|
|
buttonTool4.SharedPropsInternal.AppearancesSmall.Appearance = appearance4;
|
|
buttonTool4.SharedPropsInternal.Caption = "LT:UI.Command.OK";
|
|
this.tbManager.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
|
|
buttonTool3,
|
|
buttonTool4});
|
|
this.tbManager.UseLargeImagesOnToolbar = true;
|
|
this.tbManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.tbManager_ToolClick);
|
|
//
|
|
// UserInfoChangePassword_Fill_Panel
|
|
//
|
|
this.UserInfoChangePassword_Fill_Panel.Controls.Add(this.edPassword2);
|
|
this.UserInfoChangePassword_Fill_Panel.Controls.Add(this.ultraLabel2);
|
|
this.UserInfoChangePassword_Fill_Panel.Controls.Add(this.edPassword1);
|
|
this.UserInfoChangePassword_Fill_Panel.Controls.Add(this.ultraLabel1);
|
|
this.UserInfoChangePassword_Fill_Panel.Controls.Add(this.edLogin);
|
|
this.UserInfoChangePassword_Fill_Panel.Controls.Add(this.lblName);
|
|
this.UserInfoChangePassword_Fill_Panel.Cursor = System.Windows.Forms.Cursors.Default;
|
|
this.UserInfoChangePassword_Fill_Panel.Dock = System.Windows.Forms.DockStyle.Fill;
|
|
this.UserInfoChangePassword_Fill_Panel.Location = new System.Drawing.Point(0, 43);
|
|
this.UserInfoChangePassword_Fill_Panel.Name = "UserInfoChangePassword_Fill_Panel";
|
|
this.UserInfoChangePassword_Fill_Panel.Size = new System.Drawing.Size(360, 201);
|
|
this.UserInfoChangePassword_Fill_Panel.TabIndex = 0;
|
|
//
|
|
// edPassword2
|
|
//
|
|
this.edPassword2.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
|
this.edPassword2.Location = new System.Drawing.Point(3, 138);
|
|
this.edPassword2.Name = "edPassword2";
|
|
this.edPassword2.PasswordChar = '*';
|
|
this.edPassword2.Size = new System.Drawing.Size(355, 24);
|
|
this.edPassword2.TabIndex = 97;
|
|
//
|
|
// ultraLabel2
|
|
//
|
|
this.ultraLabel2.BorderStyleOuter = Infragistics.Win.UIElementBorderStyle.None;
|
|
this.ultraLabel2.Location = new System.Drawing.Point(0, 120);
|
|
this.ultraLabel2.Name = "ultraLabel2";
|
|
this.ultraLabel2.Size = new System.Drawing.Size(346, 18);
|
|
this.ultraLabel2.TabIndex = 98;
|
|
this.ultraLabel2.Tag = "";
|
|
this.ultraLabel2.Text = "LT:User.Label.Password";
|
|
this.ultraLabel2.WrapText = false;
|
|
//
|
|
// edPassword1
|
|
//
|
|
this.edPassword1.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
|
this.edPassword1.Location = new System.Drawing.Point(3, 83);
|
|
this.edPassword1.Name = "edPassword1";
|
|
this.edPassword1.PasswordChar = '*';
|
|
this.edPassword1.Size = new System.Drawing.Size(355, 24);
|
|
this.edPassword1.TabIndex = 95;
|
|
//
|
|
// ultraLabel1
|
|
//
|
|
this.ultraLabel1.BorderStyleOuter = Infragistics.Win.UIElementBorderStyle.None;
|
|
this.ultraLabel1.Location = new System.Drawing.Point(0, 65);
|
|
this.ultraLabel1.Name = "ultraLabel1";
|
|
this.ultraLabel1.Size = new System.Drawing.Size(346, 18);
|
|
this.ultraLabel1.TabIndex = 96;
|
|
this.ultraLabel1.Tag = "";
|
|
this.ultraLabel1.Text = "LT:User.Label.Password";
|
|
this.ultraLabel1.WrapText = false;
|
|
//
|
|
// edLogin
|
|
//
|
|
this.edLogin.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
|
this.edLogin.Location = new System.Drawing.Point(3, 18);
|
|
this.edLogin.Name = "edLogin";
|
|
this.edLogin.Size = new System.Drawing.Size(355, 24);
|
|
this.edLogin.TabIndex = 93;
|
|
//
|
|
// lblName
|
|
//
|
|
this.lblName.BorderStyleOuter = Infragistics.Win.UIElementBorderStyle.None;
|
|
this.lblName.Location = new System.Drawing.Point(0, 0);
|
|
this.lblName.Name = "lblName";
|
|
this.lblName.Size = new System.Drawing.Size(355, 18);
|
|
this.lblName.TabIndex = 94;
|
|
this.lblName.Tag = "";
|
|
this.lblName.Text = "LT:User.Label.Login";
|
|
this.lblName.WrapText = false;
|
|
//
|
|
// _UserInfoChangePassword_Toolbars_Dock_Area_Left
|
|
//
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 43);
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left.Name = "_UserInfoChangePassword_Toolbars_Dock_Area_Left";
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 201);
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Left.ToolbarsManager = this.tbManager;
|
|
//
|
|
// _UserInfoChangePassword_Toolbars_Dock_Area_Right
|
|
//
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(360, 43);
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right.Name = "_UserInfoChangePassword_Toolbars_Dock_Area_Right";
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 201);
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Right.ToolbarsManager = this.tbManager;
|
|
//
|
|
// _UserInfoChangePassword_Toolbars_Dock_Area_Top
|
|
//
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top.Name = "_UserInfoChangePassword_Toolbars_Dock_Area_Top";
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(360, 43);
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Top.ToolbarsManager = this.tbManager;
|
|
//
|
|
// _UserInfoChangePassword_Toolbars_Dock_Area_Bottom
|
|
//
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 244);
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom.Name = "_UserInfoChangePassword_Toolbars_Dock_Area_Bottom";
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(360, 0);
|
|
this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.tbManager;
|
|
//
|
|
// UserInfoChangePassword
|
|
//
|
|
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
|
|
this.ClientSize = new System.Drawing.Size(360, 244);
|
|
this.Controls.Add(this.UserInfoChangePassword_Fill_Panel);
|
|
this.Controls.Add(this._UserInfoChangePassword_Toolbars_Dock_Area_Left);
|
|
this.Controls.Add(this._UserInfoChangePassword_Toolbars_Dock_Area_Right);
|
|
this.Controls.Add(this._UserInfoChangePassword_Toolbars_Dock_Area_Bottom);
|
|
this.Controls.Add(this._UserInfoChangePassword_Toolbars_Dock_Area_Top);
|
|
this.Name = "UserInfoChangePassword";
|
|
this.ShowInTaskbar = false;
|
|
this.Text = "LT:UI.Label.SetLoginPassword";
|
|
this.Closing += new System.ComponentModel.CancelEventHandler(this.UserInfoChangePassword_Closing);
|
|
this.Load += new System.EventHandler(this.UserInfoChangePassword_Load);
|
|
((System.ComponentModel.ISupportInitialize)(this.tbManager)).EndInit();
|
|
this.UserInfoChangePassword_Fill_Panel.ResumeLayout(false);
|
|
this.UserInfoChangePassword_Fill_Panel.PerformLayout();
|
|
((System.ComponentModel.ISupportInitialize)(this.edPassword2)).EndInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edPassword1)).EndInit();
|
|
((System.ComponentModel.ISupportInitialize)(this.edLogin)).EndInit();
|
|
this.ResumeLayout(false);
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
|
|
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
|
|
// ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
|
|
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
|
|
//
|
|
|
|
#region props
|
|
private User mUser=null;
|
|
public User UserToChangePassword
|
|
{
|
|
get{ return mUser;}
|
|
set{ mUser=value;}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Load / close events
|
|
|
|
private void UserInfoChangePassword_Load(object sender, System.EventArgs e)
|
|
{
|
|
//case 1039 //log.Debug("UserInfoChangePassword_Load");
|
|
Util.LoadFormCustomization("UserInfoChangePassword", this, tbManager, true);
|
|
this.Icon = Resource1.SecurityGroup16icon;
|
|
Util.Localize(this);
|
|
|
|
this.Text=mUser.Name(Util.GlobalSettings.DefaultScheduleableUserNameDisplayFormat)+" - " +this.Text;
|
|
Application.Idle+= new EventHandler(Application_Idle);
|
|
|
|
}
|
|
|
|
private void UserInfoChangePassword_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
//case 1039 //log.Debug("UserInfoChangePassword_Closing");
|
|
|
|
Application.Idle-= new EventHandler(Application_Idle);
|
|
Util.SaveFormCustomization("UserInfoChangePassword", this, tbManager, true);
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region Idle processing
|
|
|
|
private void Application_Idle(object sender, EventArgs e)
|
|
{
|
|
tbManager.Tools["LT:UI.Command.OK"].SharedProps.Enabled=(this.edLogin.Text!="" && this.edPassword1.Text==this.edPassword2.Text);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region UI Commands
|
|
|
|
private void tbManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
|
|
{
|
|
//case 1039 //if(log.IsDebugEnabled) //case 1039 //log.Debug("ToolClick: "+e.Tool.Key);
|
|
|
|
switch (e.Tool.Key)
|
|
{
|
|
case "LT:UI.Command.Cancel": // ButtonTool
|
|
|
|
this.DialogResult=DialogResult.Cancel;
|
|
this.Close();
|
|
break;
|
|
|
|
case "LT:UI.Command.OK": // ButtonTool
|
|
//set login and password
|
|
mUser.Login=this.edLogin.Text;
|
|
mUser.Password=this.edPassword2.Text;
|
|
|
|
this.DialogResult=DialogResult.OK;
|
|
this.Close();
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|