diff --git a/ITC81DB_0H/Controls/Bottom/ControlBottomConfiguration.cs b/ITC81DB_0H/Controls/Bottom/ControlBottomConfiguration.cs index f0250dd..2a638e7 100644 --- a/ITC81DB_0H/Controls/Bottom/ControlBottomConfiguration.cs +++ b/ITC81DB_0H/Controls/Bottom/ControlBottomConfiguration.cs @@ -51,6 +51,8 @@ namespace ITC81DB_0H.Controls { this.CurrentMenu = Define.E_MenuBottomConfiguration.Help; + this.OptionBoardVisible(); + this.CollectionButtonMenu = new Collection(); this.CollectionButtonMenu.Clear(); this.CollectionButtonMenu.Add(this.buttonHelp); @@ -68,6 +70,16 @@ namespace ITC81DB_0H.Controls button.Enabled = enable; } + public void OptionBoardVisible() + { + int value; + + value = int.Parse(this.ParentForm.ParentForm.CurrentSystemParameter1.OptionBoard); + if (value == 0) + this.buttonOptionBoard.Visible = false; + else + this.buttonOptionBoard.Visible = true; + } public void UpdateMenuDisplay(SystemStatus status) { switch (status.CurrentUser.Group) @@ -202,13 +214,6 @@ namespace ITC81DB_0H.Controls public void DisplayRefresh(SystemStatus status) { - int value; - - value = int.Parse(this.ParentForm.ParentForm.CurrentSystemParameter1.OptionBoard); - if (value == 0) - this.buttonOptionBoard.Visible = false; - else - this.buttonOptionBoard.Visible = true; this.buttonHelp.ButtonDown(); this.buttonSerialCOM1.ButtonUp(); diff --git a/ITC81DB_0H/Controls/Bottom/ControlBottomEquipment.cs b/ITC81DB_0H/Controls/Bottom/ControlBottomEquipment.cs index 9c515aa..f481b21 100644 --- a/ITC81DB_0H/Controls/Bottom/ControlBottomEquipment.cs +++ b/ITC81DB_0H/Controls/Bottom/ControlBottomEquipment.cs @@ -12,6 +12,7 @@ using SmartX; using ITC81DB_0H.Forms; using ITC81DB_0H.DialogForms; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { diff --git a/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiEthernet.cs b/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiEthernet.cs index 7411c04..41861c6 100644 --- a/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiEthernet.cs +++ b/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiEthernet.cs @@ -1227,6 +1227,7 @@ namespace ITC81DB_0H.Controls { if (this.labelServerStatus.Text != ">Start") this.labelServerStatus.Text = ">Start"; + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.EthernetConnect, "Server"); this.smartListBoxClientList.ClearAll(); this.labelClientCount.Text = "-"; @@ -1249,6 +1250,7 @@ namespace ITC81DB_0H.Controls { if (this.labelServerStatus.Text != ">Stop") this.labelServerStatus.Text = ">Stop"; + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.EthernetDisconnect, "Server"); this.smartListBoxClientList.ClearAll(); this.labelClientCount.Text = "-"; @@ -1269,8 +1271,12 @@ namespace ITC81DB_0H.Controls private void buttonStart_Click(object sender, EventArgs e) { + string detail = ""; + if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 1) { + detail = "Server"; + this.buttonStart.Enabled = true; this.buttonStop.Enabled = true; @@ -1291,16 +1297,23 @@ namespace ITC81DB_0H.Controls } else if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2) { + detail = "Client"; + this.buttonStart.Enabled = true; this.buttonStop.Enabled = true; this.ParentForm.ParentForm.EthernetClientConnect(); } + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.TryEthernetStart, detail); } private void buttonStop_Click(object sender, EventArgs e) { + string detail = ""; + if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 1) { + detail = "Server"; + this.timerServer.Enabled = false; this.ParentForm.ParentForm.EthernetServerStop(); @@ -1309,8 +1322,10 @@ namespace ITC81DB_0H.Controls } else if (this.ParentForm.ParentForm.SystemConfig2.EthernetOperationMode == 2) { + detail = "Client"; this.ParentForm.ParentForm.EthernetClientDisconnect(); } + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.TryEthernetStop, detail); } private void buttonLocalIP_Click(object sender, EventArgs e) @@ -1368,7 +1383,7 @@ namespace ITC81DB_0H.Controls beforeOpMode = "Client"; else beforeOpMode = "None"; - beforeComMode = this.comboBoxEthernetMode.SelectedItem.ToString(); + beforeComMode = this.ParentForm.ParentForm.ChildFormMenu.CenterConfiSerial.ReturnCommunicationModeName(this.ParentForm.ParentForm.SystemConfig2.EthernetCommMode); if (this.comboBoxEthernetMode.SelectedIndex == 16) // OPC { DialogFormMessage msg = new DialogFormMessage(26, this.ParentForm.ParentForm.SystemConfig1.Language); diff --git a/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiHelp.cs b/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiHelp.cs index b8f1290..e22d6fa 100644 --- a/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiHelp.cs +++ b/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiHelp.cs @@ -162,8 +162,19 @@ namespace ITC81DB_0H.Controls private void DefaultSetting() { this.CurrentMenu = Define.E_MenuBottomConfiguration.Help; + this.OptionBoardVisible(); } + public void OptionBoardVisible() + { + int value; + + value = int.Parse(this.ParentForm.ParentForm.CurrentSystemParameter1.OptionBoard); + if (value == 0) + this.buttonOptionBoard.Visible = false; + else + this.buttonOptionBoard.Visible = true; + } public void UpdateMenuDisplay(SystemStatus status) { switch (status.CurrentUser.Group) @@ -208,14 +219,6 @@ namespace ITC81DB_0H.Controls public void DisplayRefresh(SystemStatus status) { - int value; - - value = int.Parse(this.ParentForm.ParentForm.CurrentSystemParameter1.OptionBoard); - if (value == 0) - this.buttonOptionBoard.Visible = false; - else - this.buttonOptionBoard.Visible = true; - this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.ConfiHelp; this.ParentForm.ParentForm.SetDisplayMode(Define.E_DisplayMode.Menu); this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus); diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipEngineer.Designer.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipEngineer.Designer.cs index b5f2071..d411f41 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipEngineer.Designer.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipEngineer.Designer.cs @@ -30,6 +30,7 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ControlCenterEquipEngineer)); this.smartGroupBox1 = new SmartX.SmartGroupBox(); + this.labelStoragePeriod = new SmartX.SmartLabel(); this.smartLabel1 = new SmartX.SmartLabel(); this.buttonPart11 = new SmartX.SmartButton(); this.labelMotorNum = new SmartX.SmartLabel(); @@ -53,7 +54,6 @@ this.comboBoxEquipmentType = new System.Windows.Forms.ComboBox(); this.buttonCapture = new SmartX.SmartButton(); this.labelTitleEquipmentType = new SmartX.SmartLabel(); - this.labelStoragePeriod = new SmartX.SmartLabel(); this.smartGroupBox1.SuspendLayout(); this.SuspendLayout(); // @@ -99,6 +99,27 @@ this.smartGroupBox1.TabIndex = 3; this.smartGroupBox1.TextColor = System.Drawing.Color.Black; // + // labelStoragePeriod + // + this.labelStoragePeriod.BackColor = System.Drawing.SystemColors.Window; + this.labelStoragePeriod.BackPictureBox = null; + this.labelStoragePeriod.BackPictureBox1 = null; + this.labelStoragePeriod.BackPictureBox2 = null; + this.labelStoragePeriod.BorderColor = System.Drawing.Color.Black; + this.labelStoragePeriod.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.labelStoragePeriod.Font = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Bold); + this.labelStoragePeriod.InitVisible = true; + this.labelStoragePeriod.LineSpacing = 0F; + this.labelStoragePeriod.Location = new System.Drawing.Point(479, 384); + this.labelStoragePeriod.Name = "labelStoragePeriod"; + this.labelStoragePeriod.Size = new System.Drawing.Size(54, 28); + this.labelStoragePeriod.TabIndex = 228; + this.labelStoragePeriod.Text = "12"; + this.labelStoragePeriod.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelStoragePeriod.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelStoragePeriod.Wordwrap = false; + this.labelStoragePeriod.Click += new System.EventHandler(this.labelStoragePeriod_Click); + // // smartLabel1 // this.smartLabel1.BackPictureBox1 = null; @@ -557,27 +578,6 @@ this.labelTitleEquipmentType.Visible = false; this.labelTitleEquipmentType.Wordwrap = false; // - // labelStoragePeriod - // - this.labelStoragePeriod.BackColor = System.Drawing.SystemColors.Window; - this.labelStoragePeriod.BackPictureBox = null; - this.labelStoragePeriod.BackPictureBox1 = null; - this.labelStoragePeriod.BackPictureBox2 = null; - this.labelStoragePeriod.BorderColor = System.Drawing.Color.Black; - this.labelStoragePeriod.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.labelStoragePeriod.Font = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Bold); - this.labelStoragePeriod.InitVisible = true; - this.labelStoragePeriod.LineSpacing = 0F; - this.labelStoragePeriod.Location = new System.Drawing.Point(479, 384); - this.labelStoragePeriod.Name = "labelStoragePeriod"; - this.labelStoragePeriod.Size = new System.Drawing.Size(54, 28); - this.labelStoragePeriod.TabIndex = 228; - this.labelStoragePeriod.Text = "6"; - this.labelStoragePeriod.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; - this.labelStoragePeriod.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; - this.labelStoragePeriod.Wordwrap = false; - this.labelStoragePeriod.Click += new System.EventHandler(this.labelStoragePeriod_Click); - // // ControlCenterEquipEngineer // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipEngineer.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipEngineer.cs index d965f2c..3a634c2 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipEngineer.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipEngineer.cs @@ -15,6 +15,7 @@ using ITC81DB_0H.DialogForms; using ITC81DB_2H_ImageDll; using System.Threading; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { @@ -476,6 +477,9 @@ namespace ITC81DB_0H.Controls this.ParentForm.ParentForm.ChildFormMenu.CenterConfiOptionBoard.InitializeDesign(); + this.ParentForm.ParentForm.ChildFormMenu.CenterConfiHelp.OptionBoardVisible(); + this.ParentForm.ParentForm.ChildFormMenu.BottomConfiguration.OptionBoardVisible(); + this.ParentForm.ParentForm.SaveSystemParameter1File(this.ParentForm.ParentForm.CurrentSystemParameter1); this.ParentForm.ParentForm.TransferParameter1(); } @@ -558,6 +562,9 @@ namespace ITC81DB_0H.Controls this.ParentForm.ParentForm.SystemConfig3.IsPart11 = false; this.ParentForm.ParentForm.SystemConfig1.IsLogin = false; this.ParentForm.LoginVisible(false); + + // User 삭제 + UserManager.UserManager_UserAllDel(); } else { diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipFunctionSetting.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipFunctionSetting.cs index 2248584..ea28fbf 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipFunctionSetting.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipFunctionSetting.cs @@ -15,6 +15,7 @@ using ITC81DB_0H.DialogForms; using ITC81DB_2H_ImageDll; using System.Threading; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { @@ -936,6 +937,9 @@ namespace ITC81DB_0H.Controls this.ParentForm.ParentForm.SystemConfig1.IsLogin = false; this.ParentForm.LoginVisible(false); after = "OFF"; + + // User 삭제 + UserManager.UserManager_UserAllDel(); } else { diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipHelp.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipHelp.cs index abb1f81..e183be0 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipHelp.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipHelp.cs @@ -11,6 +11,7 @@ using ITC81DB_0H.Forms; using ITC81DB_2H_ImageDll; using SmartX; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipInitialize.Designer.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipInitialize.Designer.cs index 6cfb0f0..9852c20 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipInitialize.Designer.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipInitialize.Designer.cs @@ -81,7 +81,7 @@ this.buttonMainBoard.Font = new System.Drawing.Font("새굴림", 18F, System.Drawing.FontStyle.Bold); this.buttonMainBoard.GroupID = 0; this.buttonMainBoard.InitVisible = true; - this.buttonMainBoard.Location = new System.Drawing.Point(460, 340); + this.buttonMainBoard.Location = new System.Drawing.Point(255, 298); this.buttonMainBoard.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.buttonMainBoard.Name = "buttonMainBoard"; this.buttonMainBoard.NestedClickEventPrevent = false; @@ -115,7 +115,7 @@ this.buttonMainBoardLcd.Font = new System.Drawing.Font("새굴림", 18F, System.Drawing.FontStyle.Bold); this.buttonMainBoardLcd.GroupID = 0; this.buttonMainBoardLcd.InitVisible = true; - this.buttonMainBoardLcd.Location = new System.Drawing.Point(44, 340); + this.buttonMainBoardLcd.Location = new System.Drawing.Point(49, 298); this.buttonMainBoardLcd.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.buttonMainBoardLcd.Name = "buttonMainBoardLcd"; this.buttonMainBoardLcd.NestedClickEventPrevent = false; @@ -149,7 +149,7 @@ this.buttonSystemInitialization.Font = new System.Drawing.Font("새굴림", 18F, System.Drawing.FontStyle.Bold); this.buttonSystemInitialization.GroupID = 0; this.buttonSystemInitialization.InitVisible = true; - this.buttonSystemInitialization.Location = new System.Drawing.Point(460, 396); + this.buttonSystemInitialization.Location = new System.Drawing.Point(460, 391); this.buttonSystemInitialization.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.buttonSystemInitialization.Name = "buttonSystemInitialization"; this.buttonSystemInitialization.NestedClickEventPrevent = false; @@ -183,7 +183,7 @@ this.buttonBackup.Font = new System.Drawing.Font("새굴림", 18F, System.Drawing.FontStyle.Bold); this.buttonBackup.GroupID = 0; this.buttonBackup.InitVisible = true; - this.buttonBackup.Location = new System.Drawing.Point(44, 396); + this.buttonBackup.Location = new System.Drawing.Point(48, 391); this.buttonBackup.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.buttonBackup.Name = "buttonBackup"; this.buttonBackup.NestedClickEventPrevent = false; @@ -237,7 +237,7 @@ this.buttonLcd.Font = new System.Drawing.Font("새굴림", 18F, System.Drawing.FontStyle.Bold); this.buttonLcd.GroupID = 0; this.buttonLcd.InitVisible = true; - this.buttonLcd.Location = new System.Drawing.Point(255, 298); + this.buttonLcd.Location = new System.Drawing.Point(461, 298); this.buttonLcd.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.buttonLcd.Name = "buttonLcd"; this.buttonLcd.NestedClickEventPrevent = false; @@ -248,7 +248,7 @@ this.buttonLcd.Size = new System.Drawing.Size(200, 50); this.buttonLcd.SpecialFunction = SmartX.SmartButton.SPECIALFUNC.NONE; this.buttonLcd.TabIndex = 27; - this.buttonLcd.Text = "Initialization"; + this.buttonLcd.Text = "LCD"; this.buttonLcd.TextColor = System.Drawing.Color.White; this.buttonLcd.TextDownColor = System.Drawing.Color.White; this.buttonLcd.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipInitialize.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipInitialize.cs index 564ac56..85a54ea 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipInitialize.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipInitialize.cs @@ -12,6 +12,7 @@ using ITC81DB_0H.Forms; using ITC81DB_0H.DialogForms; using ITC81DB_2H_ImageDll; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { @@ -193,6 +194,8 @@ namespace ITC81DB_0H.Controls this.UpdateLabelStatus(this.InitializeStep, this.ParentForm.ParentForm.SystemConfig1.Language); this.progressBarInitialize.Value = 0; + // User 삭제 + UserManager.UserManager_UserAllDel(); this.progressBarInitialize.Value += 20; // SD Card - SystemFile2를 RemoveFiles로 이동 this.MoveToRemoveFileFolder(this.ParentForm.ParentForm.PathSDCardSystemFile2Folder); @@ -225,7 +228,10 @@ namespace ITC81DB_0H.Controls this.progressBarInitialize.Value += 15; // Flash Disk - SystemFile2 이동 this.CopyFolder(this.ParentForm.ParentForm.PathFlashDiskSystemFile2Folder, this.ParentForm.ParentForm.PathSDCardSystemFile2Folder); - this.progressBarInitialize.Value += 15; + this.progressBarInitialize.Value += 10; + // User 삭제 + UserManager.UserManager_UserAllDel(); + this.progressBarInitialize.Value += 5; this.DeleteCounterFile(); this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Init_LCD, ""); this.progressBarInitialize.Value += 15; @@ -269,9 +275,12 @@ namespace ITC81DB_0H.Controls this.UpdateLabelStatus(this.InitializeStep, this.ParentForm.ParentForm.SystemConfig1.Language); this.progressBarInitialize.Value = 0; + // User 삭제 + UserManager.UserManager_UserAllDel(); + this.progressBarInitialize.Value += 20; // SystemFile 1, 2 RemoveFile 폴더로 이동 this.MoveToRemoveFileFolder(this.ParentForm.ParentForm.PathSDCardSystemFile1Folder); - this.progressBarInitialize.Value += 50; + this.progressBarInitialize.Value += 30; this.MoveToRemoveFileFolder(this.ParentForm.ParentForm.PathSDCardSystemFile2Folder); this.progressBarInitialize.Value = 100; diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUpdate.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUpdate.cs index bb7da8a..9eb3fb3 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUpdate.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUpdate.cs @@ -311,6 +311,7 @@ namespace ITC81DB_0H.Controls public void UpdateMainBoardFail(Define.E_LanguageID language) { this.ParentForm.Enabled = false; + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Update, "Mainboard Fail"); switch (language) { @@ -352,6 +353,7 @@ namespace ITC81DB_0H.Controls { this.UpdateStep = Define.E_Step3.Step3; this.UpdateLabelStatus(this.UpdateStep, this.ParentForm.ParentForm.SystemConfig1.Language); + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Update, "Mainboard Success"); } private void UpdateLabelStatus(Define.E_Step3 step, Define.E_LanguageID language) { @@ -475,7 +477,6 @@ namespace ITC81DB_0H.Controls } #endregion this.progressBarUpdate.Value = 100; - this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Update, "Mainboard"); break; default: break; diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.Designer.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.Designer.cs index 51ab4ce..4830c18 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.Designer.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.Designer.cs @@ -58,7 +58,7 @@ this.textBoxPassword = new System.Windows.Forms.TextBox(); this.textBoxID = new System.Windows.Forms.TextBox(); this.buttonGroupEditor = new SmartX.SmartButton(); - this.listBoxUserList = new SmartX.SmartListBox(); + this.listBoxUserList = new System.Windows.Forms.ListBox(); this.smartGroupBox1.SuspendLayout(); this.SuspendLayout(); // @@ -67,6 +67,7 @@ this.smartGroupBox1.BackColor = System.Drawing.Color.Black; this.smartGroupBox1.BackPictureBox = null; this.smartGroupBox1.BackPictureBox1 = null; + this.smartGroupBox1.Controls.Add(this.listBoxUserList); this.smartGroupBox1.Controls.Add(this.comboBoxAccessRight); this.smartGroupBox1.Controls.Add(this.labelAccessRightAdmin); this.smartGroupBox1.Controls.Add(this.smartSeparatorLine2); @@ -95,7 +96,6 @@ this.smartGroupBox1.Controls.Add(this.textBoxPassword); this.smartGroupBox1.Controls.Add(this.textBoxID); this.smartGroupBox1.Controls.Add(this.buttonGroupEditor); - this.smartGroupBox1.Controls.Add(this.listBoxUserList); this.smartGroupBox1.FrameLineColor1 = System.Drawing.Color.Black; this.smartGroupBox1.FrameLineColor2 = System.Drawing.Color.Black; this.smartGroupBox1.FrameLineThickness = 1; @@ -749,37 +749,11 @@ // // listBoxUserList // - this.listBoxUserList.BackColor = System.Drawing.Color.White; - this.listBoxUserList.BackPictureBox = null; - this.listBoxUserList.BackPictureBox1 = null; - this.listBoxUserList.BackPictureBox2 = null; - this.listBoxUserList.ColumnAlign = SmartX.SmartListBox.COLUMNALIGNS.LEFT; - this.listBoxUserList.ColumnDelimiter = '\0'; - this.listBoxUserList.ColumnOffsets = null; - this.listBoxUserList.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); - this.listBoxUserList.FontColor = System.Drawing.Color.Black; - this.listBoxUserList.InitVisible = true; - this.listBoxUserList.ItemAddOrder = SmartX.SmartListBox.ITEMADDORDERS.BOTTOMADD; - this.listBoxUserList.ItemOffsetGap = 10; - this.listBoxUserList.ItemOffsetX = 5; - this.listBoxUserList.ItemOffsetY = 0; + this.listBoxUserList.Font = new System.Drawing.Font("새굴림", 15F, System.Drawing.FontStyle.Bold); this.listBoxUserList.Location = new System.Drawing.Point(14, 12); - this.listBoxUserList.MouseMoveEventSpace = 3; - this.listBoxUserList.MouseMoveSpace = 10; this.listBoxUserList.Name = "listBoxUserList"; - this.listBoxUserList.OutLineColor = System.Drawing.SystemColors.ControlText; - this.listBoxUserList.SelectColor = System.Drawing.Color.Blue; - this.listBoxUserList.SelectFilled = true; - this.listBoxUserList.SelectFontColor = System.Drawing.Color.DarkBlue; - this.listBoxUserList.SelectItemIndex = -1; - this.listBoxUserList.SeparationlineColor1 = System.Drawing.Color.Gray; - this.listBoxUserList.SeparationlineColor2 = System.Drawing.Color.LightGray; - this.listBoxUserList.SeparationLineStyle = SmartX.SmartListBox.SEPARATIONLINETYPES.FixedSingle; - this.listBoxUserList.SeparationlineVisibleBottom = true; - this.listBoxUserList.SeparationlineVisibleTop = true; - this.listBoxUserList.Size = new System.Drawing.Size(243, 386); - this.listBoxUserList.TabIndex = 171; - this.listBoxUserList.Text = "smartListBox1"; + this.listBoxUserList.Size = new System.Drawing.Size(243, 370); + this.listBoxUserList.TabIndex = 211; this.listBoxUserList.SelectedIndexChanged += new System.EventHandler(this.listBoxUserList_SelectedIndexChanged); // // ControlCenterEquipUser @@ -801,7 +775,6 @@ private System.Windows.Forms.TextBox textBoxPassword; private System.Windows.Forms.TextBox textBoxID; public SmartX.SmartLabel labelTitleID; - private SmartX.SmartListBox listBoxUserList; private SmartX.SmartButton buttonIDEdit; private SmartX.SmartKeyboard smartKeyboard; private SmartX.SmartButton buttonPasswordEdit; @@ -826,5 +799,6 @@ private SmartX.SmartSeparatorLine smartSeparatorLine2; private SmartX.SmartSeparatorLine smartSeparatorLine1; public SmartX.SmartLabel labelAccessRightAdmin; + public System.Windows.Forms.ListBox listBoxUserList; } } diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.cs index 4980679..63ac89a 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUser.cs @@ -409,8 +409,8 @@ namespace ITC81DB_0H.Controls #endregion item.ID = this.textBoxID.Text; - item.SetPassword(this.textBoxPassword.Text); - item.ExpireAccount = int.Parse(this.labelExpiryDateOfAccount.Text); + item.Password = this.textBoxPassword.Text; + item.ExpireId = int.Parse(this.labelExpiryDateOfAccount.Text); item.ExpirePassword = int.Parse(this.labelExpiryDateOfPassword.Text); if (this.SelectedUserItem.Group == Define.E_UserGroup.Admin) @@ -433,12 +433,12 @@ namespace ITC81DB_0H.Controls if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true) { if (item.ActiveLevel == 1 || item.ActiveLevel == 2 || item.ActiveLevel == 3) - UserManager.UserManager_UserNew(item.ID, item.Password, 0, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId); + UserManager.UserManager_UserNew(item.ID, item.Password, 0, item.ExpirePassword, item.ExpireId, item.ActiveLevel, menuId); else - UserManager.UserManager_UserNew(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId); + UserManager.UserManager_UserNew(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireId, item.ActiveLevel, menuId); } else // Part11 미사용, Login 사용 시, 항상 관리자로 지정 - UserManager.UserManager_UserNew(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId); + UserManager.UserManager_UserNew(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireId, item.ActiveLevel, menuId); // Part 11 detail = string.Format("Add : {0}", item.ID); @@ -451,19 +451,19 @@ namespace ITC81DB_0H.Controls if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true) { if (item.ActiveLevel == 1 || item.ActiveLevel == 2 || item.ActiveLevel == 3) - UserManager.UserManager_UserModify(item.ID, item.Password, 0, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId); + UserManager.UserManager_UserModify(item.ID, item.Password, 0, item.ExpirePassword, item.ExpireId, item.ActiveLevel, menuId); else - UserManager.UserManager_UserModify(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId); + UserManager.UserManager_UserModify(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireId, item.ActiveLevel, menuId); } else // Part11 미사용, Login 사용 시, 항상 관리자로 지정 - UserManager.UserManager_UserModify(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireAccount, item.ActiveLevel, menuId); + UserManager.UserManager_UserModify(item.ID, item.Password, 1, item.ExpirePassword, item.ExpireId, item.ActiveLevel, menuId); // Part 11 detail = string.Format("Modify : {0}", item.ID); this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.UserEditor, detail); #endregion } - + this.buttonSave.Visible = false; } } @@ -483,6 +483,7 @@ namespace ITC81DB_0H.Controls this.labelExpiryDateOfAccount2.ForeColor = Color.White; this.labelExpiryDateOfPassword2.ForeColor = Color.White; + this.comboBoxAccessRight.Visible = true; this.comboBoxAccessRight.SelectedIndexChanged -= new EventHandler(this.comboBoxAccessRight_SelectedIndexChanged); this.comboBoxAccessRight.SelectedIndex = 0; this.comboBoxAccessRight.SelectedIndexChanged += new EventHandler(this.comboBoxAccessRight_SelectedIndexChanged); @@ -496,7 +497,7 @@ namespace ITC81DB_0H.Controls this.buttonSave.Visible = false; this.listBoxUserList.SelectedIndexChanged -= new EventHandler(this.listBoxUserList_SelectedIndexChanged); - this.listBoxUserList.SelectItemIndex = -1; + this.listBoxUserList.SelectedIndex = -1; this.listBoxUserList.SelectedIndexChanged += new EventHandler(this.listBoxUserList_SelectedIndexChanged); } private void UpdateCurrentUserItem(UserManager.UserMgr_user_list_t item) @@ -507,9 +508,9 @@ namespace ITC81DB_0H.Controls this.SelectedUserItem.ID = item.user_id; this.SelectedUserItem.Password = item.user_pw; - this.SelectedUserItem.ExpireAccount = item.expire_period_account; - this.SelectedUserItem.ExpirePassword = item.expire_period_pw; - + this.SelectedUserItem.ExpireId = item.id_expire_period; + this.SelectedUserItem.ExpirePassword = item.password_expire_period; + if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true) this.SelectedUserItem.IsAdmin = item.fadmin == 0 ? false : true; else @@ -532,24 +533,24 @@ namespace ITC81DB_0H.Controls if (this.SelectedUserItem.Group == Define.E_UserGroup.Admin || this.SelectedUserItem.Group == Define.E_UserGroup.Developer) { - this.SelectedUserItem.DateRegister = DateTime.Now; - this.SelectedUserItem.DateLogin = DateTime.Now; - this.SelectedUserItem.DateExpireRegister = DateTime.Now; - this.SelectedUserItem.DateExpireLogin = DateTime.Now; + this.SelectedUserItem.DatePasswordRegister = DateTime.Now; + this.SelectedUserItem.DateIdLogin = DateTime.Now; + this.SelectedUserItem.DatePasswordExpire = DateTime.Now; + this.SelectedUserItem.DateIdExpire = DateTime.Now; } else { - DateTime time = DateTime.ParseExact(item.register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.SelectedUserItem.DateRegister = time; - time = DateTime.ParseExact(item.login_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.SelectedUserItem.DateLogin = time; - time = DateTime.ParseExact(item.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.SelectedUserItem.DateExpireLogin = time; - time = DateTime.ParseExact(item.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.SelectedUserItem.DateExpireRegister = time; + DateTime time = DateTime.ParseExact(item.password_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.SelectedUserItem.DatePasswordRegister = time; + time = DateTime.ParseExact(item.id_login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.SelectedUserItem.DateIdLogin = time; + time = DateTime.ParseExact(item.id_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.SelectedUserItem.DateIdExpire = time; + time = DateTime.ParseExact(item.password_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.SelectedUserItem.DatePasswordExpire = time; } - this.SelectedUserItem.IsLockAccount = item.flock_status_account == 0 ? false : true; + this.SelectedUserItem.IsLockAccount = item.id_flock_status == 0 ? false : true; this.SelectedUserItem.IsLockPassword = item.flock_status_password == 0 ? false : true; } catch (Exception ex) @@ -563,20 +564,31 @@ namespace ITC81DB_0H.Controls this.SelectedUserItem.ID = item.user_id; this.SelectedUserItem.Password = item.user_pw; - this.SelectedUserItem.ExpireAccount = item.expire_period_account; - this.SelectedUserItem.ExpirePassword = item.expire_period_pw; + this.SelectedUserItem.ExpireId = item.id_expire_period; + this.SelectedUserItem.ExpirePassword = item.password_expire_period; - DateTime time = DateTime.ParseExact(item.register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.SelectedUserItem.DateRegister = time; - time = DateTime.ParseExact(item.login_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.SelectedUserItem.DateLogin = time; - time = DateTime.ParseExact(item.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.SelectedUserItem.DateExpireLogin = time; - time = DateTime.ParseExact(item.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.SelectedUserItem.DateExpireRegister = time; + if (this.SelectedUserItem.Group == Define.E_UserGroup.Admin + || this.SelectedUserItem.Group == Define.E_UserGroup.Developer) + { + this.SelectedUserItem.DatePasswordRegister = DateTime.Now; + this.SelectedUserItem.DateIdLogin = DateTime.Now; + this.SelectedUserItem.DatePasswordExpire = DateTime.Now; + this.SelectedUserItem.DateIdExpire = DateTime.Now; + } + else + { + DateTime time = DateTime.ParseExact(item.password_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.SelectedUserItem.DatePasswordRegister = time; + time = DateTime.ParseExact(item.id_login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.SelectedUserItem.DateIdLogin = time; + time = DateTime.ParseExact(item.id_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.SelectedUserItem.DateIdExpire = time; + time = DateTime.ParseExact(item.password_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.SelectedUserItem.DatePasswordExpire = time; + } - this.SelectedUserItem.IsLockAccount = item.flock_status_account == 0 ? false : true; - this.SelectedUserItem.IsLockPassword = item.flock_status_password == 0 ? false : true; + this.SelectedUserItem.IsLockAccount = item.id_flock_status == 0 ? false : true; + this.SelectedUserItem.IsLockPassword = item.password_flock_status == 0 ? false : true; if (this.ParentForm.ParentForm.SystemConfig3.IsPart11 == true) this.SelectedUserItem.IsAdmin = item.fadmin == 0 ? false : true; @@ -603,7 +615,7 @@ namespace ITC81DB_0H.Controls this.textBoxID.Text = item.ID; this.textBoxPassword.Text = item.Password; - if (this.listBoxUserList.SelectItemIndex == 0) + if (this.listBoxUserList.SelectedIndex == 0) { this.labelExpiryDateOfAccount.Text = "0"; this.labelExpiryDateOfPassword.Text = "0"; @@ -625,7 +637,7 @@ namespace ITC81DB_0H.Controls else { #region 만료일 - this.labelExpiryDateOfAccount.Text = item.ExpireAccount.ToString(); + this.labelExpiryDateOfAccount.Text = item.ExpireId.ToString(); this.labelExpiryDateOfPassword.Text = item.ExpirePassword.ToString(); if (item.IsLockAccount == true) @@ -658,7 +670,7 @@ namespace ITC81DB_0H.Controls else { this.labelExpiryDateOfAccount2.ForeColor = Color.White; - this.labelExpiryDateOfAccount2.Text = string.Format("{0:yy/MM/dd} ~ {1:yy/MM/dd}", item.DateLogin, item.DateExpireLogin); + this.labelExpiryDateOfAccount2.Text = string.Format("{0:yy/MM/dd} ~ {1:yy/MM/dd}", item.DateIdLogin, item.DateIdExpire); } if (item.IsLockPassword == true) @@ -691,7 +703,7 @@ namespace ITC81DB_0H.Controls else { this.labelExpiryDateOfPassword2.ForeColor = Color.White; - this.labelExpiryDateOfPassword2.Text = string.Format("{0:yy/MM/dd} ~ {1:yy/MM/dd}", item.DateRegister, item.DateExpireRegister); + this.labelExpiryDateOfPassword2.Text = string.Format("{0:yy/MM/dd} ~ {1:yy/MM/dd}", item.DatePasswordRegister, item.DatePasswordExpire); } #endregion @@ -713,7 +725,7 @@ namespace ITC81DB_0H.Controls { this.SetEnableOnlyPart11Value(true); this.comboBoxAccessRight.Enabled = true; - } + } } //this.cbAdministrator.Visible = true; @@ -721,9 +733,9 @@ namespace ITC81DB_0H.Controls } private void UpdateUserListBoxDisplay(List items) { - this.listBoxUserList.ClearAll(); + this.listBoxUserList.Items.Clear(); for (int i = 1; i < items.Count; i++) - this.listBoxUserList.AddItem(items[i]); + this.listBoxUserList.Items.Add(items[i]); } public void CallBackGetUserData(UserManager.UserMgr_user_list_t user) @@ -784,7 +796,7 @@ namespace ITC81DB_0H.Controls this.ParentForm.ParentForm.ListDllUserName.Add(user.user_id); this.UpdateUserListBoxDisplay(this.ParentForm.ParentForm.ListDllUserName); - this.listBoxUserList.SelectItemIndex = this.listBoxUserList.ItemCount - 1; + this.listBoxUserList.SelectedIndex = this.listBoxUserList.Items.Count - 1; this.SetEnableID(false); this.SetEnablePassword(false); @@ -846,7 +858,7 @@ namespace ITC81DB_0H.Controls this.UI_Invoke(delegate { // 메시지 박스 교체 - UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[this.listBoxUserList.SelectItemIndex]); + UserManager.UserManager_GetUserListID(this.listBoxUserList.SelectedItem.ToString()); DialogFormMessage dlg = new DialogFormMessage(Define.E_MessageBoxIcon.Asterisk, code, message1, message2, 0); dlg.ShowDialog(); @@ -865,7 +877,7 @@ namespace ITC81DB_0H.Controls this.SelectedUserItem.IsLockAccount = user.flock_status_account == 0 ? false : true; this.SelectedUserItem.IsLockPassword = user.flock_status_password == 0 ? false : true; - UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[this.listBoxUserList.SelectItemIndex]); + UserManager.UserManager_GetUserListID(this.SelectedUserItem.ID); } } public void CallBackUserListDeleteDataEvent(UserManager.UserMgr_user_del_t user) @@ -1024,16 +1036,17 @@ namespace ITC81DB_0H.Controls #region Event Handler private void listBoxUserList_SelectedIndexChanged(object sender, EventArgs e) { - int index = this.listBoxUserList.SelectItemIndex; + int index = this.listBoxUserList.SelectedIndex; this.IsNew = false; this.SetEnablePassword(true); this.SetTextBoxPasswordChar(this.PasswordChar); this.labelAutomaticLogoutTime.Enabled = true; + this.buttonSave.Visible = false; if (index == 0) { - UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[index]); + UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[index].ToString()); } else if (index < 0) { @@ -1041,7 +1054,7 @@ namespace ITC81DB_0H.Controls } else if (index > 0) { - if (this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.ID == this.listBoxUserList.Items[index]) + if (this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.ID == this.listBoxUserList.Items[index].ToString()) this.buttonDelete.Visible = false; else this.buttonDelete.Visible = true; @@ -1050,7 +1063,7 @@ namespace ITC81DB_0H.Controls this.SetEnableControl(true); this.SetEnablePassword(true); - UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[index]); + UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[index].ToString()); } } @@ -1072,6 +1085,7 @@ namespace ITC81DB_0H.Controls { e.Handled = true; + this.ParentForm.Enabled = true; this.KeyboardClose(); if (this.buttonSave.Visible == false) @@ -1082,6 +1096,7 @@ namespace ITC81DB_0H.Controls e.Handled = true; this.textBoxID.Text = this.BeforeID; + this.ParentForm.Enabled = true; this.KeyboardClose(); } else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?' @@ -1161,7 +1176,7 @@ namespace ITC81DB_0H.Controls } private void buttonDelete_Click(object sender, EventArgs e) { - if (this.listBoxUserList.SelectItemIndex == -1) + if (this.listBoxUserList.SelectedIndex == -1) return; // 사용자를 삭제 하시겠습니까? @@ -1171,10 +1186,10 @@ namespace ITC81DB_0H.Controls if (this.listBoxUserList.Items.Count <= 1) return; - if (this.listBoxUserList.SelectItemIndex <= 0) + if (this.listBoxUserList.SelectedIndex <= 0) return; - string id = this.listBoxUserList.Items[this.listBoxUserList.SelectItemIndex]; + string id = this.listBoxUserList.Items[this.listBoxUserList.SelectedIndex].ToString(); UserManager.UserManager_UserDel(id); @@ -1215,6 +1230,7 @@ namespace ITC81DB_0H.Controls this.SetTextBoxPasswordChar(true); this.textBoxPassword.Select(this.textBoxPassword.Text.Length, 0); + this.listBoxUserList.Enabled = false; this.SetEnableControl(false); this.SetEnableID(false); } diff --git a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUserGroupEditor.cs b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUserGroupEditor.cs index 05622bf..3c023fd 100644 --- a/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUserGroupEditor.cs +++ b/ITC81DB_0H/Controls/CenterEquipment/ControlCenterEquipUserGroupEditor.cs @@ -12,6 +12,7 @@ using ITC81DB_0H.DialogForms; using ITC81DB_2H_ImageDll; using ITC81DB_2H.Datastore; using SmartX; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { @@ -473,18 +474,27 @@ namespace ITC81DB_0H.Controls if (button == this.buttonEditLevel1) { + this.textBoxLevel2.Enabled = false; + this.textBoxLevel3.Enabled = false; + this.BeforeTextBox1 = this.textBoxLevel1.Text; this.smartKeyboard.TargetInputObject = this.textBoxLevel1; this.textBoxLevel1.Select(this.textBoxLevel1.Text.Length, 0); } else if (button == this.buttonEditLevel2) { + this.textBoxLevel1.Enabled = false; + this.textBoxLevel3.Enabled = false; + this.BeforeTextBox2 = this.textBoxLevel2.Text; this.smartKeyboard.TargetInputObject = this.textBoxLevel2; this.textBoxLevel2.Select(this.textBoxLevel2.Text.Length, 0); } else if (button == this.buttonEditLevel3) { + this.textBoxLevel1.Enabled = false; + this.textBoxLevel2.Enabled = false; + this.BeforeTextBox3 = this.textBoxLevel3.Text; this.smartKeyboard.TargetInputObject = this.textBoxLevel3; this.textBoxLevel3.Select(this.textBoxLevel3.Text.Length, 0); @@ -521,6 +531,10 @@ namespace ITC81DB_0H.Controls if (before != after) this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.ChangeL1Name, "", before, after); } + + this.textBoxLevel1.Enabled = true; + this.textBoxLevel2.Enabled = true; + this.textBoxLevel3.Enabled = true; } else if (e.KeyChar == 27) { @@ -528,6 +542,10 @@ namespace ITC81DB_0H.Controls this.textBoxLevel1.Text = this.BeforeTextBox1; this.smartKeyboard.Hide(); + + this.textBoxLevel1.Enabled = true; + this.textBoxLevel2.Enabled = true; + this.textBoxLevel3.Enabled = true; } else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?' || e.KeyChar == '*' || e.KeyChar == ':' || e.KeyChar == '/' || e.KeyChar == '\\') @@ -563,6 +581,9 @@ namespace ITC81DB_0H.Controls if (before != after) this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.ChangeL2Name, "", before, after); } + this.textBoxLevel1.Enabled = true; + this.textBoxLevel2.Enabled = true; + this.textBoxLevel3.Enabled = true; } else if (e.KeyChar == 27) { @@ -570,6 +591,10 @@ namespace ITC81DB_0H.Controls this.textBoxLevel2.Text = this.BeforeTextBox2; this.smartKeyboard.Hide(); + + this.textBoxLevel1.Enabled = true; + this.textBoxLevel2.Enabled = true; + this.textBoxLevel3.Enabled = true; } else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?' || e.KeyChar == '*' || e.KeyChar == ':' || e.KeyChar == '/' || e.KeyChar == '\\') @@ -605,6 +630,10 @@ namespace ITC81DB_0H.Controls if (before != after) this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.ChangeL3Name, "", before, after); } + + this.textBoxLevel1.Enabled = true; + this.textBoxLevel2.Enabled = true; + this.textBoxLevel3.Enabled = true; } else if (e.KeyChar == 27) { @@ -612,6 +641,10 @@ namespace ITC81DB_0H.Controls this.textBoxLevel3.Text = this.BeforeTextBox3; this.smartKeyboard.Hide(); + + this.textBoxLevel1.Enabled = true; + this.textBoxLevel2.Enabled = true; + this.textBoxLevel3.Enabled = true; } else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?' || e.KeyChar == '*' || e.KeyChar == ':' || e.KeyChar == '/' || e.KeyChar == '\\') diff --git a/ITC81DB_0H/Controls/CenterSystem/ControlCenterSystemCalibration.cs b/ITC81DB_0H/Controls/CenterSystem/ControlCenterSystemCalibration.cs index caa75c1..f32b05f 100644 --- a/ITC81DB_0H/Controls/CenterSystem/ControlCenterSystemCalibration.cs +++ b/ITC81DB_0H/Controls/CenterSystem/ControlCenterSystemCalibration.cs @@ -314,6 +314,7 @@ namespace ITC81DB_0H.Controls { this.IsCalibrationFinish = true; this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress.ParameterRead3901, ""); + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Calibration, "Calibration Success"); } break; case Define.E_WeightStatus.CalError: @@ -349,6 +350,8 @@ namespace ITC81DB_0H.Controls this.CalibrationPictureBoxVisible(true, false, false); this.labelWeight.Text = Helper.DoubleToString(data.Weight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces); this.labelWeight.ForeColor = this.NormalColor; + + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Calibration, "Calibration Fail"); break; default: break; diff --git a/ITC81DB_0H/Controls/CenterSystem/ControlCenterSystemJudgmentManual.cs b/ITC81DB_0H/Controls/CenterSystem/ControlCenterSystemJudgmentManual.cs index d25683e..5b31877 100644 --- a/ITC81DB_0H/Controls/CenterSystem/ControlCenterSystemJudgmentManual.cs +++ b/ITC81DB_0H/Controls/CenterSystem/ControlCenterSystemJudgmentManual.cs @@ -429,8 +429,10 @@ namespace ITC81DB_0H.Controls #region Event Handler private void buttonProductNo_Click(object sender, EventArgs e) { + string before = "", after = ""; string message = ""; + before = this.buttonProductNo.Text; DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.buttonProductNo.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language); if (myKeyPad.ShowDialog() == DialogResult.OK) @@ -444,10 +446,13 @@ namespace ITC81DB_0H.Controls } else { - this.buttonProductNo.Text = myKeyPad.StringValue; + after = this.buttonProductNo.Text = myKeyPad.StringValue; this.buttonProductNo.Text = "**"; this.ParentForm.ParentForm.TransferProductParameter(myKeyPad.IntValue); + + if (before != after) + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.ProductNo, "", before, after); } } } @@ -861,6 +866,9 @@ namespace ITC81DB_0H.Controls this.CaptureJudgmentSetItem.DescendDelayTime = this.ParentForm.ParentForm.CurrentJudgmentSetItem.DescendDelayTime; this.CaptureJudgmentSetItem.AscendDelayTime = this.ParentForm.ParentForm.CurrentJudgmentSetItem.AscendDelayTime; this.CaptureJudgmentSetItem.ProductLength = this.ParentForm.ParentForm.CurrentJudgmentSetItem.ProductLength; + + // Part11 + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.ProductCopy, this.buttonCopy.Text); } private void buttonPaste_Click(object sender, EventArgs e) { @@ -890,6 +898,9 @@ namespace ITC81DB_0H.Controls this.buttonProductNo.Text = "**"; this.ParentForm.ParentForm.TransferProductParameter(this.ParentForm.ParentForm.SystemConfig1.ProductNumber); + + // Part11 + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.ProductPaste, this.ParentForm.ParentForm.SystemConfig1.ProductNumber.ToString()); } private void buttonPasteAll_Click(object sender, EventArgs e) { @@ -959,6 +970,9 @@ namespace ITC81DB_0H.Controls this.ParentForm.Enabled = true; splash.Finish(); + + // Part11 + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.ProductAllPaste, ""); } private void buttonWeightReference_Click(object sender, EventArgs e) diff --git a/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayMenu.cs b/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayMenu.cs index cf1d59c..56d38c9 100644 --- a/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayMenu.cs +++ b/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayMenu.cs @@ -12,6 +12,7 @@ using ITC81DB_0H.DialogForms; using ITC81DB_0H.Forms; using ITC81DB_2H_ImageDll; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { diff --git a/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStart.cs b/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStart.cs index 960d8c9..6bb79c0 100644 --- a/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStart.cs +++ b/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStart.cs @@ -12,6 +12,7 @@ using ITC81DB_0H.DialogForms; using ITC81DB_0H.Forms; using ITC81DB_2H_ImageDll; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { @@ -257,22 +258,22 @@ namespace ITC81DB_0H.Controls this.buttonTareRange.Enabled = false; break; case Define.E_UserGroup.Level1: - this.buttonUnderRange.Enabled = true; - this.buttonPassRange.Enabled = true; - this.buttonOverRange.Enabled = true; - this.buttonTareRange.Enabled = true; + this.buttonUnderRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting; + this.buttonPassRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting; + this.buttonOverRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting; + this.buttonTareRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting; break; case Define.E_UserGroup.Level2: - this.buttonUnderRange.Enabled = true; - this.buttonPassRange.Enabled = true; - this.buttonOverRange.Enabled = true; - this.buttonTareRange.Enabled = true; + this.buttonUnderRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting; + this.buttonPassRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting; + this.buttonOverRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting; + this.buttonTareRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting; break; case Define.E_UserGroup.Level3: - this.buttonUnderRange.Enabled = true; - this.buttonPassRange.Enabled = true; - this.buttonOverRange.Enabled = true; - this.buttonTareRange.Enabled = true; + this.buttonUnderRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting; + this.buttonPassRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting; + this.buttonOverRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting; + this.buttonTareRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting; break; case Define.E_UserGroup.Admin: case Define.E_UserGroup.Developer: @@ -281,6 +282,12 @@ namespace ITC81DB_0H.Controls this.buttonOverRange.Enabled = true; this.buttonTareRange.Enabled = true; break; + case Define.E_UserGroup.NotLogin: + this.buttonUnderRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsMainDisplayWeightSetting; + this.buttonPassRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsMainDisplayWeightSetting; + this.buttonOverRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsMainDisplayWeightSetting; + this.buttonTareRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsMainDisplayWeightSetting; + break; default: this.buttonUnderRange.Enabled = false; this.buttonPassRange.Enabled = false; diff --git a/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStartGrapht.cs b/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStartGrapht.cs index e5b9cab..0912eab 100644 --- a/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStartGrapht.cs +++ b/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStartGrapht.cs @@ -12,6 +12,7 @@ using ITC81DB_0H.DialogForms; using ITC81DB_0H.Forms; using ITC81DB_2H_ImageDll; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { @@ -223,24 +224,30 @@ namespace ITC81DB_0H.Controls this.buttonOverRange.Enabled = false; break; case Define.E_UserGroup.Level1: - this.buttonUnderRange.Enabled = true; - this.buttonPassRange.Enabled = true; - this.buttonOverRange.Enabled = true; + this.buttonUnderRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting; + this.buttonPassRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting; + this.buttonOverRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting; break; case Define.E_UserGroup.Level2: - this.buttonUnderRange.Enabled = true; - this.buttonPassRange.Enabled = true; - this.buttonOverRange.Enabled = true; + this.buttonUnderRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting; + this.buttonPassRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting; + this.buttonOverRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting; break; case Define.E_UserGroup.Level3: + this.buttonUnderRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting; + this.buttonPassRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting; + this.buttonOverRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting; + break; + case Define.E_UserGroup.Admin: + case Define.E_UserGroup.Developer: this.buttonUnderRange.Enabled = true; this.buttonPassRange.Enabled = true; this.buttonOverRange.Enabled = true; break; - case Define.E_UserGroup.Admin: - this.buttonUnderRange.Enabled = true; - this.buttonPassRange.Enabled = true; - this.buttonOverRange.Enabled = true; + case Define.E_UserGroup.NotLogin: + this.buttonUnderRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsMainDisplayWeightSetting; + this.buttonPassRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsMainDisplayWeightSetting; + this.buttonOverRange.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.NotLogin.IsMainDisplayWeightSetting; break; default: this.buttonUnderRange.Enabled = false; diff --git a/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStopDataStatistics.cs b/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStopDataStatistics.cs index e0f5653..1b04723 100644 --- a/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStopDataStatistics.cs +++ b/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayStopDataStatistics.cs @@ -10,6 +10,7 @@ using System.Windows.Forms; using ITC81DB_0H.Forms; using ITC81DB_2H_ImageDll; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H.Controls { diff --git a/ITC81DB_0H/Datastore/DataStore.cs b/ITC81DB_0H/Datastore/DataStore.cs index fbbe845..900fe76 100644 --- a/ITC81DB_0H/Datastore/DataStore.cs +++ b/ITC81DB_0H/Datastore/DataStore.cs @@ -7,6 +7,7 @@ using System.Text; using InModbus; using ITC81DB_2H.Datastore; +using ITC81DB_0H.Part11_UserManager; namespace ITC81DB_0H { diff --git a/ITC81DB_0H/Datastore/Define.cs b/ITC81DB_0H/Datastore/Define.cs index b1ea3df..31ca2de 100644 --- a/ITC81DB_0H/Datastore/Define.cs +++ b/ITC81DB_0H/Datastore/Define.cs @@ -406,13 +406,25 @@ namespace ITC81DB_2H.Datastore Clear, BarcodeClear, CountClear, + + OPT1Using, + UserEditor, Update, - OPT1Using, Init_Main, Init_LCD, DataBackup, + Calibration, GroupEditor, + + ProductCopy, + ProductPaste, + ProductAllPaste, + + TryEthernetStart, + TryEthernetStop, + EthernetConnect, + EthernetDisconnect, } public enum E_TrackingParameter diff --git a/ITC81DB_0H/DialogForms/DialogFormLogOn.Designer.cs b/ITC81DB_0H/DialogForms/DialogFormLogOn.Designer.cs index ac9ec77..4bf85e6 100644 --- a/ITC81DB_0H/DialogForms/DialogFormLogOn.Designer.cs +++ b/ITC81DB_0H/DialogForms/DialogFormLogOn.Designer.cs @@ -32,12 +32,12 @@ this.smartForm1 = new SmartX.SmartForm(); this.textBoxPassword = new System.Windows.Forms.TextBox(); this.textBoxID = new System.Windows.Forms.TextBox(); - this.buttonLogon = new SmartX.SmartButton(); + this.buttonLogOn = new SmartX.SmartButton(); this.buttonCancel = new SmartX.SmartButton(); this.smartKeyboard = new SmartX.SmartKeyboard(); - this.labelTitlePassword = new SmartX.SmartLabel(); - this.labelTitleID = new SmartX.SmartLabel(); - this.labelTitle = new SmartX.SmartLabel(); + this.labelTitle3 = new SmartX.SmartLabel(); + this.labelTitle2 = new SmartX.SmartLabel(); + this.labelTitle1 = new SmartX.SmartLabel(); this.pictureBoxImage = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(this.smartForm1)).BeginInit(); this.SuspendLayout(); @@ -62,7 +62,7 @@ // this.textBoxPassword.Font = new System.Drawing.Font("Arial", 18F, System.Drawing.FontStyle.Regular); this.textBoxPassword.Location = new System.Drawing.Point(258, 124); - this.textBoxPassword.MaxLength = 10; + this.textBoxPassword.MaxLength = 20; this.textBoxPassword.Name = "textBoxPassword"; this.textBoxPassword.PasswordChar = '*'; this.textBoxPassword.Size = new System.Drawing.Size(248, 34); @@ -74,43 +74,43 @@ // this.textBoxID.Font = new System.Drawing.Font("Arial", 18F, System.Drawing.FontStyle.Regular); this.textBoxID.Location = new System.Drawing.Point(258, 79); - this.textBoxID.MaxLength = 10; + this.textBoxID.MaxLength = 20; this.textBoxID.Name = "textBoxID"; this.textBoxID.Size = new System.Drawing.Size(248, 34); this.textBoxID.TabIndex = 166; this.textBoxID.Text = "ABCDEFGHJK"; this.textBoxID.GotFocus += new System.EventHandler(this.textBoxID_GotFocus); // - // buttonLogon + // buttonLogOn // - this.buttonLogon.BackPictureBox = null; - this.buttonLogon.BackPictureBox1 = null; - this.buttonLogon.BackPictureBox2 = null; - this.buttonLogon.ButtonColor = System.Drawing.Color.LightGray; - this.buttonLogon.ButtonImageAutoSize = true; - this.buttonLogon.ColorKeySamplePosition = new System.Drawing.Point(0, 0); - this.buttonLogon.DisableImage = ((System.Drawing.Image)(resources.GetObject("buttonLogon.DisableImage"))); - this.buttonLogon.DownImage = ((System.Drawing.Image)(resources.GetObject("buttonLogon.DownImage"))); - this.buttonLogon.GroupID = 0; - this.buttonLogon.InitVisible = true; - this.buttonLogon.Location = new System.Drawing.Point(512, 79); - this.buttonLogon.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; - this.buttonLogon.Name = "buttonLogon"; - this.buttonLogon.NestedClickEventPrevent = false; - this.buttonLogon.OutlinePixel = 1; - this.buttonLogon.RepeatInterval = 200; - this.buttonLogon.RepeatIntervalAccelerate = null; - this.buttonLogon.SafeInterval = 200; - this.buttonLogon.Size = new System.Drawing.Size(75, 75); - this.buttonLogon.SpecialFunction = SmartX.SmartButton.SPECIALFUNC.NONE; - this.buttonLogon.TabIndex = 170; - this.buttonLogon.TextColor = System.Drawing.Color.Black; - this.buttonLogon.TextDownColor = System.Drawing.Color.White; - this.buttonLogon.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; - this.buttonLogon.TextLocation = new System.Drawing.Point(0, 0); - this.buttonLogon.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; - this.buttonLogon.UpImage = ((System.Drawing.Image)(resources.GetObject("buttonLogon.UpImage"))); - this.buttonLogon.Click += new System.EventHandler(this.buttonLogon_Click); + this.buttonLogOn.BackPictureBox = null; + this.buttonLogOn.BackPictureBox1 = null; + this.buttonLogOn.BackPictureBox2 = null; + this.buttonLogOn.ButtonColor = System.Drawing.Color.LightGray; + this.buttonLogOn.ButtonImageAutoSize = true; + this.buttonLogOn.ColorKeySamplePosition = new System.Drawing.Point(0, 0); + this.buttonLogOn.DisableImage = ((System.Drawing.Image)(resources.GetObject("buttonLogOn.DisableImage"))); + this.buttonLogOn.DownImage = ((System.Drawing.Image)(resources.GetObject("buttonLogOn.DownImage"))); + this.buttonLogOn.GroupID = 0; + this.buttonLogOn.InitVisible = true; + this.buttonLogOn.Location = new System.Drawing.Point(512, 79); + this.buttonLogOn.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; + this.buttonLogOn.Name = "buttonLogOn"; + this.buttonLogOn.NestedClickEventPrevent = false; + this.buttonLogOn.OutlinePixel = 1; + this.buttonLogOn.RepeatInterval = 200; + this.buttonLogOn.RepeatIntervalAccelerate = null; + this.buttonLogOn.SafeInterval = 200; + this.buttonLogOn.Size = new System.Drawing.Size(75, 75); + this.buttonLogOn.SpecialFunction = SmartX.SmartButton.SPECIALFUNC.NONE; + this.buttonLogOn.TabIndex = 170; + this.buttonLogOn.TextColor = System.Drawing.Color.Black; + this.buttonLogOn.TextDownColor = System.Drawing.Color.White; + this.buttonLogOn.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; + this.buttonLogOn.TextLocation = new System.Drawing.Point(0, 0); + this.buttonLogOn.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; + this.buttonLogOn.UpImage = ((System.Drawing.Image)(resources.GetObject("buttonLogOn.UpImage"))); + this.buttonLogOn.Click += new System.EventHandler(this.buttonLogOn_Click); // // buttonCancel // @@ -177,68 +177,68 @@ this.smartKeyboard.TopMargin = 5; this.smartKeyboard.OnXKeyClick += new System.EventHandler(this.smartKeyboard_OnXKeyClick); // - // labelTitlePassword + // labelTitle3 // - this.labelTitlePassword.BackColor = System.Drawing.Color.White; - this.labelTitlePassword.BackPictureBox = null; - this.labelTitlePassword.BackPictureBox1 = null; - this.labelTitlePassword.BackPictureBox2 = null; - this.labelTitlePassword.BorderColor = System.Drawing.Color.Black; - this.labelTitlePassword.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.labelTitlePassword.Font = new System.Drawing.Font("새굴림", 12F, System.Drawing.FontStyle.Bold); - this.labelTitlePassword.ForeColor = System.Drawing.Color.Gray; - this.labelTitlePassword.InitVisible = true; - this.labelTitlePassword.LineSpacing = 0F; - this.labelTitlePassword.Location = new System.Drawing.Point(132, 124); - this.labelTitlePassword.Name = "labelTitlePassword"; - this.labelTitlePassword.Size = new System.Drawing.Size(120, 34); - this.labelTitlePassword.TabIndex = 181; - this.labelTitlePassword.Text = "비밀번호"; - this.labelTitlePassword.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; - this.labelTitlePassword.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; - this.labelTitlePassword.Wordwrap = false; + this.labelTitle3.BackColor = System.Drawing.Color.White; + this.labelTitle3.BackPictureBox = null; + this.labelTitle3.BackPictureBox1 = null; + this.labelTitle3.BackPictureBox2 = null; + this.labelTitle3.BorderColor = System.Drawing.Color.Black; + this.labelTitle3.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.labelTitle3.Font = new System.Drawing.Font("새굴림", 12F, System.Drawing.FontStyle.Bold); + this.labelTitle3.ForeColor = System.Drawing.Color.Gray; + this.labelTitle3.InitVisible = true; + this.labelTitle3.LineSpacing = 0F; + this.labelTitle3.Location = new System.Drawing.Point(132, 124); + this.labelTitle3.Name = "labelTitle3"; + this.labelTitle3.Size = new System.Drawing.Size(120, 34); + this.labelTitle3.TabIndex = 181; + this.labelTitle3.Text = "비밀번호"; + this.labelTitle3.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelTitle3.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelTitle3.Wordwrap = false; // - // labelTitleID + // labelTitle2 // - this.labelTitleID.BackColor = System.Drawing.Color.White; - this.labelTitleID.BackPictureBox = null; - this.labelTitleID.BackPictureBox1 = null; - this.labelTitleID.BackPictureBox2 = null; - this.labelTitleID.BorderColor = System.Drawing.Color.Black; - this.labelTitleID.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.labelTitleID.Font = new System.Drawing.Font("새굴림", 12F, System.Drawing.FontStyle.Bold); - this.labelTitleID.ForeColor = System.Drawing.Color.Gray; - this.labelTitleID.InitVisible = true; - this.labelTitleID.LineSpacing = 0F; - this.labelTitleID.Location = new System.Drawing.Point(132, 79); - this.labelTitleID.Name = "labelTitleID"; - this.labelTitleID.Size = new System.Drawing.Size(120, 34); - this.labelTitleID.TabIndex = 180; - this.labelTitleID.Text = "ID"; - this.labelTitleID.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; - this.labelTitleID.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; - this.labelTitleID.Wordwrap = false; + this.labelTitle2.BackColor = System.Drawing.Color.White; + this.labelTitle2.BackPictureBox = null; + this.labelTitle2.BackPictureBox1 = null; + this.labelTitle2.BackPictureBox2 = null; + this.labelTitle2.BorderColor = System.Drawing.Color.Black; + this.labelTitle2.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.labelTitle2.Font = new System.Drawing.Font("새굴림", 12F, System.Drawing.FontStyle.Bold); + this.labelTitle2.ForeColor = System.Drawing.Color.Gray; + this.labelTitle2.InitVisible = true; + this.labelTitle2.LineSpacing = 0F; + this.labelTitle2.Location = new System.Drawing.Point(132, 79); + this.labelTitle2.Name = "labelTitle2"; + this.labelTitle2.Size = new System.Drawing.Size(120, 34); + this.labelTitle2.TabIndex = 180; + this.labelTitle2.Text = "ID"; + this.labelTitle2.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelTitle2.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelTitle2.Wordwrap = false; // - // labelTitle + // labelTitle1 // - this.labelTitle.BackColor = System.Drawing.Color.White; - this.labelTitle.BackPictureBox = null; - this.labelTitle.BackPictureBox1 = null; - this.labelTitle.BackPictureBox2 = null; - this.labelTitle.BorderColor = System.Drawing.Color.Black; - this.labelTitle.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.labelTitle.Font = new System.Drawing.Font("새굴림", 20F, System.Drawing.FontStyle.Bold); - this.labelTitle.ForeColor = System.Drawing.Color.Gray; - this.labelTitle.InitVisible = true; - this.labelTitle.LineSpacing = 0F; - this.labelTitle.Location = new System.Drawing.Point(122, 23); - this.labelTitle.Name = "labelTitle"; - this.labelTitle.Size = new System.Drawing.Size(546, 50); - this.labelTitle.TabIndex = 179; - this.labelTitle.Text = "로그인"; - this.labelTitle.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; - this.labelTitle.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; - this.labelTitle.Wordwrap = false; + this.labelTitle1.BackColor = System.Drawing.Color.White; + this.labelTitle1.BackPictureBox = null; + this.labelTitle1.BackPictureBox1 = null; + this.labelTitle1.BackPictureBox2 = null; + this.labelTitle1.BorderColor = System.Drawing.Color.Black; + this.labelTitle1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.labelTitle1.Font = new System.Drawing.Font("새굴림", 20F, System.Drawing.FontStyle.Bold); + this.labelTitle1.ForeColor = System.Drawing.Color.Gray; + this.labelTitle1.InitVisible = true; + this.labelTitle1.LineSpacing = 0F; + this.labelTitle1.Location = new System.Drawing.Point(122, 23); + this.labelTitle1.Name = "labelTitle1"; + this.labelTitle1.Size = new System.Drawing.Size(546, 50); + this.labelTitle1.TabIndex = 179; + this.labelTitle1.Text = "로그인"; + this.labelTitle1.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelTitle1.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelTitle1.Wordwrap = false; // // pictureBoxImage // @@ -253,13 +253,13 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(712, 471); this.ControlBox = false; - this.Controls.Add(this.labelTitlePassword); - this.Controls.Add(this.labelTitleID); - this.Controls.Add(this.labelTitle); + this.Controls.Add(this.labelTitle3); + this.Controls.Add(this.labelTitle2); + this.Controls.Add(this.labelTitle1); this.Controls.Add(this.pictureBoxImage); this.Controls.Add(this.smartKeyboard); this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonLogon); + this.Controls.Add(this.buttonLogOn); this.Controls.Add(this.textBoxPassword); this.Controls.Add(this.textBoxID); this.Controls.Add(this.smartForm1); @@ -276,12 +276,12 @@ private SmartX.SmartForm smartForm1; private System.Windows.Forms.TextBox textBoxPassword; private System.Windows.Forms.TextBox textBoxID; - private SmartX.SmartButton buttonLogon; + private SmartX.SmartButton buttonLogOn; private SmartX.SmartButton buttonCancel; private SmartX.SmartKeyboard smartKeyboard; - private SmartX.SmartLabel labelTitlePassword; - private SmartX.SmartLabel labelTitleID; - private SmartX.SmartLabel labelTitle; + private SmartX.SmartLabel labelTitle3; + private SmartX.SmartLabel labelTitle2; + private SmartX.SmartLabel labelTitle1; private System.Windows.Forms.PictureBox pictureBoxImage; } } \ No newline at end of file diff --git a/ITC81DB_0H/DialogForms/DialogFormLogOn.cs b/ITC81DB_0H/DialogForms/DialogFormLogOn.cs index 3490eea..ab3553f 100644 --- a/ITC81DB_0H/DialogForms/DialogFormLogOn.cs +++ b/ITC81DB_0H/DialogForms/DialogFormLogOn.cs @@ -18,40 +18,35 @@ namespace ITC81DB_0H.DialogForms public partial class DialogFormLogOn : Form { #region Field - private bool IsPart11; - - // false : 패스워드 변경, true : 로그인 - private bool IsLogin; - private string ID; - private string Password; - - UserManager.UserMgr_user_info_t UserInfo = new UserManager.UserMgr_user_info_t(); - private FormMain m_ParentForm; + private bool IsLoginMode; + private bool IsChangePassword; #endregion #region Constructor - public DialogFormLogOn(FormMain parent, Define.E_LanguageID language, bool isPart11) + public DialogFormLogOn(FormMain parent, bool login, bool changePass) { InitializeComponent(); this.ParentForm = parent; - this.IsPart11 = isPart11; - this.IsLogin = true; + this.IsLoginMode = login; + this.IsChangePassword = changePass; - this.InitializeDesignLogOn(language); - this.DefaultSettingLogOn(); - } - public DialogFormLogOn(FormMain parent, Define.E_LanguageID language, string id) - { - InitializeComponent(); + if (this.IsChangePassword == false) + { + this.InitializeDesignForLogin(); - this.ParentForm = parent; - this.ID = id; - this.IsLogin = false; + this.textBoxID.PasswordChar = default(char); + } + else + { + this.InitializeDesignForChangePassword(); - this.InitializeDesignChangePassword(language); - this.DefaultSettingChangePassword(); + this.textBoxID.PasswordChar = '*'; + } + + this.InitializeControl(); + this.DefaultSetting(); } #endregion @@ -64,361 +59,388 @@ namespace ITC81DB_0H.DialogForms #endregion #region Method - public void InitializeDesignLogOn(Define.E_LanguageID language) + private void InitializeDesignForLogin() { Class1 images = new Class1(); - this.pictureBoxImage.Image = new Bitmap(images.GetImage(Class1.ButtonImages.LoginImage1)); - - if (language == Define.E_LanguageID.English) + if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.English) { - this.labelTitle.Text = "User Login"; - this.labelTitleID.Text = "ID"; - this.labelTitlePassword.Text = "Password"; + this.labelTitle1.Text = "User Login"; + this.labelTitle2.Text = "ID"; + this.labelTitle3.Text = "Password"; + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginUp)); this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable)); this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown)); this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp)); - this.buttonLogon.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDisable)); - this.buttonLogon.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDown)); - this.buttonLogon.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginUp)); } - else if (language == Define.E_LanguageID.German) + else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese) { - this.labelTitle.Text = "Einloggen"; - this.labelTitleID.Text = "ID"; - this.labelTitlePassword.Text = "Passwort"; + this.labelTitle1.Text = "用户登录"; + this.labelTitle2.Text = "ID"; + this.labelTitle3.Text = "密码"; - this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginCancelDisable)); - this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginCancelDown)); - this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginCancelUp)); - this.buttonLogon.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginDisable)); - this.buttonLogon.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginDown)); - this.buttonLogon.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginUp)); + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginLoginDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginLoginDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginLoginUp)); + this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelDisable)); + this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelDown)); + this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelUp)); + } + else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German) + { + this.labelTitle1.Text = "Einloggen"; + this.labelTitle2.Text = "ID"; + this.labelTitle3.Text = "Passwort"; + + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginUp)); + this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable)); + this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown)); + this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp)); } else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Spanish) { - this.labelTitle.Text = "Acceso"; - this.labelTitleID.Text = "ID"; - this.labelTitlePassword.Text = "Clave"; + this.labelTitle1.Text = "Acceso"; + this.labelTitle2.Text = "ID"; + this.labelTitle3.Text = "Clave"; + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginUp)); this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable)); this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown)); this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp)); - this.buttonLogon.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDisable)); - this.buttonLogon.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginDown)); - this.buttonLogon.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginUp)); } else { - this.labelTitle.Text = "로그인"; - this.labelTitleID.Text = "ID"; - this.labelTitlePassword.Text = "비밀번호"; + this.labelTitle1.Text = "로그인"; + this.labelTitle2.Text = "ID"; + this.labelTitle3.Text = "비밀번호"; + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginUp)); this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelDisable)); this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelDown)); this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelUp)); - this.buttonLogon.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginDisable)); - this.buttonLogon.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginDown)); - this.buttonLogon.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginUp)); } } - private void DefaultSettingLogOn() - { - this.textBoxID.Text = ""; - this.textBoxPassword.Text = ""; - - this.Location = new Point(0, 65); - - this.smartKeyboard.KeyboardType = SmartX.SmartKeyboard.KEYBOARDTYPES.NORMAL; - this.smartKeyboard.Show(); - } - private void Login() - { - // Check ID - if (this.textBoxID.Text.Length < 6) - { - // ID : 6~20자 입력하세요 - DialogFormMessage msg = new DialogFormMessage(null, 3, this.ParentForm.SystemConfig1.Language); - msg.ShowDialog(); - - return; - } - // Check Password - if (this.textBoxPassword.Text.Length < 6) - { - // PASSWORD : 6~20자 입력하세요 - DialogFormMessage msg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig1.Language); - msg.ShowDialog(); - - return; - } - - UserManager.UserManager_UserLoginDirect(this.textBoxID.Text, this.textBoxPassword.Text, ref this.UserInfo); - - if (this.UserInfo.status == 0) - { - #region 로그인 성공 - try - { - string sValue = ""; - - this.SuccessLogin(this.UserInfo); - - sValue = this.ParentForm.ChildFormMainDisplay.DisplayExpireOfPassword(this.ParentForm.CurrentSystemStatus.CurrentUser.Group); - if (sValue != "-") - { - int intExpireDate = int.Parse(sValue); - if (intExpireDate >= -10) - { - int extract = int.Parse(Regex.Replace(sValue, @"\D", "")); - DialogFormYesNo df = new DialogFormYesNo(this.ParentForm.SystemConfig1.Language, 2, extract.ToString()); - df.BringToFront(); - if (df.ShowDialog() == DialogResult.Yes) - { - DialogFormLogOn changePW = new DialogFormLogOn(this.ParentForm, this.ParentForm.SystemConfig1.Language, this.textBoxID.Text); - if (changePW.ShowDialog() == DialogResult.OK) - { - UserManager.UserManager_UserLockRelease(this.textBoxID.Text, false, true); - UserManager.UserManager_UserLoginDirect(this.textBoxID.Text, this.ParentForm.CurrentSystemStatus.CurrentUser.Password, ref this.UserInfo); - - //this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.LogOut; - this.SuccessLogin(this.UserInfo); - } - } - } - } - } - catch (Exception ex) - { - FormMain.Exception(ex); - - this.DialogResult = DialogResult.Cancel; - this.Close(); - } - - this.DialogResult = DialogResult.OK; - this.Close(); - #endregion - } - else - { - if (this.UserInfo.status == 15) // USER_MGR_STATUS_PW_PASSWORD_LOCK - { - this.Close(); - - DialogFormLogOn changePW = new DialogFormLogOn(this.ParentForm, this.ParentForm.SystemConfig1.Language, this.textBoxID.Text); - if (changePW.ShowDialog() == DialogResult.OK) - { - UserManager.UserManager_UserLoginDirect(this.textBoxID.Text, this.ParentForm.CurrentSystemStatus.CurrentUser.Password, ref this.UserInfo); - - this.SuccessLogin(this.UserInfo); - } - } - else - { - DialogFormMessage myMsg = new DialogFormMessage(null, this.UserInfo.status, this.ParentForm.SystemConfig1.Language); - myMsg.ShowDialog(); - } - } - } - private void SuccessLogin(UserManager.UserMgr_user_info_t user) - { - if (user.active_level == 1) - this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level1; - else if (user.active_level == 2) - this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level2; - else if (user.active_level == 3) - this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level3; - else if (user.active_level == 9) - this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Admin; - else if (user.active_level == 10) - this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Developer; - this.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel = user.active_level; - - this.ParentForm.CurrentSystemStatus.CurrentUser.ID = user.user_id; - this.ParentForm.CurrentSystemStatus.CurrentUser.Password = user.user_pw; - - this.ParentForm.CurrentSystemStatus.CurrentUser.ExpireAccount = user.expire_period_account; - this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword = user.expire_period_pw; - - DateTime time = DateTime.ParseExact(user.register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.ParentForm.CurrentSystemStatus.CurrentUser.DateRegister = time; - time = DateTime.ParseExact(user.login_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.ParentForm.CurrentSystemStatus.CurrentUser.DateLogin = time; - - if (this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Admin - || this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Developer) - { - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireRegister = DateTime.Now; - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireLogin = DateTime.Now; - } - else - { - time = DateTime.ParseExact(user.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireLogin = time; - time = DateTime.ParseExact(user.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireRegister = time; - } - - this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockAccount = user.flock_status_account == 0 ? false : true; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockPassword = user.flock_status_password == 0 ? false : true; - - if (this.ParentForm.SystemConfig3.IsPart11 == true) - this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = user.fadmin == 0 ? false : true; - else - this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = true; - } - - public void InitializeDesignChangePassword(Define.E_LanguageID language) + private void InitializeDesignForChangePassword() { Class1 images = new Class1(); - this.pictureBoxImage.Image = new Bitmap(images.GetImage(Class1.ButtonImages.LoginImage2)); - - if (language == Define.E_LanguageID.English) + if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.English) { - this.labelTitle.Text = "Change Password"; - this.labelTitleID.Text = "New"; - this.labelTitlePassword.Text = "Verify"; + this.labelTitle1.Text = "Change Password"; + this.labelTitle2.Text = "New"; + this.labelTitle3.Text = "Verify"; + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeUp)); this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable)); this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown)); this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp)); - this.buttonLogon.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDisable)); - this.buttonLogon.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDown)); - this.buttonLogon.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeUp)); } - else if (language == Define.E_LanguageID.German) + else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese) { - this.labelTitle.Text = "Kennwort ändern"; - this.labelTitleID.Text = "Neu"; - this.labelTitlePassword.Text = "Verifizieren"; + this.labelTitle1.Text = "更改密码"; + this.labelTitle2.Text = "新密码"; + this.labelTitle3.Text = "验证密码"; - this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginCancelDisable)); - this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginCancelDown)); - this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginCancelUp)); - this.buttonLogon.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginChangeDisable)); - this.buttonLogon.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginChangeDown)); - this.buttonLogon.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerFormMainLoginChangeUp)); + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginChangeDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginChangeDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginChangeUp)); + this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelDisable)); + this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelDown)); + this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnMainLoginCancelUp)); } - else if (language == Define.E_LanguageID.Spanish) + else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German) { - this.labelTitle.Text = "Cambiar la contraseña"; - this.labelTitleID.Text = "Nuevo"; - this.labelTitlePassword.Text = "Verificar"; + this.labelTitle1.Text = "Kennwort ändern"; + this.labelTitle2.Text = "Neu"; + this.labelTitle3.Text = "Verifizieren"; + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeUp)); + this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable)); + this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown)); + this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp)); + } + else if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Spanish) + { + this.labelTitle1.Text = "Cambiar la contraseña"; + this.labelTitle2.Text = "Nuevo"; + this.labelTitle3.Text = "Verificar"; + + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeUp)); this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDisable)); this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelDown)); this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginCancelUp)); - this.buttonLogon.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDisable)); - this.buttonLogon.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeDown)); - this.buttonLogon.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMainLoginChangeUp)); } else { - this.labelTitle.Text = "비밀번호 변경"; - this.labelTitleID.Text = "새 비밀번호"; - this.labelTitlePassword.Text = "비밀번호 확인"; + this.labelTitle1.Text = "비밀번호 변경"; + this.labelTitle2.Text = "새 비밀번호"; + this.labelTitle3.Text = "비밀번호 확인"; + this.buttonLogOn.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeDisable)); + this.buttonLogOn.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeDown)); + this.buttonLogOn.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeUp)); this.buttonCancel.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelDisable)); this.buttonCancel.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelDown)); this.buttonCancel.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginCancelUp)); - this.buttonLogon.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeDisable)); - this.buttonLogon.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeDown)); - this.buttonLogon.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMainLoginChangeUp)); } } - private void DefaultSettingChangePassword() + private void InitializeControl() { - this.Location = new Point(0, 65); + int x = 0, y = 0; + + x = Screen.PrimaryScreen.Bounds.Width / 2 - this.Size.Width / 2; + y = Screen.PrimaryScreen.Bounds.Height / 2 - this.Size.Height / 2; + + this.Location = new Point(x, y); + this.Size = new Size(710, 470); this.textBoxID.Text = ""; this.textBoxPassword.Text = ""; - this.textBoxID.PasswordChar = '*'; - this.textBoxPassword.PasswordChar = '*'; - + //this.smartKeyboard.HanYoungKeyToggle(); + this.smartKeyboard.HanYoungKeyDisable = true; this.smartKeyboard.KeyboardType = SmartX.SmartKeyboard.KEYBOARDTYPES.NORMAL; this.smartKeyboard.Show(); } - private void SaveChangePassword() + private void DefaultSetting() { - string detail = ""; - // Check Password - if (this.textBoxPassword.Text.Length < 6) + } + + private void LogOn() + { + UserManager.UserMgr_user_info_t userInfo = new UserManager.UserMgr_user_info_t(); + + if (this.textBoxID.Text == "") { - // PASSWORD : 6~20자 입력하세요 - DialogFormMessage msg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig1.Language); - msg.ShowDialog(); + // ID : 6~20자 입력 하세요 + DialogFormMessage myMsg = new DialogFormMessage(null, 3, this.ParentForm.SystemConfig1.Language); + myMsg.ShowDialog(); + + return; + } + if (this.textBoxPassword.Text == "") + { + // PASSWORD : 6~20자 입력 하세요 + DialogFormMessage myMsg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig1.Language); + myMsg.ShowDialog(); return; } - try + UserManager.UserManager_UserLoginDirect(this.textBoxID.Text, this.textBoxPassword.Text, ref userInfo); + + if (userInfo.status == 0 && userInfo.fFirstPW == 0) { - if (this.textBoxID.Text != this.textBoxPassword.Text) + //MessageBox.Show("로그인 성공"); + + #region 로그인 성공 + if (userInfo.active_level == 1) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level1; + else if (userInfo.active_level == 2) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level2; + else if (userInfo.active_level == 3) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level3; + else if (userInfo.active_level == 9) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Admin; + else if (userInfo.active_level == 10) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Developer; + + this.ParentForm.CurrentSystemStatus.CurrentUser.ID = userInfo.user_id; + this.ParentForm.CurrentSystemStatus.CurrentUser.Password = userInfo.user_pw; + + this.ParentForm.CurrentSystemStatus.CurrentUser.ExpireId = userInfo.id_expire_period; + this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword = userInfo.password_expire_period; + + DateTime time = DateTime.ParseExact(userInfo.password_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordRegister = time; + time = DateTime.ParseExact(userInfo.id_login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdLogin = time; + time = DateTime.ParseExact(userInfo.id_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdExpire = time; + time = DateTime.ParseExact(userInfo.password_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire = time; + + this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockAccount = userInfo.id_flock_status == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockPassword = userInfo.password_flock_status == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel = userInfo.active_level; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsFirstPassword = userInfo.fFirstPW; + #endregion + + this.DialogResult = DialogResult.OK; + this.Close(); + } + else if (userInfo.fFirstPW == 1) + { + // 최초 로그인 시 비밀번호 변경 + this.ParentForm.ChildFormMainDisplay.ChangeID = this.textBoxID.Text; + this.DialogResult = DialogResult.Abort; + this.Close(); + } + else + { + DialogFormMessage myMsg = new DialogFormMessage(null, userInfo.status, this.ParentForm.SystemConfig1.Language); + myMsg.ShowDialog(); + + // 비밀번호 만료 시 + if (userInfo.status == 15) { - // 비밀번호가 동일하지 않습니다 - DialogFormMessage myMsg = new DialogFormMessage(null, 17, this.ParentForm.SystemConfig1.Language); - myMsg.ShowDialog(); + this.ParentForm.ChildFormMainDisplay.ChangeID = this.textBoxID.Text; + this.DialogResult = DialogResult.Abort; + this.Close(); } - else + } + } + private void ChangePassword() + { + int ret = 0; + string id = "", pass = ""; + UserManager.UserMgr_user_info_t userInfo = new UserManager.UserMgr_user_info_t(); + + if (this.textBoxID.Text == "") + { + // New Password : 6~20자 입력 하세요 + DialogFormMessage myMsg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig1.Language); + myMsg.ShowDialog(); + + return; + } + if (this.textBoxPassword.Text == "") + { + // New Password Confirmation : 6~20자 입력 하세요 + DialogFormMessage myMsg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig1.Language); + myMsg.ShowDialog(); + + return; + } + if (this.textBoxID.Text.Equals(this.textBoxPassword.Text) == false) + { + // 비밀번호를 확인하세요 + DialogFormMessage myMsg = new DialogFormMessage(null, 14, this.ParentForm.SystemConfig1.Language); + myMsg.ShowDialog(); + + return; + } + + if (this.IsLoginMode == true) + { + id = this.ParentForm.CurrentSystemStatus.CurrentUser.ID; + pass = this.textBoxID.Text; + + //Console.WriteLine(string.Format("UserManager_UserModifyPW : {0}, {1}", id, pass)); + ret = UserManager.UserManager_UserModifyPWDirect(id, pass); + } + else + { + id = this.ParentForm.ChildFormMainDisplay.ChangeID; + pass = this.textBoxID.Text; + + //Console.WriteLine(string.Format("UserManager_UserModifyPW : {0}, {1}", id, pass)); + ret = UserManager.UserManager_UserModifyPWDirect(id, pass); + } + + // 비밀번호 변경이 완료 되면 로그인 시도 + if (ret == 0) + { + UserManager.UserManager_UserLoginDirect(id, pass, ref userInfo); + + if (userInfo.status == 0) { - UserManager.UserManager_UserModifyPW(this.ID, this.textBoxPassword.Text); - this.ParentForm.CurrentSystemStatus.CurrentUser.Password = this.textBoxPassword.Text; + //MessageBox.Show("로그인 성공"); + + #region 로그인 성공 + if (userInfo.active_level == 1) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level1; + else if (userInfo.active_level == 2) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level2; + else if (userInfo.active_level == 3) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level3; + else if (userInfo.active_level == 9) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Admin; + else if (userInfo.active_level == 10) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Developer; + + this.ParentForm.CurrentSystemStatus.CurrentUser.ID = userInfo.user_id; + this.ParentForm.CurrentSystemStatus.CurrentUser.Password = userInfo.user_pw; + + this.ParentForm.CurrentSystemStatus.CurrentUser.ExpireId = userInfo.id_expire_period; + this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword = userInfo.password_expire_period; + + DateTime time = DateTime.ParseExact(userInfo.password_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordRegister = time; + time = DateTime.ParseExact(userInfo.id_login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdLogin = time; + time = DateTime.ParseExact(userInfo.id_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdExpire = time; + time = DateTime.ParseExact(userInfo.password_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire = time; + + this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockAccount = userInfo.id_flock_status == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockPassword = userInfo.password_flock_status == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel = userInfo.active_level; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsFirstPassword = userInfo.fFirstPW; + #endregion this.DialogResult = DialogResult.OK; this.Close(); } + else + { + DialogFormMessage myMsg = new DialogFormMessage(null, ret, this.ParentForm.SystemConfig1.Language); + myMsg.ShowDialog(); + } } - catch + else { - this.DialogResult = DialogResult.Cancel; - this.Close(); + // 비밀번호 변경 실패 시 메시지?? + DialogFormMessage myMsg = new DialogFormMessage(null, ret, this.ParentForm.SystemConfig1.Language); + myMsg.ShowDialog(); } } #endregion #region Event Handler - private void buttonLogon_Click(object sender, EventArgs e) + private void buttonLogOn_Click(object sender, EventArgs e) { // Automatic Logout Reset - if (this.IsPart11 == true) - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); + this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); - if (this.IsLogin == true) - this.Login(); + if (this.IsChangePassword == false) + this.LogOn(); else - this.SaveChangePassword(); + this.ChangePassword(); } private void buttonCancel_Click(object sender, EventArgs e) { - // Automatic Logout Reset - if (this.IsPart11 == true) - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); - this.DialogResult = DialogResult.Cancel; this.Close(); } private void textBoxID_GotFocus(object sender, EventArgs e) { - // Automatic Logout Reset - if (this.IsPart11 == true) - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); - this.smartKeyboard.TargetInputObject = this.textBoxID; this.textBoxID.Select(this.textBoxID.Text.Length, 0); } private void textBoxPassword_GotFocus(object sender, EventArgs e) { - // Automatic Logout Reset - if (this.IsPart11 == true) - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); - this.smartKeyboard.TargetInputObject = this.textBoxPassword; this.textBoxPassword.Select(this.textBoxPassword.Text.Length, 0); @@ -426,57 +448,8 @@ namespace ITC81DB_0H.DialogForms private void smartKeyboard_OnXKeyClick(object sender, EventArgs e) { - //this.smartKeyboard.Show(); - } - private void smartKeyboard_Click(object sender, EventArgs e) - { - // Automatic Logout Reset - if (this.IsPart11 == true) - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); + this.smartKeyboard.Show(); } #endregion - - private void smartButton1_Click(object sender, EventArgs e) - { - // Automatic Logout Reset - if (this.IsPart11 == true) - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); - - this.textBoxID.Text = "admin00"; - this.textBoxPassword.Text = "admin12!"; - - if (this.IsLogin == true) - this.Login(); - else - this.SaveChangePassword(); - } - private void smartButton2_Click(object sender, EventArgs e) - { - // Automatic Logout Reset - if (this.IsPart11 == true) - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); - - this.textBoxID.Text = "honggd"; - this.textBoxPassword.Text = "hong1278@"; - - if (this.IsLogin == true) - this.Login(); - else - this.SaveChangePassword(); - } - private void smartButton3_Click(object sender, EventArgs e) - { - // Automatic Logout Reset - if (this.IsPart11 == true) - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); - - this.textBoxID.Text = "chocjy"; - this.textBoxPassword.Text = "cho1266@"; - - if (this.IsLogin == true) - this.Login(); - else - this.SaveChangePassword(); - } } } \ No newline at end of file diff --git a/ITC81DB_0H/DialogForms/DialogFormLogOn.resx b/ITC81DB_0H/DialogForms/DialogFormLogOn.resx index 020cb84..d83cd1e 100644 --- a/ITC81DB_0H/DialogForms/DialogFormLogOn.resx +++ b/ITC81DB_0H/DialogForms/DialogFormLogOn.resx @@ -291,7 +291,7 @@ AAD8gmEMAADnf6f8Ly6HDFdPVTXqAAAAAElFTkSuQmCC - + iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp @@ -390,7 +390,7 @@ 5fwR+R+1E4HZ5iT/aAAAAABJRU5ErkJggg== - + iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp @@ -505,7 +505,7 @@ WuM/U89GVOSfyP8BdoPWvU1dpd0AAAAASUVORK5CYII= - + iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp diff --git a/ITC81DB_0H/DialogForms/DialogFormYesNo.cs b/ITC81DB_0H/DialogForms/DialogFormYesNo.cs index d6bb31d..1d7dcd3 100644 --- a/ITC81DB_0H/DialogForms/DialogFormYesNo.cs +++ b/ITC81DB_0H/DialogForms/DialogFormYesNo.cs @@ -92,12 +92,12 @@ namespace ITC81DB_0H.DialogForms this.labelMessage1.Text = "유저 삭제 하시겠습니까?"; break; case 15: - this.labelErrorCode.Text = "로그인"; - this.labelMessage1.Text = "로그인 기능을 사용하시겠습니까?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "해당 기능을 사용하시겠습니까?"; break; case 16: - this.labelErrorCode.Text = "로그인"; - this.labelMessage1.Text = "로그인 기능을 사용을 중지하시겠습니까?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "해당 기능을 사용을 중지하시겠습니까?"; break; case 17: this.labelErrorCode.Text = "바코드"; @@ -217,12 +217,12 @@ namespace ITC81DB_0H.DialogForms this.labelMessage1.Text = "Do you want to delete this user?"; break; case 15: - this.labelErrorCode.Text = "Login"; - this.labelMessage1.Text = "Are you sure you want to use the login function?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "Would you like to use that feature?"; break; case 16: - this.labelErrorCode.Text = "Login"; - this.labelMessage1.Text = "Are you sure you want to cancel the login function?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "Would you like to stop using that function?"; break; case 17: this.labelErrorCode.Text = "Barcode"; @@ -342,12 +342,12 @@ namespace ITC81DB_0H.DialogForms this.labelMessage1.Text = "是否删除用户?"; break; case 15: - this.labelErrorCode.Text = "登錄"; - this.labelMessage1.Text = "您确定使用登录功能?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "您想使用该功能吗?"; break; case 16: - this.labelErrorCode.Text = "登錄"; - this.labelMessage1.Text = "您确定中断使用登录功能?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "您确定要停止使用该功能吗?"; break; case 17: this.labelErrorCode.Text = "条形码"; @@ -470,12 +470,13 @@ namespace ITC81DB_0H.DialogForms this.labelMessage1.Text = "Удалить пользователя?"; break; case 15: - this.labelErrorCode.Text = "Логин"; - this.labelMessage1.Text = "Использовать функцию входа?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "Хотели бы вы использовать эту функцию?"; break; case 16: - this.labelErrorCode.Text = "Логин"; - this.labelMessage1.Text = "Отменить функцию входа?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "Вы уверены, что хотите прекратить "; + this.labelMessage2.Text = "использование этой функции?"; break; case 17: this.labelErrorCode.Text = "Штрих-код"; @@ -597,12 +598,12 @@ namespace ITC81DB_0H.DialogForms this.labelMessage1.Text = "Möchten Sie diesen Benutzer wirklich löschen?"; break; case 15: - this.labelErrorCode.Text = "Einloggen"; - this.labelMessage1.Text = "Möchten Sie die Anmeldefunktion wirklich aktivieren?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "Möchten Sie diese Funktion nutzen?"; break; case 16: - this.labelErrorCode.Text = "Einloggen"; - this.labelMessage1.Text = "Möchten Sie die Anmeldefunktion wirklich deaktivieren?"; + this.labelErrorCode.Text = ""; + this.labelMessage1.Text = "Möchten Sie diese Funktion wirklich nicht mehr verwenden?"; break; case 17: this.labelErrorCode.Text = "Barcode"; diff --git a/ITC81DB_0H/Forms/FormMain.cs b/ITC81DB_0H/Forms/FormMain.cs index c711c47..65d2ffd 100644 --- a/ITC81DB_0H/Forms/FormMain.cs +++ b/ITC81DB_0H/Forms/FormMain.cs @@ -24,8 +24,8 @@ namespace ITC81DB_0H.Forms public partial class FormMain : Form { #region Field - public static string DisplayVersion = "3.1.0"; - public static string ReleaseDate = "2023.7.21"; + public static string DisplayVersion = "3.1.1"; + public static string ReleaseDate = "2023.9.12"; private SmartSplash SmartSplashProgramLoad; public bool IsCommunicationLogOpen; @@ -7544,6 +7544,7 @@ namespace ITC81DB_0H.Forms this.DelegateUISeverStatus(true); this.DelegateTextStatusOut(">Connected Server"); + this.SetTrackingHistoryData(Define.E_TrackingOperation.EthernetConnect, "Client"); this.IsEthernetThreadStop = false; @@ -7580,6 +7581,7 @@ namespace ITC81DB_0H.Forms if (null == strRecvMsg) { this.DelegateTextStatusOut(">Server Out"); + this.SetTrackingHistoryData(Define.E_TrackingOperation.EthernetDisconnect, "Client"); this.IsEthernetThreadStop = true; break; } @@ -7596,6 +7598,7 @@ namespace ITC81DB_0H.Forms this.IsEthernetThreadStop = true; this.DelegateUISeverStatus(false); this.DelegateTextStatusOut(">Disconnected Server"); + this.SetTrackingHistoryData(Define.E_TrackingOperation.EthernetDisconnect, "Client"); if (null != this.EthernetStmReader) this.EthernetStmReader.Close(); @@ -11176,8 +11179,13 @@ namespace ITC81DB_0H.Forms { case 0: #region Level1 - structItem.IsBasicDataStatistics = true; - structItem.IsBasicProduct = true; + structItem.IsMainDisplayWeightSetting = false; + structItem.IsMainDisplaySubMenu = false; + structItem.IsMainDisplayClear = false; + structItem.IsMainDisplayProductNo = true; + + structItem.IsBasicDataStatistics = false; + structItem.IsBasicProduct = false; structItem.IsBasicTime = false; structItem.IsConfiSerial = false; @@ -11200,11 +11208,6 @@ namespace ITC81DB_0H.Forms structItem.IsSystemJudgmentSetting = true; structItem.IsSystemSorterSetting = true; - structItem.IsMainDisplayWeightSetting = true; - structItem.IsMainDisplaySubMenu = false; - structItem.IsMainDisplayClear = true; - structItem.IsMainDisplayProductNo = true; - structItem.IsLogJudge = true; structItem.IsLogHistory = true; structItem.IsLogOthers = true; @@ -11230,9 +11233,14 @@ namespace ITC81DB_0H.Forms break; case 1: #region Level2 + structItem.IsMainDisplayWeightSetting = true; + structItem.IsMainDisplaySubMenu = true; + structItem.IsMainDisplayClear = true; + structItem.IsMainDisplayProductNo = true; + structItem.IsBasicDataStatistics = true; structItem.IsBasicProduct = true; - structItem.IsBasicTime = false; + structItem.IsBasicTime = true; structItem.IsConfiSerial = false; structItem.IsConfiEthernet = false; @@ -11254,11 +11262,6 @@ namespace ITC81DB_0H.Forms structItem.IsSystemJudgmentSetting = true; structItem.IsSystemSorterSetting = true; - structItem.IsMainDisplayWeightSetting = true; - structItem.IsMainDisplaySubMenu = true; - structItem.IsMainDisplayClear = true; - structItem.IsMainDisplayProductNo = true; - structItem.IsLogJudge = true; structItem.IsLogHistory = true; structItem.IsLogOthers = true; @@ -11284,6 +11287,11 @@ namespace ITC81DB_0H.Forms break; case 2: #region Level3 + structItem.IsMainDisplayWeightSetting = true; + structItem.IsMainDisplayClear = true; + structItem.IsMainDisplaySubMenu = true; + structItem.IsMainDisplayProductNo = true; + structItem.IsBasicDataStatistics = true; structItem.IsBasicProduct = true; structItem.IsBasicTime = true; @@ -11308,11 +11316,6 @@ namespace ITC81DB_0H.Forms structItem.IsSystemJudgmentSetting = true; structItem.IsSystemSorterSetting = true; - structItem.IsMainDisplayWeightSetting = true; - structItem.IsMainDisplayClear = true; - structItem.IsMainDisplaySubMenu = true; - structItem.IsMainDisplayProductNo = true; - structItem.IsLogJudge = true; structItem.IsLogHistory = true; structItem.IsLogOthers = true; @@ -11338,6 +11341,11 @@ namespace ITC81DB_0H.Forms break; case 3: #region Not Login + structItem.IsMainDisplayWeightSetting = true; + structItem.IsMainDisplayClear = true; + structItem.IsMainDisplayProductNo = true; + structItem.IsMainDisplaySubMenu = true; + structItem.IsBasicDataStatistics = true; structItem.IsBasicProduct = true; structItem.IsBasicTime = true; @@ -11362,11 +11370,6 @@ namespace ITC81DB_0H.Forms structItem.IsSystemJudgmentSetting = true; structItem.IsSystemSorterSetting = true; - structItem.IsMainDisplayWeightSetting = true; - structItem.IsMainDisplayClear = true; - structItem.IsMainDisplayProductNo = true; - structItem.IsMainDisplaySubMenu = true; - structItem.IsLogJudge = true; structItem.IsLogHistory = true; structItem.IsLogOthers = true; @@ -11392,6 +11395,11 @@ namespace ITC81DB_0H.Forms break; default: #region default + structItem.IsMainDisplayProductNo = item.IsMainDisplayProductNo; + structItem.IsMainDisplayWeightSetting = item.IsMainDisplayWeightSetting; + structItem.IsMainDisplayClear = item.IsMainDisplayClear; + structItem.IsMainDisplaySubMenu = item.IsMainDisplaySubMenu; + structItem.IsBasicDataStatistics = item.IsBasicDataStatistics; structItem.IsBasicProduct = item.IsBasicProduct; structItem.IsBasicTime = item.IsBasicTime; @@ -11416,11 +11424,6 @@ namespace ITC81DB_0H.Forms structItem.IsSystemJudgmentSetting = item.IsSystemJudgmentSetting; structItem.IsSystemSorterSetting = item.IsSystemSorterSetting; - structItem.IsMainDisplayProductNo = item.IsMainDisplayProductNo; - structItem.IsMainDisplayWeightSetting = item.IsMainDisplayWeightSetting; - structItem.IsMainDisplayClear = item.IsMainDisplayClear; - structItem.IsMainDisplaySubMenu = item.IsMainDisplaySubMenu; - structItem.IsLogJudge = item.IsLogJudge; structItem.IsLogHistory = item.IsLogHistory; structItem.IsLogOthers = item.IsLogOthers; @@ -12036,6 +12039,11 @@ namespace ITC81DB_0H.Forms #region Level1 structItem = (StructUserGroupItem)this.smartFileIO.ReadStructureBuffer(typeof(StructUserGroupItem), (int)Define.E_FileUserGroup.f0_Level1); + item.Level1.IsMainDisplayClear = structItem.IsMainDisplayClear; + item.Level1.IsMainDisplayProductNo = structItem.IsMainDisplayProductNo; + item.Level1.IsMainDisplaySubMenu = structItem.IsMainDisplaySubMenu; + item.Level1.IsMainDisplayWeightSetting = structItem.IsMainDisplayWeightSetting; + item.Level1.IsBasicDataStatistics = structItem.IsBasicDataStatistics; item.Level1.IsBasicProduct = structItem.IsBasicProduct; item.Level1.IsBasicTime = structItem.IsBasicTime; @@ -12068,6 +12076,11 @@ namespace ITC81DB_0H.Forms #region Level2 structItem = (StructUserGroupItem)this.smartFileIO.ReadStructureBuffer(typeof(StructUserGroupItem), (int)Define.E_FileUserGroup.f1_Level2); + item.Level2.IsMainDisplayClear = structItem.IsMainDisplayClear; + item.Level2.IsMainDisplayProductNo = structItem.IsMainDisplayProductNo; + item.Level2.IsMainDisplaySubMenu = structItem.IsMainDisplaySubMenu; + item.Level2.IsMainDisplayWeightSetting = structItem.IsMainDisplayWeightSetting; + item.Level2.IsBasicDataStatistics = structItem.IsBasicDataStatistics; item.Level2.IsBasicProduct = structItem.IsBasicProduct; item.Level2.IsBasicTime = structItem.IsBasicTime; @@ -12100,6 +12113,11 @@ namespace ITC81DB_0H.Forms #region Level3 structItem = (StructUserGroupItem)this.smartFileIO.ReadStructureBuffer(typeof(StructUserGroupItem), (int)Define.E_FileUserGroup.f2_Level3); + item.Level3.IsMainDisplayClear = structItem.IsMainDisplayClear; + item.Level3.IsMainDisplayProductNo = structItem.IsMainDisplayProductNo; + item.Level3.IsMainDisplaySubMenu = structItem.IsMainDisplaySubMenu; + item.Level3.IsMainDisplayWeightSetting = structItem.IsMainDisplayWeightSetting; + item.Level3.IsBasicDataStatistics = structItem.IsBasicDataStatistics; item.Level3.IsBasicProduct = structItem.IsBasicProduct; item.Level3.IsBasicTime = structItem.IsBasicTime; @@ -12134,6 +12152,11 @@ namespace ITC81DB_0H.Forms { structItem = (StructUserGroupItem)this.smartFileIO.ReadStructureBuffer(typeof(StructUserGroupItem), (int)Define.E_FileUserGroup.f3_NotLogin); + item.NotLogin.IsMainDisplayClear = structItem.IsMainDisplayClear; + item.NotLogin.IsMainDisplayProductNo = structItem.IsMainDisplayProductNo; + item.NotLogin.IsMainDisplaySubMenu = structItem.IsMainDisplaySubMenu; + item.NotLogin.IsMainDisplayWeightSetting = structItem.IsMainDisplayWeightSetting; + item.NotLogin.IsBasicDataStatistics = structItem.IsBasicDataStatistics; item.NotLogin.IsBasicProduct = structItem.IsBasicProduct; item.NotLogin.IsBasicTime = structItem.IsBasicTime; @@ -12158,11 +12181,6 @@ namespace ITC81DB_0H.Forms item.NotLogin.IsSystemJudgmentSetting = structItem.IsSystemJudgmentSetting; item.NotLogin.IsSystemSorterSetting = structItem.IsSystemSorterSetting; - item.NotLogin.IsMainDisplayProductNo = structItem.IsMainDisplayProductNo; - item.NotLogin.IsMainDisplayWeightSetting = structItem.IsMainDisplayWeightSetting; - item.NotLogin.IsMainDisplayClear = structItem.IsMainDisplayClear; - item.NotLogin.IsMainDisplaySubMenu = structItem.IsMainDisplaySubMenu; - item.NotLogin.IsLogJudge = structItem.IsLogJudge; item.NotLogin.IsLogHistory = structItem.IsLogHistory; item.NotLogin.IsLogOthers = structItem.IsLogOthers; @@ -12229,8 +12247,6 @@ namespace ITC81DB_0H.Forms { DialogFormMessage myMsg = new DialogFormMessage(17, this.SystemConfig1.Language); myMsg.ShowDialog(); - - this.smartFileIO.Close(); } this.smartFileIO.Close(); } @@ -12278,21 +12294,7 @@ namespace ITC81DB_0H.Forms // UserGroup 파일 읽기 this.LoadUserGroupFile(ref this.CurrentUserGroup); - - if (this.SystemConfig1.IsLogin == true) - { - // UserManager 초기화 - this.InitializeUserManager(); - this.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.LogOut; - - if (this.SystemConfig3.IsPart11 == false) - UserManager.UserManager_AutoLogoutTimeoutPause(); - } - - if (this.SystemConfig3.IsPart11 == true) - // Encryption 초기화 - this.InitializeAES(); - + this.SetTrackingHistoryData(Define.E_TrackingOperation.PowerOn, ""); // 폼 생성 @@ -12357,14 +12359,28 @@ namespace ITC81DB_0H.Forms // 변수 초기 셋팅2(바코드 셋팅, 이더넷) this.DefaultSetting2(); - this.SmartSplashProgramLoad.Finish(); + if (this.SystemConfig1.IsLogin == true) + { + // UserManager 초기화 + this.InitializeUserManager(); - if (this.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.NotLogin) + if (this.SystemConfig3.IsPart11 == false) + UserManager.UserManager_AutoLogoutTimeoutPause(); + } + else + { this.ChildFormMenu.CenterEquipUserGroupEditor.UpdateAllMenu(this.CurrentSystemStatus); + } + + if (this.SystemConfig3.IsPart11 == true) + // Encryption 초기화 + this.InitializeAES(); // 현재 Version.ini 파일 생성 혹은 갱신 this.CheckCurrentVersionIniFile(); + this.SmartSplashProgramLoad.Finish(); + this.smartForm.Show((int)Define.E_FormStore.FormMainDisplay); this.ChildFormMainDisplay.CurrentBottomMenuControlEnable(); diff --git a/ITC81DB_0H/Forms/FormMainDisplay.Designer.cs b/ITC81DB_0H/Forms/FormMainDisplay.Designer.cs index b27c445..8fe8907 100644 --- a/ITC81DB_0H/Forms/FormMainDisplay.Designer.cs +++ b/ITC81DB_0H/Forms/FormMainDisplay.Designer.cs @@ -65,6 +65,7 @@ this.labelExpireOfPassword = new SmartX.SmartLabel(); this.labelUserID = new SmartX.SmartLabel(); this.labelUserLevel = new SmartX.SmartLabel(); + this.labelAlarmWindow = new SmartX.SmartLabel(); ((System.ComponentModel.ISupportInitialize)(this.smartForm1)).BeginInit(); this.panel1.SuspendLayout(); this.SuspendLayout(); @@ -840,12 +841,36 @@ this.labelUserLevel.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; this.labelUserLevel.Wordwrap = false; // + // labelAlarmWindow + // + this.labelAlarmWindow.BackColor = System.Drawing.Color.DarkRed; + this.labelAlarmWindow.BackPictureBox = null; + this.labelAlarmWindow.BackPictureBox1 = null; + this.labelAlarmWindow.BackPictureBox2 = null; + this.labelAlarmWindow.BorderColor = System.Drawing.Color.Black; + this.labelAlarmWindow.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.labelAlarmWindow.Font = new System.Drawing.Font("새굴림", 20F, System.Drawing.FontStyle.Bold); + this.labelAlarmWindow.ForeColor = System.Drawing.Color.White; + this.labelAlarmWindow.InitVisible = true; + this.labelAlarmWindow.LineSpacing = 0F; + this.labelAlarmWindow.Location = new System.Drawing.Point(140, 125); + this.labelAlarmWindow.Name = "labelAlarmWindow"; + this.labelAlarmWindow.Size = new System.Drawing.Size(500, 100); + this.labelAlarmWindow.TabIndex = 596; + this.labelAlarmWindow.Text = "선별부 에러"; + this.labelAlarmWindow.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelAlarmWindow.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelAlarmWindow.Visible = false; + this.labelAlarmWindow.Wordwrap = false; + this.labelAlarmWindow.Click += new System.EventHandler(this.labelAlarmWindow_Click); + // // FormMainDisplay // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScroll = true; this.ClientSize = new System.Drawing.Size(800, 600); + this.Controls.Add(this.labelAlarmWindow); this.Controls.Add(this.labelExpireOfPassword); this.Controls.Add(this.labelUserID); this.Controls.Add(this.labelUserLevel); @@ -916,5 +941,6 @@ private SmartX.SmartLabel labelExpireOfPassword; private SmartX.SmartLabel labelUserID; private SmartX.SmartLabel labelUserLevel; + private SmartX.SmartLabel labelAlarmWindow; } } \ No newline at end of file diff --git a/ITC81DB_0H/Forms/FormMainDisplay.cs b/ITC81DB_0H/Forms/FormMainDisplay.cs index a1dd9dd..574367c 100644 --- a/ITC81DB_0H/Forms/FormMainDisplay.cs +++ b/ITC81DB_0H/Forms/FormMainDisplay.cs @@ -21,6 +21,8 @@ namespace ITC81DB_0H.Forms public partial class FormMainDisplay : Form { #region Field + public string ChangeID; + private FormMain m_ParentForm; public bool IsCurrentValueDouble; @@ -275,10 +277,12 @@ namespace ITC81DB_0H.Forms { if (this.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Korean) { + this.PopUpWarning(errorNameKor); this.MainAlarm.listBoxMessage.Items.Add(errorNameKor); } else { + this.PopUpWarning(errorNameEng); this.MainAlarm.listBoxMessage.Items.Add(errorNameEng); } } @@ -299,6 +303,7 @@ namespace ITC81DB_0H.Forms this.pictureBoxIconAlarm.Visible = false; this.MainAlarm.Visible = false; this.labelSorterAlarm.Visible = false; + this.PopUpWarningClose(); if (this.ParentForm.SystemConfig1.IsExternalInputLamp == true && this.ParentForm.IsLampOnDataSend == true) this.ParentForm.TransferData(CommunicationCommand.LampOnContinuousDisable, CommunicationID.MainBoard); @@ -835,22 +840,105 @@ namespace ITC81DB_0H.Forms break; } } + private void DirectLogin(string id, string pass) + { + UserManager.UserMgr_user_info_t userInfo = new UserManager.UserMgr_user_info_t(); + UserManager.UserManager_UserLoginDirect(id, pass, ref userInfo); + //Console.WriteLine(string.Format("status : {0}", userInfo.status)); + //Console.WriteLine("ID : " + id); + //Console.WriteLine("pass : " + pass); + + if (userInfo.status == 0) + { + #region 로그인 성공 + if (userInfo.active_level == 1) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level1; + else if (userInfo.active_level == 2) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level2; + else if (userInfo.active_level == 3) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level3; + else if (userInfo.active_level == 9) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Admin; + else if (userInfo.active_level == 10) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Developer; + + this.ParentForm.CurrentSystemStatus.CurrentUser.ID = userInfo.user_id; + this.ParentForm.CurrentSystemStatus.CurrentUser.Password = userInfo.user_pw; + + this.ParentForm.CurrentSystemStatus.CurrentUser.ExpireId = userInfo.id_expire_period; + this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword = userInfo.password_expire_period; + + DateTime time = DateTime.ParseExact(userInfo.password_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordRegister = time; + time = DateTime.ParseExact(userInfo.id_login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdLogin = time; + time = DateTime.ParseExact(userInfo.id_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdExpire = time; + time = DateTime.ParseExact(userInfo.password_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire = time; + + this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockAccount = userInfo.id_flock_status == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockPassword = userInfo.password_flock_status == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel = userInfo.active_level; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsFirstPassword = userInfo.fFirstPW; + #endregion + + this.UI_Invoke(delegate + { + this.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus); + }); + } + } + private void PasswordExpirationCheck(UserItem user) + { + int expiryDay = 0; + + // 만료일 -10 일때 메시지 띄우기 + expiryDay = user.GetPasswordExpiryDday(); + if (expiryDay >= -10) + { + //Console.WriteLine("password : " + expiryDay.ToString()); + if (expiryDay < 0) + expiryDay *= -1; + + DialogFormYesNo myDlg = new DialogFormYesNo(this.ParentForm.SystemConfig1.Language, 2, expiryDay.ToString()); + if (myDlg.ShowDialog() == DialogResult.Yes) + { + // 비밀 번호 변경 띄우기 + DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm, true, true); + if (logOn.ShowDialog() == DialogResult.OK) + { + + } + } + } + } private void Login() { int extract = 0; + DialogResult result; - DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm, this.ParentForm.SystemConfig1.Language, this.ParentForm.SystemConfig3.IsPart11); - if (logOn.ShowDialog() == DialogResult.OK) + DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm, false, false); + result = logOn.ShowDialog(); + if (result == DialogResult.OK) { + if (this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Level1 || + this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Level2 || + this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Level3) + { + // 비밀번호 만료일 10일 미만 체크 후 비밀번호 변경 + this.PasswordExpirationCheck(this.ParentForm.CurrentSystemStatus.CurrentUser); + } + this.ParentForm.ChildFormMenu.CenterEquipUserGroupEditor.UpdateAllMenu(this.ParentForm.CurrentSystemStatus); this.DisplayRefresh(this.ParentForm.CurrentSystemStatus); + this.buttonUser.ButtonDown(); this.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus); this.ParentForm.ChildFormMenu.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus); - this.buttonUser.ButtonDown(); - this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Login, ""); switch (this.CurrentDisplay) @@ -874,19 +962,32 @@ namespace ITC81DB_0H.Forms break; } } + else if (result == DialogResult.Abort) + { + // 비밀 번호 변경 띄우기 + DialogFormLogOn logOn1 = new DialogFormLogOn(this.ParentForm, false, true); + if (logOn1.ShowDialog() == DialogResult.OK) + { + this.ParentForm.ChildFormMenu.CenterEquipUserGroupEditor.UpdateAllMenu(this.ParentForm.CurrentSystemStatus); + this.DisplayRefresh(this.ParentForm.CurrentSystemStatus); + + this.buttonUser.ButtonDown(); + this.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus); + this.ParentForm.ChildFormMenu.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus); + } + else + this.buttonUser.ButtonUp(); + } else { this.buttonUser.ButtonUp(); - - this.DisplayRefresh(this.ParentForm.CurrentSystemStatus); - this.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus); - this.ParentForm.ChildFormMenu.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus); } } public void Logout() { this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.LogOut; this.buttonUser.ButtonUp(); + this.ChangeID = ""; this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Logout, ""); @@ -944,6 +1045,18 @@ namespace ITC81DB_0H.Forms } + public void PopUpWarning(string warning) + { + this.labelAlarmWindow.Text = warning; + this.labelAlarmWindow.BringToFront(); + this.labelAlarmWindow.Visible = true; + } + public void PopUpWarningClose() + { + if (this.labelAlarmWindow.Visible == true) + this.labelAlarmWindow.Visible = false; + } + public string DisplayExpireOfPassword(Define.E_UserGroup group) { string ret = ""; @@ -952,15 +1065,16 @@ namespace ITC81DB_0H.Forms ret = "-"; else { - TimeSpan resultTime = DateTime.Now - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireRegister; - ret = resultTime.Days.ToString(); + //TimeSpan resultTime = DateTime.Now - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireRegister; + TimeSpan dayDiff = DateTime.Now.Date - this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire.Date; + ret = dayDiff.Days.ToString(); } return ret; } public void CallBackUserListModifyInfoData(UserManager.UserMgr_user_info_t user) { - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireRegister = DateTime.Now.AddDays(this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword - 1); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordRegister = DateTime.Now.AddDays(this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword - 1); this.DisplayExpireOfPassword(this.ParentForm.CurrentSystemStatus.CurrentUser.Group); } public void CallBackUserListLoginTimeoutDataEvent(UserManager.UserMgr_login_timeout_t user) @@ -1011,10 +1125,7 @@ namespace ITC81DB_0H.Forms this.UI_Invoke(delegate { DialogFormMessage msg = new DialogFormMessage(Define.E_MessageBoxIcon.Asterisk, code, message1, message2, warningTime); - if (msg.ShowDialog() == DialogResult.OK) - { - this.Part11AutomaticLogoutReset(); - } + msg.ShowDialog(); }); } else @@ -1070,6 +1181,55 @@ namespace ITC81DB_0H.Forms }); } } + public void CallBackUserListModifyInfoDataEvent(UserManager.UserMgr_user_info_t userInfo) + { + //Console.WriteLine("status : " + userInfo.status.ToString()); + //Console.WriteLine("ID : " + userInfo.user_id); + //Console.WriteLine("pass : " + userInfo.user_pw); + if (userInfo.status == 0) + { + //Console.WriteLine("Group : " + this.ParentForm.SystemConfig.CurrentUser.Group.ToString()); + if (this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.LogOut) + { + //Console.WriteLine("DirectLogin"); + this.DirectLogin(userInfo.user_id, userInfo.user_pw); + } + else + { + if (userInfo.active_level == 1) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level1; + else if (userInfo.active_level == 2) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level2; + else if (userInfo.active_level == 3) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Level3; + else if (userInfo.active_level == 9) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Admin; + else if (userInfo.active_level == 10) + this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.Developer; + + this.ParentForm.CurrentSystemStatus.CurrentUser.ID = userInfo.user_id; + this.ParentForm.CurrentSystemStatus.CurrentUser.Password = userInfo.user_pw; + + this.ParentForm.CurrentSystemStatus.CurrentUser.ExpireId = userInfo.id_expire_period; + this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword = userInfo.password_expire_period; + + DateTime time = DateTime.ParseExact(userInfo.password_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordRegister = time; + time = DateTime.ParseExact(userInfo.id_login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdLogin = time; + time = DateTime.ParseExact(userInfo.id_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DateIdExpire = time; + time = DateTime.ParseExact(userInfo.password_expire_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire = time; + + this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockAccount = userInfo.id_flock_status == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsLockPassword = userInfo.password_flock_status == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; + this.ParentForm.CurrentSystemStatus.CurrentUser.ActiveLevel = userInfo.active_level; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsFirstPassword = userInfo.fFirstPW; + } + } + } public void UpdateModbusScreen() { @@ -1244,7 +1404,6 @@ namespace ITC81DB_0H.Forms this.timerClientConnectCheck.Enabled = true; } } - public void UpdateTimeDisplay() { this.labelTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); @@ -1462,7 +1621,16 @@ namespace ITC81DB_0H.Forms this.Part11AutomaticLogoutReset(); if (this.MainAlarm.Visible == true) + { this.MainAlarm.Visible = false; + + if (this.labelAlarmWindow.Visible == true + && (this.MainAlarm.listBoxMessage.Items.Contains("Sorter A Error") || this.MainAlarm.listBoxMessage.Items.Contains("Sorter B Error"))) + { + this.ParentForm.TransferData(CommunicationCommand.AlarmNgClearSorter, CommunicationID.MainBoard); + this.PopUpWarningClose(); + } + } else { this.MainAlarm.BringToFront(); @@ -1487,6 +1655,20 @@ namespace ITC81DB_0H.Forms this.ParentForm.TransferData(CommunicationCommand.BuzzerOnContinuousDisable, CommunicationID.MainBoard); this.labelSorterAlarm.Visible = false; } + private void labelAlarmWindow_Click(object sender, EventArgs e) + { + // Automatic Logout Reset + if (this.ParentForm.SystemConfig3.IsPart11 == true) + this.Part11AutomaticLogoutReset(); + + if (this.MainAlarm.listBoxMessage.Items.Contains("Sorter A Error") || this.MainAlarm.listBoxMessage.Items.Contains("Sorter B Error")) + this.ParentForm.TransferData(CommunicationCommand.AlarmNgClearSorter, CommunicationID.MainBoard); + if (this.ParentForm.SystemConfig1.IsExternalInputLamp == true && this.ParentForm.IsLampOnDataSend == true) + this.ParentForm.TransferData(CommunicationCommand.LampOnContinuousDisable, CommunicationID.MainBoard); + if (this.ParentForm.SystemConfig1.IsExternalInputBuzzer == true && this.ParentForm.IsBuzzerOnDataSend == true) + this.ParentForm.TransferData(CommunicationCommand.BuzzerOnContinuousDisable, CommunicationID.MainBoard); + this.PopUpWarningClose(); + } private void buttonPrint_Click(object sender, EventArgs e) { diff --git a/ITC81DB_0H/ITC81DB_2H.csproj b/ITC81DB_0H/ITC81DB_2H.csproj index a5efc11..5135fcc 100644 --- a/ITC81DB_0H/ITC81DB_2H.csproj +++ b/ITC81DB_0H/ITC81DB_2H.csproj @@ -425,7 +425,7 @@ - + Form diff --git a/ITC81DB_0H/Datastore/User.cs b/ITC81DB_0H/Part11_UserManager/UserItem.cs similarity index 88% rename from ITC81DB_0H/Datastore/User.cs rename to ITC81DB_0H/Part11_UserManager/UserItem.cs index 0b45b45..1541462 100644 --- a/ITC81DB_0H/Datastore/User.cs +++ b/ITC81DB_0H/Part11_UserManager/UserItem.cs @@ -7,7 +7,7 @@ using System.Text; using ITC81DB_2H.Datastore; -namespace ITC81DB_0H +namespace ITC81DB_0H.Part11_UserManager { #region UserItem public class UserItem @@ -17,26 +17,25 @@ namespace ITC81DB_0H private string m_ID; private string m_Password; - private string m_PreviousPassword1; - private string m_PreviousPassword2; - private string m_PreviousPassword3; - private int m_ExpireAccount; + private int m_ExpireId; private int m_ExpirePassword; private bool m_IsLockAccount; private bool m_IsLockPassword; - private DateTime m_DateRegister; - private DateTime m_DateLogin; - private DateTime m_DateExpireRegister; - private DateTime m_DateExpireLogin; + private DateTime m_DatePasswordRegister; + private DateTime m_DateIdLogin; + private DateTime m_DatePasswordExpire; + private DateTime m_DateIdExpire; private Define.E_UserGroup m_Group; private bool m_IsAdmin; private int m_ActiveLevel; + + private int m_IsFirstPassword; #endregion #region Constructor @@ -63,26 +62,11 @@ namespace ITC81DB_0H get { return this.m_Password; } set { this.m_Password = value; } } - public string PreviousPassword1 - { - get { return this.m_PreviousPassword1; } - set { this.m_PreviousPassword1 = value; } - } - public string PreviousPassword2 - { - get { return this.m_PreviousPassword2; } - set { this.m_PreviousPassword2 = value; } - } - public string PreviousPassword3 - { - get { return this.m_PreviousPassword3; } - set { this.m_PreviousPassword3 = value; } - } - public int ExpireAccount + public int ExpireId { - get { return this.m_ExpireAccount; } - set { this.m_ExpireAccount = value; } + get { return this.m_ExpireId; } + set { this.m_ExpireId = value; } } public int ExpirePassword { @@ -101,25 +85,25 @@ namespace ITC81DB_0H set { this.m_IsLockPassword = value; } } - public DateTime DateRegister + public DateTime DatePasswordRegister { - get { return this.m_DateRegister; } - set { this.m_DateRegister = value; } + get { return this.m_DatePasswordRegister; } + set { this.m_DatePasswordRegister = value; } } - public DateTime DateLogin + public DateTime DateIdLogin { - get { return this.m_DateLogin; } - set { this.m_DateLogin = value; } + get { return this.m_DateIdLogin; } + set { this.m_DateIdLogin = value; } } - public DateTime DateExpireRegister + public DateTime DatePasswordExpire { - get { return this.m_DateExpireRegister; } - set { this.m_DateExpireRegister = value; } + get { return this.m_DatePasswordExpire; } + set { this.m_DatePasswordExpire = value; } } - public DateTime DateExpireLogin + public DateTime DateIdExpire { - get { return this.m_DateExpireLogin; } - set { this.m_DateExpireLogin = value; } + get { return this.m_DateIdExpire; } + set { this.m_DateIdExpire = value; } } public Define.E_UserGroup Group @@ -139,6 +123,12 @@ namespace ITC81DB_0H get { return this.m_ActiveLevel; } set { this.m_ActiveLevel = value; } } + + public int IsFirstPassword + { + get { return this.m_IsFirstPassword; } + set { this.m_IsFirstPassword = value; } + } #endregion #region Method @@ -149,37 +139,44 @@ namespace ITC81DB_0H this.ID = ""; this.Password = ""; - this.PreviousPassword1 = ""; - this.PreviousPassword2 = ""; - this.PreviousPassword3 = ""; - - this.ExpireAccount = 0; + this.ExpireId = 0; this.ExpirePassword = 0; - this.DateRegister = DateTime.Now; - this.DateLogin = DateTime.Now; - this.DateExpireRegister = DateTime.Now; - this.DateExpireLogin = DateTime.Now; + this.DatePasswordRegister = DateTime.Now; + this.DateIdLogin = DateTime.Now; + this.DatePasswordExpire = DateTime.Now; + this.DateIdExpire = DateTime.Now; this.Group = Define.E_UserGroup.None; this.IsAdmin = false; this.ActiveLevel = 1; + + this.IsFirstPassword = 1; //[1] 최초 비밀번호(비밀번호 변경창 띄우기), [0] 비밀번호 변경완료됨 } - public void SetPassword(string pass) + public int GetPasswordExpiryDday() { - this.PreviousPassword3 = this.PreviousPassword2; - this.PreviousPassword2 = this.PreviousPassword1; - this.PreviousPassword1 = pass; - this.Password = pass; + int ret = 0; + DateTime timeNow = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); + TimeSpan dayDiff; + + if (this.Group == Define.E_UserGroup.Admin || this.Group == Define.E_UserGroup.Developer) + ret = 9999; + else + { + dayDiff = timeNow.Date - this.DatePasswordExpire.Date; + ret = dayDiff.Days; + } + + return ret; } + public bool CheckID(string id) { bool ret = false; - return ret; } public bool CheckPassword(string pass) diff --git a/ITC81DB_0H/Part11_UserManager/UserManager.Define.cs b/ITC81DB_0H/Part11_UserManager/UserManager.Define.cs index 05f487d..45d31be 100644 --- a/ITC81DB_0H/Part11_UserManager/UserManager.Define.cs +++ b/ITC81DB_0H/Part11_UserManager/UserManager.Define.cs @@ -54,6 +54,7 @@ namespace ITC81DB_0H.Part11_UserManager private delegate void fnUserMgrGetListNameCB(ref UserMgr_user_list_name_t user_name); private static fnUserMgrGetListNameCB fnUsermgrGetListNameCallBack; + [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] private static extern void DLL_UserMgr_Register_VersionCB(fnUserMgrVersionCB func); @@ -126,6 +127,9 @@ namespace ITC81DB_0H.Part11_UserManager [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] private static extern int DLL_UserMgr_UserModifyPW(IntPtr user_id, IntPtr user_pw); + [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] + private static extern int DLL_UserMgr_UserModifyPWDirect(IntPtr user_id, IntPtr user_pw); + [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] private static extern int DLL_UserMgr_UserModifyID(IntPtr user_org_id, IntPtr user_new_id); diff --git a/ITC81DB_0H/Part11_UserManager/UserManager.Structure.cs b/ITC81DB_0H/Part11_UserManager/UserManager.Structure.cs index 5c2394e..6e8461f 100644 --- a/ITC81DB_0H/Part11_UserManager/UserManager.Structure.cs +++ b/ITC81DB_0H/Part11_UserManager/UserManager.Structure.cs @@ -69,29 +69,29 @@ namespace ITC81DB_0H.Part11_UserManager USER_MGR_STATUS_OK = 0x00, // error status - USER_MGR_STATUS_ID_NOT_FOUND, // not found the user id - USER_MGR_STATUS_ID_DUPLICATE, // duplicate on id - USER_MGR_STATUS_ID_LENGTH_UNDER, // under the minimum length of id - USER_MGR_STATUS_ID_LENGTH_OVER, // over the maximum length of id - USER_MGR_STATUS_ID_CONT_LETTER, // continue characters or duplicate characters of id - USER_MGR_STATUS_ID_INVALID_CHAR, // include the invalid character on id - USER_MGR_STATUS_ID_ACCOUNT_LOCK, + USER_MGR_STATUS_ID_NOT_FOUND, // 1 - not found the user id + USER_MGR_STATUS_ID_DUPLICATE, // 2 - duplicate on id + USER_MGR_STATUS_ID_LENGTH_UNDER, // 3 - under the minimum length of id + USER_MGR_STATUS_ID_LENGTH_OVER, // 4 - over the maximum length of id + USER_MGR_STATUS_ID_CONT_LETTER, // 5 - continue characters or duplicate characters of id + USER_MGR_STATUS_ID_INVALID_CHAR, // 6 - include the invalid character on id + USER_MGR_STATUS_ID_ACCOUNT_LOCK, // 7 - Account Lock - USER_MGR_STATUS_PW_DUPLICATE_HISTORY, // duplicate on password history - USER_MGR_STATUS_PW_LENGTH_UNDER, // under the minimum length of password - USER_MGR_STATUS_PW_LENGTH_OVER, // over the maximum length of password - USER_MGR_STATUS_PW_CONT_LETTER, // continue characters or duplicate characters of password - USER_MGR_STATUS_PW_INVALID_CHAR, // include the invalid character on password - USER_MGR_STATUS_PW_EACH_MIN_CHAR, // not include minimum characters on password - USER_MGR_STATUS_PW_NOT_SAME, // password error - USER_MGR_STATUS_PW_PASSWORD_LOCK, + USER_MGR_STATUS_PW_DUPLICATE_HISTORY, // 8 - duplicate on password history + USER_MGR_STATUS_PW_LENGTH_UNDER, // 9 - under the minimum length of password + USER_MGR_STATUS_PW_LENGTH_OVER, // 10 - over the maximum length of password + USER_MGR_STATUS_PW_CONT_LETTER, // 11 - continue characters or duplicate characters of password + USER_MGR_STATUS_PW_INVALID_CHAR, // 12 - include the invalid character on password + USER_MGR_STATUS_PW_EACH_MIN_CHAR, // 13 - not include minimum characters on password + USER_MGR_STATUS_PW_NOT_SAME, // 14 - password error + USER_MGR_STATUS_PW_PASSWORD_LOCK, // 15 - Password Lock - USER_MGR_STATUS_OTHER_OVER_PASSWORD_PERIOD, // over maximum password expire period (days) - USER_MGR_STATUS_OTHER_OVER_ACCOUNT_PERIOD, // over maximum account expire period (days) - USER_MGR_STATUS_OTHER_OVER_LOGIN_TIMEOUT, // over maximum auto logout time (minute) + USER_MGR_STATUS_OTHER_OVER_PASSWORD_PERIOD, // 16 - over maximum password expire period (days) + USER_MGR_STATUS_OTHER_OVER_ACCOUNT_PERIOD, // 17 - over maximum account expire period (days) + USER_MGR_STATUS_OTHER_OVER_LOGIN_TIMEOUT, // 18 - over maximum auto logout time (minute) USER_MGR_STATUS_MAX, - }; + }; #endregion #region Enum E_user_mgr_menu_id @@ -192,7 +192,7 @@ namespace ITC81DB_0H.Part11_UserManager return dateTime; } - } + } #endregion #region Struct UserMgr_user_info_t @@ -212,35 +212,38 @@ namespace ITC81DB_0H.Part11_UserManager public Int32 fadmin; [MarshalAs(UnmanagedType.I4)] - public Int32 expire_period_pw; // password lock + public Int32 password_expire_period; // password lock date [MarshalAs(UnmanagedType.I4)] - public Int32 expire_period_account; // account lock + public Int32 id_expire_period; // id lock date [MarshalAs(UnmanagedType.I4)] - public Int32 flock_status_account; // user ID (account) lock + public Int32 id_flock_status; // user ID (account) lock status [MarshalAs(UnmanagedType.I4)] - public Int32 flock_status_password; // password lock (need to change password) + public Int32 password_flock_status; // password lock status (need to change password) [MarshalAs(UnmanagedType.Struct)] - public DateTime_t register_date; // date/time when the user password was registered or changed + public DateTime_t password_register_date; // date/time when the user password was registered or changed [MarshalAs(UnmanagedType.Struct)] - public DateTime_t login_date; // date/time when the user was login + public DateTime_t id_login_date; // date/time when the user was login [MarshalAs(UnmanagedType.Struct)] - public DateTime_t expire_register_date; + public DateTime_t password_expire_date; // Password Expiration Date [MarshalAs(UnmanagedType.Struct)] - public DateTime_t expire_account_date; + public DateTime_t id_expire_date; // Account Expiration Date [MarshalAs(UnmanagedType.Struct)] - public MenuID_t menuID; + public MenuID_t menuID; // flag of Menu IDs [MarshalAs(UnmanagedType.I4)] - public Int32 active_level; - } + public Int32 active_level; // menu active level : max : MAX_ACTIVE_LEVEL + + [MarshalAs(UnmanagedType.I4)] + public Int32 fFirstPW; // [1] First (request to modify), [0] Next (not request) + } #endregion #region Struct UserMgr_user_modify_t @@ -262,7 +265,7 @@ namespace ITC81DB_0H.Part11_UserManager [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_USER_ID_LENGTH)] public string user_id; - } + } #endregion #region Struct UserMgr_login_timeout_t @@ -273,7 +276,7 @@ namespace ITC81DB_0H.Part11_UserManager [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_USER_ID_LENGTH)] public string user_id; - } + } #endregion #region Struct UserMgr_user_add_t @@ -286,7 +289,7 @@ namespace ITC81DB_0H.Part11_UserManager [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_USER_ID_LENGTH)] public string user_id; - } + } #endregion #region Struct UserMgr_user_lock_t @@ -298,7 +301,7 @@ namespace ITC81DB_0H.Part11_UserManager [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_USER_ID_LENGTH)] public string user_id; - } + } #endregion #region Struct UserMgr_user_list_t @@ -324,35 +327,38 @@ namespace ITC81DB_0H.Part11_UserManager public Int32 fadmin; [MarshalAs(UnmanagedType.I4)] - public Int32 expire_period_pw; // password lock + public Int32 password_expire_period; // password lock [MarshalAs(UnmanagedType.I4)] - public Int32 expire_period_account; // account lock + public Int32 id_expire_period; // account lock [MarshalAs(UnmanagedType.I4)] - public Int32 flock_status_account; // user ID (account) lock + public Int32 id_flock_status; // user ID (account) lock [MarshalAs(UnmanagedType.I4)] public Int32 flock_status_password; // password lock (need to change password) [MarshalAs(UnmanagedType.Struct)] - public DateTime_t register_date; // date/time when the user password was registered or changed + public DateTime_t password_register_date; // date/time when the user password was registered or changed [MarshalAs(UnmanagedType.Struct)] - public DateTime_t login_date; // date/time when the user was login + public DateTime_t id_login_date; // date/time when the user was login [MarshalAs(UnmanagedType.Struct)] - public DateTime_t expire_register_date; + public DateTime_t password_expire_date; // Password Expiration Date [MarshalAs(UnmanagedType.Struct)] - public DateTime_t expire_account_date; + public DateTime_t id_expire_date; // Account Expiration Date [MarshalAs(UnmanagedType.I4)] - public Int32 active_level; + public Int32 active_level; // menu active level : max : MAX_ACTIVE_LEVEL [MarshalAs(UnmanagedType.Struct)] - public MenuID_t menuID; - } + public MenuID_t menuID; // flag of Menu IDs + + [MarshalAs(UnmanagedType.I4)] + public Int32 fFirstPW; // flag first password + } #endregion #region Struct UserMgr_user_list_name_t diff --git a/ITC81DB_0H/Part11_UserManager/UserManager.cs b/ITC81DB_0H/Part11_UserManager/UserManager.cs index f0bfb79..4b45e20 100644 --- a/ITC81DB_0H/Part11_UserManager/UserManager.cs +++ b/ITC81DB_0H/Part11_UserManager/UserManager.cs @@ -29,8 +29,6 @@ namespace ITC81DB_0H.Part11_UserManager public static void IntializeUserManager(string folder) { - //Console.Write("Initialize User Manger \n"); - // regisetr callback fnUserMgrVersionCallBack = UserManager_VersionCallback; DLL_UserMgr_Register_VersionCB(fnUserMgrVersionCallBack); @@ -74,86 +72,10 @@ namespace ITC81DB_0H.Part11_UserManager fnUsermgrGetListNameCallBack = UserManager_GetListNameCallBack; DLL_UserMgr_Register_GetListNameCB(fnUsermgrGetListNameCallBack); - // call the function - //DLL_UserMgr_HelloWorld(); - DLL_UserMgr_Activation(); IntPtr pFolder = Marshal.StringToBSTR(folder); DLL_UserMgr_SetFolder(pFolder); - - // Test Only - //TestUserListData(); - } - public static void TestUserListData() - { - DateTime_t regDateTime = new DateTime_t(); - regDateTime.SetDate(2021, 10, 1); - regDateTime.SetTime(10, 11, 12); - - - DateTime_t loginDateTime = new DateTime_t(); - loginDateTime.SetDate(2021, 9, 1); - loginDateTime.SetTime(10, 21, 12); - - UserManager_UserAdd("Intech", "test12#$", 1, 90, 90, 1, regDateTime, loginDateTime); - UserManager_UserAdd("Admin00", "test12#$", 1, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 2); - UserManager_UserAdd("Test101", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 3); - UserManager_UserAdd("Test102", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 4); - UserManager_UserAdd("Test103", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 5); - UserManager_UserAdd("Test104", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 6); - UserManager_UserAdd("Test105", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("Test123", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("Test321", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("ABC001", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("CBA001", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("AAA001", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("Test000", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("Test105", "test12#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("Test106", "test12", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("Test107", "test#$", 0, 90, 90, 1, regDateTime, loginDateTime); - - regDateTime.SetDate(2021, 10, 7); - UserManager_UserAdd("Test108", "1223#$%", 0, 90, 90, 1, regDateTime, loginDateTime); - - //UserManager_UserNew("Test200", "test12#$", 0, 20, 30); - - DLL_UserMgr_GetUserListID(IntPtr.Zero); - } - public static void DeinitializeUserManger() - { - DLL_UserMgr_Register_DebugCB(null); - DLL_UserMgr_Register_NewStatusCB(null); - - DLL_UserMgr_Deactivation(); } #region UM_FUNCTION @@ -214,6 +136,18 @@ namespace ITC81DB_0H.Part11_UserManager DLL_UserMgr_UserModifyPW(pID, pPW); } + public static int UserManager_UserModifyPWDirect(String sID, String sNewPW) + { + int ret = 0; + + IntPtr pID = Marshal.StringToBSTR(sID.ToString()); + IntPtr pPW = Marshal.StringToBSTR(sNewPW.ToString()); + + ret = DLL_UserMgr_UserModifyPWDirect(pID, pPW); + + return ret; + } + public static void UserManager_UserModifyID(String sID, String sNewID) { IntPtr pID = Marshal.StringToBSTR(sID.ToString()); diff --git a/ITC81DB_0H/Version.txt b/ITC81DB_0H/Version.txt index 9a662da..f48756e 100644 --- a/ITC81DB_0H/Version.txt +++ b/ITC81DB_0H/Version.txt @@ -12,6 +12,17 @@ ⺻ м 跮 */ +@ Ver 3.1.1 by CJY + - 2023.9.12 + - Ver 3.1.0 Modify + - ʱȭ / Login, Part11 Off User list ʱȭ + - Part11 dll Ʈ(9/5) + - йȣ , йȣ α ȵǴ + - Ÿ αװ ߰/ + - LCD Ʈ Mainboard α + Mainboard Success/Fail ߰ + - listBox SmartX -> ⺻ listBox + - ˶ ߻ , ߷â ߾ӿ ˶ ǥ + @ Ver 3.1.0 by CJY - 2023.7.21 - Ver 3.0.1 Modify diff --git a/ITC81DB_0H/bin/Release/DllAes128.dll b/ITC81DB_0H/bin/Release/DllAes128.dll index cb66331..cf8898e 100644 Binary files a/ITC81DB_0H/bin/Release/DllAes128.dll and b/ITC81DB_0H/bin/Release/DllAes128.dll differ diff --git a/ITC81DB_0H/bin/Release/DllUserMgr.dll b/ITC81DB_0H/bin/Release/DllUserMgr.dll index 4deab23..e976c80 100644 Binary files a/ITC81DB_0H/bin/Release/DllUserMgr.dll and b/ITC81DB_0H/bin/Release/DllUserMgr.dll differ diff --git a/ITC81DB_0H/bin/Release/ITC81DB_2H.exe b/ITC81DB_0H/bin/Release/ITC81DB_2H.exe index 7723229..0a9e7f9 100644 Binary files a/ITC81DB_0H/bin/Release/ITC81DB_2H.exe and b/ITC81DB_0H/bin/Release/ITC81DB_2H.exe differ diff --git a/ITC81DB_0H/obj/Release/ITC81DB_2H.exe b/ITC81DB_0H/obj/Release/ITC81DB_2H.exe index 7723229..0a9e7f9 100644 Binary files a/ITC81DB_0H/obj/Release/ITC81DB_2H.exe and b/ITC81DB_0H/obj/Release/ITC81DB_2H.exe differ