From 723babd7bb08d4b4ae52062ba7072c657b201e07 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Wed, 1 Oct 2025 16:07:52 +0800 Subject: [PATCH 1/9] Enhancement UI. --- .../EOM.TSHotelManagement.Common.csproj | 3 +- .../Util/RecordHelper.cs | 2 +- .../ClientCustomControls/ucRoom.cs | 24 +++---- .../ClientEntrance/FrmLoading.Designer.cs | 72 ++++++++++++------- .../ClientEntrance/FrmLoading.cs | 17 +++-- .../ClientEntrance/FrmLogin.Designer.cs | 2 +- .../ClientEntrance/FrmLogin.cs | 2 +- .../ClientMain/FrmMain.Designer.cs | 2 +- .../ClientMain/FrmMain.cs | 3 +- .../ClientModule/FrmAbout.Designer.cs | 2 +- .../FrmAccountSecurity.Designer.cs | 2 +- .../ClientModule/FrmAvator.Designer.cs | 2 +- .../ClientModule/FrmChangeRoom.Designer.cs | 2 +- .../ClientModule/FrmChangeRoom.cs | 3 +- .../ClientModule/FrmCheckIn.Designer.cs | 2 +- .../ClientModule/FrmCheckIn.cs | 4 +- .../FrmCheckOutDetail.Designer.cs | 2 +- .../ClientModule/FrmCheckOutDetail.cs | 2 +- .../ClientModule/FrmCustomerInfo.Designer.cs | 2 +- .../FrmCustomerManagement.Designer.cs | 2 +- .../ClientModule/FrmEditInputs.Designer.cs | 2 +- .../ClientModule/FrmEditInputs.cs | 5 +- .../ClientModule/FrmPersonnelInfo.Designer.cs | 2 +- .../ClientModule/FrmPersonnelInfo.cs | 3 +- .../ClientModule/FrmProgress.Designer.cs | 2 +- .../ClientModule/FrmReserList.Designer.cs | 2 +- .../FrmReserManagement.Designer.cs | 2 +- .../ClientModule/FrmReserManagement.cs | 4 +- .../ClientModule/FrmRoomManagement.cs | 1 - .../FrmRoomStateManagement.Designer.cs | 2 +- .../ClientModule/FrmRoomStateManagement.cs | 1 - .../ClientModule/FrmScreenLock.Designer.cs | 2 +- .../ClientModule/FrmSellThing.Designer.cs | 2 +- .../ClientModule/FrmSellThing.cs | 5 +- .../EOM.TSHotelManagement.FormUI.csproj | 7 -- topsky-hotel-management-system-web-api | 2 +- 36 files changed, 108 insertions(+), 88 deletions(-) diff --git a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj b/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj index fc0d7c3..5835996 100644 --- a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj +++ b/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj @@ -12,13 +12,12 @@ - + - diff --git a/EOM.TSHotelManagement.Common/Util/RecordHelper.cs b/EOM.TSHotelManagement.Common/Util/RecordHelper.cs index fbbb88c..a8f5bb7 100644 --- a/EOM.TSHotelManagement.Common/Util/RecordHelper.cs +++ b/EOM.TSHotelManagement.Common/Util/RecordHelper.cs @@ -1,5 +1,5 @@ using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Shared; using jvncorelib.CodeLib; using jvncorelib.EntityLib; diff --git a/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs index 3c67ced..bf82fc2 100644 --- a/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs +++ b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs @@ -194,19 +194,19 @@ namespace EOM.TSHotelManagement.FormUI } switch (romRoomInfo.RoomStateId) { - case (int)Common.Core.RoomState.Vacant: + case (int)Shared.RoomState.Vacant: btnRoom.BackgroundImage = Resources.可住状态; break; - case (int)Common.Core.RoomState.Occupied: + case (int)Shared.RoomState.Occupied: btnRoom.BackgroundImage = Resources.已住状态; break; - case (int)Common.Core.RoomState.Maintenance: + case (int)Shared.RoomState.Maintenance: btnRoom.BackgroundImage = Resources.维修状态; break; - case (int)Common.Core.RoomState.Dirty: + case (int)Shared.RoomState.Dirty: btnRoom.BackgroundImage = Resources.脏房状态; break; - case (int)Common.Core.RoomState.Reserved: + case (int)Shared.RoomState.Reserved: btnRoom.BackgroundImage = Resources.预约状态; break; } @@ -228,9 +228,9 @@ namespace EOM.TSHotelManagement.FormUI rm_RoomNo = romRoomInfo.RoomNumber; rm_RoomType = romRoomInfo.RoomName; rm_RoomMoney = Convert.ToDecimal(romRoomInfo.RoomRent).ToString(); - if (r.RoomStateId == new EnumHelper().GetEnumValue(Common.Core.RoomState.Reserved)) + if (r.RoomStateId == new EnumHelper().GetEnumValue(Shared.RoomState.Reserved)) { - rm_RoomStateId = (int)Common.Core.RoomState.Reserved; + rm_RoomStateId = (int)Shared.RoomState.Reserved; NotificationService.ShowInfo("欢迎入住,请先注册客户信息!"); FrmReserList frm = new FrmReserList(); frm.ShowDialog(); @@ -295,7 +295,7 @@ namespace EOM.TSHotelManagement.FormUI private void tsmiChangeState_Click(object sender, EventArgs e) { - if (r.RoomStateId == (int)Common.Core.RoomState.Reserved) + if (r.RoomStateId == (int)Shared.RoomState.Reserved) { var dr = AntdUI.Modal.open(new AntdUI.Modal.Config(null, UIMessageConstant.Warning, "当前房间已被预约,确认更改状态后将会删除原本预约状态及信息,你确定吗?", AntdUI.TType.Warn) { @@ -395,7 +395,7 @@ namespace EOM.TSHotelManagement.FormUI { switch (r.RoomStateId) { - case (int)Common.Core.RoomState.Vacant: + case (int)Shared.RoomState.Vacant: item.Enabled = item.Text switch { UIControlConstant.CheckInRoom => true, @@ -407,7 +407,7 @@ namespace EOM.TSHotelManagement.FormUI _ => item.Enabled }; break; - case (int)Common.Core.RoomState.Occupied: + case (int)Shared.RoomState.Occupied: item.Enabled = item.Text switch { UIControlConstant.CheckInRoom => false, @@ -419,8 +419,8 @@ namespace EOM.TSHotelManagement.FormUI _ => item.Enabled }; break; - case (int)Common.Core.RoomState.Maintenance: - case (int)Common.Core.RoomState.Dirty: + case (int)Shared.RoomState.Maintenance: + case (int)Shared.RoomState.Dirty: item.Enabled = item.Text switch { UIControlConstant.CheckInRoom => false, diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs index de19092..0806b7e 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs @@ -34,9 +34,10 @@ lblLocalSoftwareVersion = new AntdUI.Label(); label2 = new AntdUI.Label(); label1 = new AntdUI.Label(); - label3 = new AntdUI.Label(); - lblReleaseLog = new AntdUI.Input(); fbdSavePath = new FolderBrowserDialog(); + rtbReleaseLog = new RichTextBox(); + btnGo = new AntdUI.Button(); + btnExit = new AntdUI.Button(); SuspendLayout(); // // lblTips @@ -93,40 +94,57 @@ label1.Text = "本地程序版本:"; label1.TextAlign = ContentAlignment.MiddleCenter; // - // label3 - // - label3.BackColor = Color.Transparent; - label3.Font = new Font("Noto Sans SC", 9F); - label3.Location = new Point(43, 135); - label3.Name = "label3"; - label3.Size = new Size(103, 23); - label3.TabIndex = 8; - label3.Text = "程序更新日志:"; - label3.TextAlign = ContentAlignment.MiddleCenter; - // - // lblReleaseLog - // - lblReleaseLog.AutoScroll = true; - lblReleaseLog.Location = new Point(12, 164); - lblReleaseLog.Multiline = true; - lblReleaseLog.Name = "lblReleaseLog"; - lblReleaseLog.Size = new Size(311, 341); - lblReleaseLog.TabIndex = 9; + // rtbReleaseLog + // + rtbReleaseLog.BackColor = Color.FromArgb(243, 249, 255); + rtbReleaseLog.BorderStyle = BorderStyle.None; + rtbReleaseLog.Location = new Point(12, 135); + rtbReleaseLog.Name = "rtbReleaseLog"; + rtbReleaseLog.ReadOnly = true; + rtbReleaseLog.ScrollBars = RichTextBoxScrollBars.Vertical; + rtbReleaseLog.Size = new Size(311, 205); + rtbReleaseLog.TabIndex = 8; + rtbReleaseLog.Text = ""; + // + // btnGo + // + btnGo.Font = new Font("Noto Sans SC", 12F); + btnGo.Location = new Point(12, 346); + btnGo.Name = "btnGo"; + btnGo.Shape = AntdUI.TShape.Round; + btnGo.Size = new Size(111, 38); + btnGo.TabIndex = 35; + btnGo.Text = "进入系统"; + btnGo.Type = AntdUI.TTypeMini.Primary; + btnGo.Click += btnGo_Click; + // + // btnExit + // + btnExit.Font = new Font("Noto Sans SC", 12F); + btnExit.Location = new Point(212, 346); + btnExit.Name = "btnExit"; + btnExit.Shape = AntdUI.TShape.Round; + btnExit.Size = new Size(111, 38); + btnExit.TabIndex = 36; + btnExit.Text = "退出系统"; + btnExit.Type = AntdUI.TTypeMini.Primary; + btnExit.Click += btnExit_Click; // // FrmLoading // AutoScaleMode = AutoScaleMode.None; BackColor = Color.FromArgb(243, 249, 255); - ClientSize = new Size(335, 517); - Controls.Add(lblReleaseLog); - Controls.Add(label3); + ClientSize = new Size(335, 390); + Controls.Add(btnExit); + Controls.Add(btnGo); + Controls.Add(rtbReleaseLog); Controls.Add(lbInternetSoftwareVersion); Controls.Add(lblLocalSoftwareVersion); Controls.Add(label2); Controls.Add(label1); Controls.Add(lblTips); Font = new Font("Noto Sans SC", 9F); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); MaximizeBox = false; MinimizeBox = false; @@ -145,7 +163,9 @@ private AntdUI.Label label2; private AntdUI.Label label1; private AntdUI.Label label3; - private AntdUI.Input lblReleaseLog; private FolderBrowserDialog fbdSavePath; + private RichTextBox rtbReleaseLog; + private AntdUI.Button btnGo; + private AntdUI.Button btnExit; } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs index 22de129..153bb18 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs @@ -95,16 +95,13 @@ namespace EOM.TSHotelManagement.FormUI bool isGitee) where TAsset : class { var version = tagName.Replace("v", string.Empty); - lblReleaseLog.Text = $"{releaseBody}"; - lblReleaseLog.Refresh(); + rtbReleaseLog.Text = $"{releaseBody}"; lbInternetSoftwareVersion.Text = version; lbInternetSoftwareVersion.Refresh(); if (version.Equals(lblLocalSoftwareVersion.Text.Trim())) { LoginInfo.SoftwareReleaseLog = $"{releaseBody}"; - NotificationService.ShowSuccess("当前已是最新版本,无需更新!3秒后将自动跳转登录页面"); - Task.Delay(3000).Wait(); - Task.Run(() => threadPro()); + NotificationService.ShowSuccess("当前已是最新版本,无需更新!"); return; } @@ -350,5 +347,15 @@ namespace EOM.TSHotelManagement.FormUI [JsonProperty("avatar_url")] public string AvatarUrl { get; set; } } + + private void btnGo_Click(object sender, EventArgs e) + { + Task.Run(() => threadPro()); + } + + private void btnExit_Click(object sender, EventArgs e) + { + ExitApplication(); + } } } diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.Designer.cs index 189cfa6..cb9afe0 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.Designer.cs @@ -164,7 +164,7 @@ Controls.Add(txtWorkerPwd); Controls.Add(txtAccount); Controls.Add(label2); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Margin = new Padding(4); Name = "FrmLogin"; diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs index ab62a35..eb3a016 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs @@ -178,7 +178,7 @@ namespace EOM.TSHotelManagement.FormUI } catch (Exception ex) { - RecordHelper.Record(LocalizationHelper.GetLocalizedString($"Login error:{ex.Message}", $"登录异常:{ex.Message}"), Common.Core.LogLevel.Critical); + RecordHelper.Record(LocalizationHelper.GetLocalizedString($"Login error:{ex.Message}", $"登录异常:{ex.Message}"), Shared.LogLevel.Critical); NotificationService.ShowError(LocalizationHelper.GetLocalizedString("The server is under maintenance, please try again later", "服务器维护中,请稍后再试!")); } } diff --git a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.Designer.cs index acf83d4..03e3b82 100644 --- a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.Designer.cs @@ -295,7 +295,7 @@ Controls.Add(pnlMID); Controls.Add(picLogo); Controls.Add(lblSoftName); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Margin = new Padding(4); Name = "FrmMain"; diff --git a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs index 55954f0..263ca90 100644 --- a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs +++ b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs @@ -27,6 +27,7 @@ using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.FormUI.Properties; +using EOM.TSHotelManagement.Shared; using jvncorelib.CodeLib; using jvncorelib.EntityLib; using System.Diagnostics; @@ -56,7 +57,7 @@ namespace EOM.TSHotelManagement.FormUI // 接受Form1对象 this.returnForm1 = F1; #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "版本登入了系统!", Common.Core.LogLevel.Critical); + RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "版本登入了系统!", LogLevel.Critical); #endregion Stop = StopUseExit; Start = StartUseExit; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.Designer.cs index 14611b9..29d7983 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.Designer.cs @@ -177,7 +177,7 @@ Controls.Add(lblClientVersionDescriotion); Controls.Add(lblSoftName); Controls.Add(picLogo); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Margin = new Padding(2); Name = "FrmAbout"; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs index 807d38e..a96a4a0 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs @@ -140,7 +140,7 @@ Controls.Add(avatar1); Controls.Add(btnUpdatePassword); Controls.Add(txtNewPassword); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Name = "FrmAccountSecurity"; Resizable = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs index f97042d..2be7ef1 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs @@ -80,7 +80,7 @@ Controls.Add(ucWindowHeader1); Controls.Add(label4); Controls.Add(picWorkerPic); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Name = "FrmAvator"; Resizable = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.Designer.cs index 01d3d02..a5a7892 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.Designer.cs @@ -111,7 +111,7 @@ Controls.Add(label1); Controls.Add(label24); Controls.Add(ucWindowHeader1); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Margin = new Padding(2); MaximizeBox = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs index 9f2d889..83484ff 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs @@ -25,6 +25,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; namespace EOM.TSHotelManagement.FormUI @@ -84,7 +85,7 @@ namespace EOM.TSHotelManagement.FormUI FrmRoomManager.Reload(""); FrmRoomManager._RefreshRoomCount(); #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + transferRoom.DataChgDate + "位于" + LoginInfo.SoftwareVersion + "执行:" + transferRoom.CustomerNumber + "于" + transferRoom.DataChgDate + "进行了换房!", Common.Core.LogLevel.Warning); + RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + transferRoom.DataChgDate + "位于" + LoginInfo.SoftwareVersion + "执行:" + transferRoom.CustomerNumber + "于" + transferRoom.DataChgDate + "进行了换房!", LogLevel.Warning); #endregion NotificationService.ShowSuccess("转房成功"); this.Close(); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.Designer.cs index d9177ae..3329a99 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.Designer.cs @@ -319,7 +319,7 @@ Controls.Add(label19); Controls.Add(label20); Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Margin = new Padding(4, 5, 4, 5); Name = "FrmCheckIn"; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs index 92453d0..882e1cd 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs @@ -26,7 +26,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Transactions; @@ -192,7 +192,7 @@ namespace EOM.TSHotelManagement.FormUI FrmRoomManager.Reload(""); FrmRoomManager._RefreshRoomCount(); #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerClub + "-" + LoginInfo.WorkerPosition + "-" + LoginInfo.WorkerName + "于" + Convert.ToDateTime(DateTime.Now) + "帮助" + r.CustomerNumber + "进行了入住操作!", Common.Core.LogLevel.Normal); + RecordHelper.Record(LoginInfo.WorkerClub + "-" + LoginInfo.WorkerPosition + "-" + LoginInfo.WorkerName + "于" + Convert.ToDateTime(DateTime.Now) + "帮助" + r.CustomerNumber + "进行了入住操作!", LogLevel.Normal); #endregion scope.Complete(); this.Close(); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs index 44eb3f3..af40bb6 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs @@ -346,7 +346,7 @@ Controls.Add(label15); Controls.Add(lblDay); Controls.Add(label17); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Name = "FrmCheckOutDetail"; Resizable = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs index 74ab54a..f772a3d 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs @@ -199,7 +199,7 @@ namespace EOM.TSHotelManagement.FormUI FrmRoomManager._RefreshRoomCount(); #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerClub + "-" + LoginInfo.WorkerPosition + "-" + LoginInfo.WorkerName + "于" + Convert.ToDateTime(DateTime.Now) + "帮助" + CustoNo.Text + "进行了退房结算操作!", Common.Core.LogLevel.Critical); + RecordHelper.Record(LoginInfo.WorkerClub + "-" + LoginInfo.WorkerPosition + "-" + LoginInfo.WorkerName + "于" + Convert.ToDateTime(DateTime.Now) + "帮助" + CustoNo.Text + "进行了退房结算操作!", LogLevel.Critical); #endregion this.Close(); } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.Designer.cs index 9338d0e..c8537ec 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.Designer.cs @@ -270,7 +270,7 @@ Controls.Add(label4); Controls.Add(label3); Controls.Add(label2); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); MaximizeBox = false; MinimizeBox = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs index 303ea3c..86a3d76 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs @@ -193,7 +193,7 @@ Controls.Add(btnUpdCustomer); Controls.Add(btnAddCusto); Controls.Add(btnSerach); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Margin = new Padding(4); Name = "FrmCustomerManager"; StartPosition = FormStartPosition.CenterScreen; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.Designer.cs index a22ed94..a4362dd 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.Designer.cs @@ -277,7 +277,7 @@ Controls.Add(label4); Controls.Add(label3); Controls.Add(label2); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); MaximizeBox = false; MinimizeBox = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs index ce87bc7..ec03c61 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs @@ -25,6 +25,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.CodeLib; using jvncorelib.EntityLib; @@ -148,7 +149,7 @@ namespace EOM.TSHotelManagement.FormUI NotificationService.ShowSuccess("修改成功"); #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "修改了一名客户信息,客户编号为:" + custo.CustomerNumber, Common.Core.LogLevel.Critical); + RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "修改了一名客户信息,客户编号为:" + custo.CustomerNumber, LogLevel.Critical); #endregion this.Close(); FrmCustomerManager.ReloadCustomer(false); @@ -182,7 +183,7 @@ namespace EOM.TSHotelManagement.FormUI NotificationService.ShowSuccess("添加成功"); FrmCustomerManager.ReloadCustomer(false); #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "添加了一名客户,客户编号为:" + custo.CustomerNumber, Common.Core.LogLevel.Critical); + RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "添加了一名客户,客户编号为:" + custo.CustomerNumber, LogLevel.Critical); #endregion this.Close(); } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.Designer.cs index d6f798d..baf2445 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.Designer.cs @@ -257,7 +257,7 @@ Controls.Add(label1); Controls.Add(label2); Controls.Add(label16); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Name = "FrmPersonnelInfo"; Resizable = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs index f30ffe8..51bf59b 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs @@ -1,6 +1,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Data; @@ -160,7 +161,7 @@ namespace EOM.TSHotelManagement.FormUI } NotificationService.ShowSuccess("修改成功!"); #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "修改个人信息操作!", Common.Core.LogLevel.Warning); + RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "修改个人信息操作!", LogLevel.Warning); #endregion LoadPersonnelInfo(); return; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmProgress.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmProgress.Designer.cs index 8068461..319a074 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmProgress.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmProgress.Designer.cs @@ -50,7 +50,7 @@ BackColor = Color.FromArgb(235, 243, 255); ClientSize = new Size(155, 110); Controls.Add(spin1); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); MaximizeBox = false; MinimizeBox = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.Designer.cs index f76b7f7..ec19e78 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.Designer.cs @@ -306,7 +306,7 @@ Controls.Add(label4); Controls.Add(label3); Controls.Add(label2); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Name = "FrmReserList"; Resizable = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.Designer.cs index f4cfef3..7e1fe4f 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.Designer.cs @@ -217,7 +217,7 @@ Controls.Add(label10); Controls.Add(label1); Controls.Add(label9); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Name = "FrmReserManager"; Resizable = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs index c328bf3..5fa32be 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs @@ -24,7 +24,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Shared; using jvncorelib.CodeLib; using jvncorelib.EntityLib; using System.Transactions; @@ -89,7 +89,7 @@ namespace EOM.TSHotelManagement.FormUI } NotificationService.ShowSuccess("预约成功!请在指定时间内进行登记入住"); #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + Convert.ToDateTime(DateTime.Now) + "帮助" + txtCustoTel.Text + "进行了预订房间操作!", Common.Core.LogLevel.Normal); + RecordHelper.Record(LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + Convert.ToDateTime(DateTime.Now) + "帮助" + txtCustoTel.Text + "进行了预订房间操作!", LogLevel.Normal); #endregion scope.Complete(); FrmRoomManager.Reload(""); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs index 79a5e5d..927230e 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs @@ -25,7 +25,6 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; using EOM.TSHotelManagement.FormUI.Properties; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.Designer.cs index 1964a7e..ff3065b 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.Designer.cs @@ -112,7 +112,7 @@ Controls.Add(label1); Controls.Add(label2); Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point, 134); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); Margin = new Padding(3, 4, 3, 4); MaximizeBox = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs index cffc023..e23d65c 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs @@ -25,7 +25,6 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.Designer.cs index 8a5f7b8..8235175 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.Designer.cs @@ -70,7 +70,7 @@ ClientSize = new Size(800, 450); Controls.Add(btnUnlock); Controls.Add(txtPassword); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); MaximizeBox = false; MinimizeBox = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs index 0acb8b8..c16b8a2 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs @@ -317,7 +317,7 @@ Controls.Add(txtFind); Controls.Add(label1); Controls.Add(groupBox2); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); MaximizeBox = false; MinimizeBox = false; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs index 753da66..809ec9b 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs @@ -25,7 +25,6 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; @@ -323,13 +322,13 @@ namespace EOM.TSHotelManagement.FormUI var updateResponse = HttpHelper.JsonToModel(result.message); if (updateResponse.Success == false) { - RecordHelper.Record($"接口异常。Message:\n{updateResponse.Message}", Common.Core.LogLevel.Critical); + RecordHelper.Record($"接口异常。Message:\n{updateResponse.Message}", LogLevel.Critical); NotificationService.ShowError($"{ApiConstants.Sellthing_UpdateSellthingInfo}+接口服务异常,请提交Issue或尝试更新版本!"); return; } NotificationService.ShowSuccess("撤销成功!"); #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "帮助" + spend.CustomerNumber + "撤销了消费商品:" + txtSellName.Text + "操作!", Common.Core.LogLevel.Warning); + RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "帮助" + spend.CustomerNumber + "撤销了消费商品:" + txtSellName.Text + "操作!", LogLevel.Warning); #endregion LoadSpendInfoByRoomNo(r); LoadSellThingInfo(); diff --git a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj index c56024d..435b8fc 100644 --- a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj +++ b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj @@ -102,13 +102,6 @@ True True - - - True - True - True - - diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api index ccf133f..02db821 160000 --- a/topsky-hotel-management-system-web-api +++ b/topsky-hotel-management-system-web-api @@ -1 +1 @@ -Subproject commit ccf133f885049974dd3cc5078406ba4d13eb42db +Subproject commit 02db8213232c6c9ca6b01f8d4eff84a6c1e15ace -- Gitee From a7ee3497766238c9a17aceb73f68fa27bd0d2ea2 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Fri, 3 Oct 2025 20:49:30 +0800 Subject: [PATCH 2/9] update winform name. --- .../ClientMain/FrmMain.cs | 6 ++--- .../FrmCustomerManagement.Designer.cs | 9 +++---- .../ClientModule/FrmCustomerManagement.cs | 7 ++--- .../ClientModule/FrmEditInputs.cs | 24 ++++++++--------- .../FrmRoomManagement.Designer.cs | 26 +++++++++---------- .../EOM.TSHotelManagement.FormUI.csproj | 2 +- topsky-hotel-management-system-web-api | 2 +- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs index 263ca90..7a8cdc4 100644 --- a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs +++ b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs @@ -520,12 +520,12 @@ namespace EOM.TSHotelManagement.FormUI break; case "客户管理": pnlMID.Controls.Clear(); - FrmCustomerManager frmCustomerManager = new() + FrmCustomerManagement frmCustomerManagement = new() { TopLevel = false }; - pnlMID.Controls.Add(frmCustomerManager); - frmCustomerManager.Show(); + pnlMID.Controls.Add(frmCustomerManagement); + frmCustomerManagement.Show(); break; case "商品消费": pnlMID.Controls.Clear(); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs index 86a3d76..dc9d4a2 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs @@ -1,6 +1,6 @@ namespace EOM.TSHotelManagement.FormUI { - partial class FrmCustomerManager + partial class FrmCustomerManagement { /// /// Required designer variable. @@ -177,7 +177,7 @@ divider1.Text = "右键可复制快速客户编号"; divider1.Thickness = 1F; // - // FrmCustomerManager + // FrmCustomerManagement // AutoScaleDimensions = new SizeF(7F, 17F); AutoScaleMode = AutoScaleMode.Font; @@ -195,10 +195,9 @@ Controls.Add(btnSerach); FormBorderStyle = FormBorderStyle.FixedSingle; Margin = new Padding(4); - Name = "FrmCustomerManager"; - StartPosition = FormStartPosition.CenterScreen; + Name = "FrmCustomerManagement"; Text = "TS酒店管理系统"; - Load += FrmCustomerManager_Load; + Load += FrmCustomerManagement_Load; cmsCustomerAction.ResumeLayout(false); ResumeLayout(false); } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs index 692e14f..b77810e 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs @@ -22,6 +22,7 @@ * */ +using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; using jvncorelib.EntityLib; @@ -29,7 +30,7 @@ using System.Runtime.InteropServices; namespace EOM.TSHotelManagement.FormUI { - public partial class FrmCustomerManager : Form + public partial class FrmCustomerManagement : Window { public static int cm_CustoId; public static string cm_CustoNo; @@ -51,7 +52,7 @@ namespace EOM.TSHotelManagement.FormUI public static ReloadCustomerList ReloadCustomer; private LoadingProgress _loadingProgress; - public FrmCustomerManager() + public FrmCustomerManagement() { InitializeComponent(); _loadingProgress = new LoadingProgress(); @@ -64,7 +65,7 @@ namespace EOM.TSHotelManagement.FormUI TableComHelper helper = new TableComHelper(); #region 用户管理界面加载事件方法 - private void FrmCustomerManager_Load(object sender, EventArgs e) + private void FrmCustomerManagement_Load(object sender, EventArgs e) { this.btnPg.PageSize = 15; LoadCustomer(); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs index ec03c61..3250e18 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs @@ -97,15 +97,15 @@ namespace EOM.TSHotelManagement.FormUI if (this.Text.Equals("修改客户信息")) { - txtCustomerId.Text = FrmCustomerManager.cm_CustoNo; - txtCustomerName.Text = FrmCustomerManager.cm_CustoName; - txtCustomerAddress.Text = FrmCustomerManager.cm_CustoAddress; - cboCustomerType.SelectedValue = FrmCustomerManager.cm_CustoType; - cboGender.SelectedValue = FrmCustomerManager.cm_CustoSex; - cboPassportType.SelectedValue = FrmCustomerManager.cm_PassportType; - dtpDateOfBirth.Value = FrmCustomerManager.cm_CustoBirth; - txtCustomerCardID.Text = FrmCustomerManager.cm_CustoIdCardNumber; - txtCustomerTel.Text = FrmCustomerManager.cm_CustoTel; + txtCustomerId.Text = FrmCustomerManagement.cm_CustoNo; + txtCustomerName.Text = FrmCustomerManagement.cm_CustoName; + txtCustomerAddress.Text = FrmCustomerManagement.cm_CustoAddress; + cboCustomerType.SelectedValue = FrmCustomerManagement.cm_CustoType; + cboGender.SelectedValue = FrmCustomerManagement.cm_CustoSex; + cboPassportType.SelectedValue = FrmCustomerManagement.cm_PassportType; + dtpDateOfBirth.Value = FrmCustomerManagement.cm_CustoBirth; + txtCustomerCardID.Text = FrmCustomerManagement.cm_CustoIdCardNumber; + txtCustomerTel.Text = FrmCustomerManagement.cm_CustoTel; btnOk.Text = "修改"; this.btnOk.Click -= new EventHandler(FrmEditInputs_ButtonOkClick); @@ -125,7 +125,7 @@ namespace EOM.TSHotelManagement.FormUI { UpdateCustomerInputDto custo = new UpdateCustomerInputDto() { - Id = FrmCustomerManager.cm_CustoId, + Id = FrmCustomerManagement.cm_CustoId, CustomerNumber = txtCustomerId.Text, CustomerName = txtCustomerName.Text, CustomerGender = Convert.ToInt32(cboGender.SelectedValue.ToString()), @@ -152,7 +152,7 @@ namespace EOM.TSHotelManagement.FormUI RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "修改了一名客户信息,客户编号为:" + custo.CustomerNumber, LogLevel.Critical); #endregion this.Close(); - FrmCustomerManager.ReloadCustomer(false); + FrmCustomerManagement.ReloadCustomer(false); } private void FrmEditInputs_ButtonOkClick(object sender, EventArgs e) @@ -181,7 +181,7 @@ namespace EOM.TSHotelManagement.FormUI return; } NotificationService.ShowSuccess("添加成功"); - FrmCustomerManager.ReloadCustomer(false); + FrmCustomerManagement.ReloadCustomer(false); #region 获取添加操作日志所需的信息 RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "添加了一名客户,客户编号为:" + custo.CustomerNumber, LogLevel.Critical); #endregion diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs index b8b3023..46ef56e 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs @@ -58,10 +58,10 @@ pnlRoomInfo.Controls.Add(label3); pnlRoomInfo.Controls.Add(label2); pnlRoomInfo.Controls.Add(label1); - pnlRoomInfo.Location = new Point(3, 273); + pnlRoomInfo.Location = new Point(3, 339); pnlRoomInfo.Margin = new Padding(4); pnlRoomInfo.Name = "pnlRoomInfo"; - pnlRoomInfo.Size = new Size(255, 346); + pnlRoomInfo.Size = new Size(255, 280); pnlRoomInfo.TabIndex = 72; // // lblRoomState @@ -71,7 +71,7 @@ lblRoomState.Location = new Point(108, 173); lblRoomState.Margin = new Padding(4, 0, 4, 0); lblRoomState.Name = "lblRoomState"; - lblRoomState.Size = new Size(12, 17); + lblRoomState.Size = new Size(14, 24); lblRoomState.TabIndex = 16; lblRoomState.Text = " "; // @@ -82,7 +82,7 @@ label11.Location = new Point(11, 173); label11.Margin = new Padding(4, 0, 4, 0); label11.Name = "label11"; - label11.Size = new Size(88, 17); + label11.Size = new Size(90, 24); label11.TabIndex = 15; label11.Text = "房间状态:"; // @@ -93,7 +93,7 @@ lblRoomNo.Location = new Point(108, 13); lblRoomNo.Margin = new Padding(4, 0, 4, 0); lblRoomNo.Name = "lblRoomNo"; - lblRoomNo.Size = new Size(12, 17); + lblRoomNo.Size = new Size(14, 24); lblRoomNo.TabIndex = 14; lblRoomNo.Text = " "; // @@ -104,7 +104,7 @@ lblCustoName.Location = new Point(108, 53); lblCustoName.Margin = new Padding(4, 0, 4, 0); lblCustoName.Name = "lblCustoName"; - lblCustoName.Size = new Size(12, 17); + lblCustoName.Size = new Size(14, 24); lblCustoName.TabIndex = 12; lblCustoName.Text = " "; // @@ -115,7 +115,7 @@ lblRoomPosition.Location = new Point(108, 133); lblRoomPosition.Margin = new Padding(4, 0, 4, 0); lblRoomPosition.Name = "lblRoomPosition"; - lblRoomPosition.Size = new Size(12, 17); + lblRoomPosition.Size = new Size(14, 24); lblRoomPosition.TabIndex = 10; lblRoomPosition.Text = " "; // @@ -126,7 +126,7 @@ lblCheckTime.Location = new Point(108, 93); lblCheckTime.Margin = new Padding(4, 0, 4, 0); lblCheckTime.Name = "lblCheckTime"; - lblCheckTime.Size = new Size(12, 17); + lblCheckTime.Size = new Size(14, 24); lblCheckTime.TabIndex = 9; lblCheckTime.Text = " "; // @@ -137,7 +137,7 @@ label4.Location = new Point(11, 133); label4.Margin = new Padding(4, 0, 4, 0); label4.Name = "label4"; - label4.Size = new Size(88, 17); + label4.Size = new Size(90, 24); label4.TabIndex = 3; label4.Text = "所在区域:"; // @@ -148,7 +148,7 @@ label3.Location = new Point(11, 93); label3.Margin = new Padding(4, 0, 4, 0); label3.Name = "label3"; - label3.Size = new Size(88, 17); + label3.Size = new Size(90, 24); label3.TabIndex = 2; label3.Text = "入住时间:"; // @@ -159,7 +159,7 @@ label2.Location = new Point(11, 53); label2.Margin = new Padding(4, 0, 4, 0); label2.Name = "label2"; - label2.Size = new Size(88, 17); + label2.Size = new Size(90, 24); label2.TabIndex = 1; label2.Text = "客户名字:"; // @@ -170,7 +170,7 @@ label1.Location = new Point(11, 13); label1.Margin = new Padding(4, 0, 4, 0); label1.Name = "label1"; - label1.Size = new Size(88, 17); + label1.Size = new Size(90, 24); label1.TabIndex = 0; label1.Text = "房间号码:"; // @@ -181,7 +181,7 @@ muRoomState.Location = new Point(2, 4); muRoomState.Mode = AntdUI.TMenuMode.Vertical; muRoomState.Name = "muRoomState"; - muRoomState.Size = new Size(255, 262); + muRoomState.Size = new Size(255, 328); muRoomState.TabIndex = 96; muRoomState.SelectChanged += muRoomState_SelectChanged; // diff --git a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj index 435b8fc..a33ed3a 100644 --- a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj +++ b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj @@ -38,7 +38,7 @@ Form - + Form diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api index 02db821..dfbd3a5 160000 --- a/topsky-hotel-management-system-web-api +++ b/topsky-hotel-management-system-web-api @@ -1 +1 @@ -Subproject commit 02db8213232c6c9ca6b01f8d4eff84a6c1e15ace +Subproject commit dfbd3a5659c889a5a2dc2b604609df6f89518ab0 -- Gitee From 562d4838cfbdbbd4312e267c80ca72934e21f689 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 4 Oct 2025 15:42:46 +0800 Subject: [PATCH 3/9] adjustment ui. --- .../Util/ApplicationUtil.cs | 9 +++++ .../ClientEntrance/FrmLoading.Designer.cs | 22 +++++++++-- .../ClientEntrance/FrmLoading.cs | 13 +++++-- .../FrmCheckOutDetail.Designer.cs | 34 ++++++++-------- .../FrmRoomManagement.Designer.cs | 6 +-- .../ClientModule/FrmSellThing.Designer.cs | 39 +++++++------------ .../ClientModule/FrmSellThing.cs | 3 -- topsky-hotel-management-system-web-api | 2 +- 8 files changed, 72 insertions(+), 56 deletions(-) diff --git a/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs b/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs index d84931e..363af44 100644 --- a/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs +++ b/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs @@ -120,6 +120,15 @@ namespace EOM.TSHotelManagement.Common return LocalizationHelper.GetLocalizedString("TopSky Hotel Management System", "TS酒店管理系统"); } + /// + /// 获取当前软件的公司名称 + /// + /// + public static string GetApplicationCompanyName() + { + return LocalizationHelper.GetLocalizedString("Easy Open Meta", "Easy Open Meta"); + } + /// /// 身份证实体类 /// diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs index 0806b7e..3595ed9 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs @@ -38,6 +38,7 @@ rtbReleaseLog = new RichTextBox(); btnGo = new AntdUI.Button(); btnExit = new AntdUI.Button(); + label4 = new AntdUI.Label(); SuspendLayout(); // // lblTips @@ -98,7 +99,7 @@ // rtbReleaseLog.BackColor = Color.FromArgb(243, 249, 255); rtbReleaseLog.BorderStyle = BorderStyle.None; - rtbReleaseLog.Location = new Point(12, 135); + rtbReleaseLog.Location = new Point(12, 167); rtbReleaseLog.Name = "rtbReleaseLog"; rtbReleaseLog.ReadOnly = true; rtbReleaseLog.ScrollBars = RichTextBoxScrollBars.Vertical; @@ -109,7 +110,7 @@ // btnGo // btnGo.Font = new Font("Noto Sans SC", 12F); - btnGo.Location = new Point(12, 346); + btnGo.Location = new Point(12, 378); btnGo.Name = "btnGo"; btnGo.Shape = AntdUI.TShape.Round; btnGo.Size = new Size(111, 38); @@ -121,7 +122,7 @@ // btnExit // btnExit.Font = new Font("Noto Sans SC", 12F); - btnExit.Location = new Point(212, 346); + btnExit.Location = new Point(212, 378); btnExit.Name = "btnExit"; btnExit.Shape = AntdUI.TShape.Round; btnExit.Size = new Size(111, 38); @@ -130,11 +131,23 @@ btnExit.Type = AntdUI.TTypeMini.Primary; btnExit.Click += btnExit_Click; // + // label4 + // + label4.BackColor = Color.Transparent; + label4.Font = new Font("Noto Sans SC", 9F); + label4.Location = new Point(43, 135); + label4.Name = "label4"; + label4.Size = new Size(103, 23); + label4.TabIndex = 37; + label4.Text = "程序更新日志:"; + label4.TextAlign = ContentAlignment.MiddleCenter; + // // FrmLoading // AutoScaleMode = AutoScaleMode.None; BackColor = Color.FromArgb(243, 249, 255); - ClientSize = new Size(335, 390); + ClientSize = new Size(335, 424); + Controls.Add(label4); Controls.Add(btnExit); Controls.Add(btnGo); Controls.Add(rtbReleaseLog); @@ -167,5 +180,6 @@ private RichTextBox rtbReleaseLog; private AntdUI.Button btnGo; private AntdUI.Button btnExit; + private AntdUI.Label label4; } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs index 153bb18..388da47 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs @@ -25,6 +25,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Util; using Newtonsoft.Json; +using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -36,8 +37,8 @@ namespace EOM.TSHotelManagement.FormUI private string GithubRepoUrl => "https://api.github.com/repos/easy-open-meta/TopskyHotelManagerSystem/releases/latest"; private string GiteeRepoUrl => "https://gitee.com/api/v5/repos/java-and-net/TopskyHotelManagerSystem/releases/latest"; private string GithubProxyUrl => "https://ghproxy.oscode.top"; - private string FolderName => "TSHotelUpgradePackages"; - private string FallbackUrl => "https://pan.gkhive.com/%E6%9C%AC%E5%9C%B0%E7%A3%81%E7%9B%98/blog_files/TS%E9%85%92%E5%BA%97%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%89%88%E6%9C%AC%E5%BA%93"; + private string AppDataPath => Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); + private string FallbackUrl => "https://pan.gkhive.com/TSHotel"; private ProgressBar progressBar; @@ -100,8 +101,10 @@ namespace EOM.TSHotelManagement.FormUI lbInternetSoftwareVersion.Refresh(); if (version.Equals(lblLocalSoftwareVersion.Text.Trim())) { + progressBar.Value = 100; LoginInfo.SoftwareReleaseLog = $"{releaseBody}"; - NotificationService.ShowSuccess("当前已是最新版本,无需更新!"); + NotificationService.ShowSuccess(LocalizationHelper.GetLocalizedString("The current version is already the latest, no need to update!", "当前已是最新版本,无需更新!")); + lblTips.Text = LocalizationHelper.GetLocalizedString("The current version is already the latest, no need to update!", "当前已是最新版本,无需更新!"); return; } @@ -164,7 +167,9 @@ namespace EOM.TSHotelManagement.FormUI string selectedPath = fbdSavePath.SelectedPath; - string targetDirectory = Path.Combine(selectedPath, FolderName, tagName); + string targetDirectory = Path.Combine(selectedPath ?? AppDataPath, + ApplicationUtil.GetApplicationCompanyName(), + ApplicationUtil.GetApplicationName(), tagName); if (!Path.Exists(targetDirectory)) Directory.CreateDirectory(targetDirectory); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs index af40bb6..8079c50 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs @@ -73,7 +73,7 @@ label24.Font = new Font("Noto Sans SC", 14.2499981F); label24.Location = new Point(18, 61); label24.Name = "label24"; - label24.Size = new Size(85, 19); + label24.Size = new Size(88, 27); label24.TabIndex = 172; label24.Text = "客户编号"; // @@ -94,7 +94,7 @@ label27.Font = new Font("Noto Sans SC", 14.2499981F); label27.Location = new Point(323, 113); label27.Name = "label27"; - label27.Size = new Size(85, 19); + label27.Size = new Size(88, 27); label27.TabIndex = 175; label27.Text = "房间编号"; // @@ -115,7 +115,7 @@ label28.Font = new Font("Noto Sans SC", 14.2499981F); label28.Location = new Point(323, 61); label28.Name = "label28"; - label28.Size = new Size(85, 19); + label28.Size = new Size(88, 27); label28.TabIndex = 174; label28.Text = "入住时间"; // @@ -136,7 +136,7 @@ lblChange.Font = new Font("Noto Sans SC", 11.9999981F); lblChange.Location = new Point(605, 445); lblChange.Name = "lblChange"; - lblChange.Size = new Size(38, 17); + lblChange.Size = new Size(41, 24); lblChange.TabIndex = 167; lblChange.Text = "0.00"; // @@ -158,7 +158,7 @@ label25.Font = new Font("Noto Sans SC", 11.9999981F); label25.Location = new Point(323, 444); label25.Name = "label25"; - label25.Size = new Size(88, 17); + label25.Size = new Size(90, 24); label25.TabIndex = 168; label25.Text = "会员折扣:"; // @@ -166,11 +166,11 @@ // txtReceipts.Font = new Font("Noto Sans SC", 11.9999981F, FontStyle.Regular, GraphicsUnit.Point, 0); txtReceipts.HandCursor = Cursors.IBeam; - txtReceipts.Location = new Point(404, 468); + txtReceipts.Location = new Point(404, 475); txtReceipts.Name = "txtReceipts"; txtReceipts.PlaceholderText = ""; txtReceipts.Round = true; - txtReceipts.Size = new Size(201, 36); + txtReceipts.Size = new Size(242, 36); txtReceipts.TabIndex = 180; txtReceipts.TextChanged += txtReceipts_TextChanged; // @@ -180,7 +180,7 @@ label21.Font = new Font("Noto Sans SC", 11.9999981F); label21.Location = new Point(517, 445); label21.Name = "label21"; - label21.Size = new Size(88, 17); + label21.Size = new Size(90, 24); label21.TabIndex = 166; label21.Text = "找 零:"; // @@ -203,7 +203,7 @@ lblVIP.Font = new Font("Noto Sans SC", 11.9999981F); lblVIP.Location = new Point(412, 444); lblVIP.Name = "lblVIP"; - lblVIP.Size = new Size(72, 17); + lblVIP.Size = new Size(74, 24); lblVIP.TabIndex = 169; lblVIP.Text = "不 打 折"; // @@ -223,7 +223,7 @@ label29.Font = new Font("Noto Sans SC", 14.2499981F, FontStyle.Regular, GraphicsUnit.Point, 0); label29.Location = new Point(591, 61); label29.Name = "label29"; - label29.Size = new Size(85, 19); + label29.Size = new Size(88, 27); label29.TabIndex = 176; label29.Text = "已住天数"; // @@ -233,7 +233,7 @@ lblGetReceipts.Font = new Font("Noto Sans SC", 11.9999981F); lblGetReceipts.Location = new Point(413, 412); lblGetReceipts.Name = "lblGetReceipts"; - lblGetReceipts.Size = new Size(38, 17); + lblGetReceipts.Size = new Size(41, 24); lblGetReceipts.TabIndex = 165; lblGetReceipts.Text = "0.00"; // @@ -243,7 +243,7 @@ lblVIPPrice.Font = new Font("Noto Sans SC", 11.9999981F); lblVIPPrice.Location = new Point(605, 413); lblVIPPrice.Name = "lblVIPPrice"; - lblVIPPrice.Size = new Size(38, 17); + lblVIPPrice.Size = new Size(41, 24); lblVIPPrice.TabIndex = 171; lblVIPPrice.Text = "0.00"; // @@ -253,7 +253,7 @@ lable00.Font = new Font("Noto Sans SC", 11.9999981F); lable00.Location = new Point(517, 413); lable00.Name = "lable00"; - lable00.Size = new Size(88, 17); + lable00.Size = new Size(90, 24); lable00.TabIndex = 170; lable00.Text = "应付金额:"; // @@ -263,7 +263,7 @@ label18.Font = new Font("Noto Sans SC", 11.9999981F); label18.Location = new Point(323, 412); label18.Name = "label18"; - label18.Size = new Size(88, 17); + label18.Size = new Size(90, 24); label18.TabIndex = 164; label18.Text = "消费总额:"; // @@ -273,7 +273,7 @@ label1.Font = new Font("Noto Sans SC", 14.2499981F); label1.Location = new Point(18, 113); label1.Name = "label1"; - label1.Size = new Size(85, 19); + label1.Size = new Size(88, 27); label1.TabIndex = 173; label1.Text = "客户姓名"; // @@ -294,7 +294,7 @@ lblDay.Font = new Font("Noto Sans SC", 14.9999981F, FontStyle.Regular, GraphicsUnit.Point, 0); lblDay.Location = new Point(608, 112); lblDay.Name = "lblDay"; - lblDay.Size = new Size(45, 20); + lblDay.Size = new Size(51, 29); lblDay.TabIndex = 177; lblDay.Text = "Null"; // @@ -304,7 +304,7 @@ label17.Font = new Font("Noto Sans SC", 11.9999981F); label17.Location = new Point(323, 479); label17.Name = "label17"; - label17.Size = new Size(88, 17); + label17.Size = new Size(90, 24); label17.TabIndex = 163; label17.Text = "实收金额:"; // diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs index 46ef56e..2125f85 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs @@ -58,10 +58,10 @@ pnlRoomInfo.Controls.Add(label3); pnlRoomInfo.Controls.Add(label2); pnlRoomInfo.Controls.Add(label1); - pnlRoomInfo.Location = new Point(3, 339); + pnlRoomInfo.Location = new Point(3, 282); pnlRoomInfo.Margin = new Padding(4); pnlRoomInfo.Name = "pnlRoomInfo"; - pnlRoomInfo.Size = new Size(255, 280); + pnlRoomInfo.Size = new Size(255, 337); pnlRoomInfo.TabIndex = 72; // // lblRoomState @@ -181,7 +181,7 @@ muRoomState.Location = new Point(2, 4); muRoomState.Mode = AntdUI.TMenuMode.Vertical; muRoomState.Name = "muRoomState"; - muRoomState.Size = new Size(255, 328); + muRoomState.Size = new Size(255, 271); muRoomState.TabIndex = 96; muRoomState.SelectChanged += muRoomState_SelectChanged; // diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs index c16b8a2..05a9fdf 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs @@ -50,7 +50,6 @@ btnAdd = new AntdUI.Button(); btnCancel = new AntdUI.Button(); dgvRoomSell = new AntdUI.Table(); - ucWindowHeader1 = new ucWindowHeader(); groupBox2.SuspendLayout(); SuspendLayout(); // @@ -65,9 +64,9 @@ groupBox2.Controls.Add(txtSellName); groupBox2.Controls.Add(txtSellNo); groupBox2.Font = new Font("Noto Sans SC", 9F); - groupBox2.Location = new Point(617, 88); + groupBox2.Location = new Point(617, 57); groupBox2.Name = "groupBox2"; - groupBox2.Size = new Size(452, 123); + groupBox2.Size = new Size(452, 120); groupBox2.TabIndex = 5; groupBox2.TabStop = false; groupBox2.Text = "订购中心"; @@ -159,7 +158,7 @@ // label1.BackColor = Color.Transparent; label1.Font = new Font("Noto Sans SC", 12F); - label1.Location = new Point(45, 51); + label1.Location = new Point(45, 22); label1.Name = "label1"; label1.Size = new Size(145, 23); label1.TabIndex = 26; @@ -169,7 +168,7 @@ // txtFind // txtFind.Font = new Font("Noto Sans SC", 12F); - txtFind.Location = new Point(200, 42); + txtFind.Location = new Point(200, 13); txtFind.Name = "txtFind"; txtFind.Round = true; txtFind.Size = new Size(197, 38); @@ -178,7 +177,7 @@ // btnFind // btnFind.Font = new Font("Noto Sans SC", 12F); - btnFind.Location = new Point(403, 42); + btnFind.Location = new Point(403, 13); btnFind.Name = "btnFind"; btnFind.Shape = AntdUI.TShape.Round; btnFind.Size = new Size(101, 38); @@ -191,7 +190,7 @@ // label2.BackColor = Color.Transparent; label2.Font = new Font("Noto Sans SC", 12F); - label2.Location = new Point(518, 51); + label2.Location = new Point(518, 22); label2.Name = "label2"; label2.Size = new Size(92, 23); label2.TabIndex = 29; @@ -201,7 +200,7 @@ // txtRoomNo // txtRoomNo.Font = new Font("Noto Sans SC", 12F); - txtRoomNo.Location = new Point(617, 42); + txtRoomNo.Location = new Point(617, 13); txtRoomNo.Name = "txtRoomNo"; txtRoomNo.Round = true; txtRoomNo.Size = new Size(134, 38); @@ -212,7 +211,7 @@ // btnCheck // btnCheck.Font = new Font("Noto Sans SC", 12F); - btnCheck.Location = new Point(764, 44); + btnCheck.Location = new Point(764, 15); btnCheck.Name = "btnCheck"; btnCheck.Shape = AntdUI.TShape.Round; btnCheck.Size = new Size(101, 38); @@ -225,7 +224,7 @@ // lblState.BackColor = Color.Transparent; lblState.Font = new Font("Noto Sans SC", 12F); - lblState.Location = new Point(875, 51); + lblState.Location = new Point(875, 22); lblState.Name = "lblState"; lblState.Size = new Size(130, 23); lblState.TabIndex = 32; @@ -238,9 +237,9 @@ dgvSellthing.Bordered = true; dgvSellthing.Font = new Font("Noto Sans SC", 9F); dgvSellthing.Gap = 12; - dgvSellthing.Location = new Point(4, 88); + dgvSellthing.Location = new Point(4, 57); dgvSellthing.Name = "dgvSellthing"; - dgvSellthing.Size = new Size(487, 351); + dgvSellthing.Size = new Size(487, 382); dgvSellthing.TabIndex = 131; dgvSellthing.CellClick += dgvSellthing_CellClick; // @@ -258,7 +257,7 @@ // btnAdd // btnAdd.Font = new Font("Noto Sans SC", 12F); - btnAdd.Location = new Point(496, 88); + btnAdd.Location = new Point(496, 58); btnAdd.Name = "btnAdd"; btnAdd.Shape = AntdUI.TShape.Round; btnAdd.Size = new Size(115, 38); @@ -270,7 +269,7 @@ // btnCancel // btnCancel.Font = new Font("Noto Sans SC", 12F); - btnCancel.Location = new Point(496, 174); + btnCancel.Location = new Point(496, 144); btnCancel.Name = "btnCancel"; btnCancel.Shape = AntdUI.TShape.Round; btnCancel.Size = new Size(115, 38); @@ -285,25 +284,17 @@ dgvRoomSell.Bordered = true; dgvRoomSell.Font = new Font("Noto Sans SC", 9F); dgvRoomSell.Gap = 12; - dgvRoomSell.Location = new Point(497, 217); + dgvRoomSell.Location = new Point(497, 188); dgvRoomSell.Name = "dgvRoomSell"; - dgvRoomSell.Size = new Size(572, 262); + dgvRoomSell.Size = new Size(572, 291); dgvRoomSell.TabIndex = 138; dgvRoomSell.CellClick += dgvRoomSell_CellClick; // - // ucWindowHeader1 - // - ucWindowHeader1.Location = new Point(1, 1); - ucWindowHeader1.Name = "ucWindowHeader1"; - ucWindowHeader1.Size = new Size(1071, 35); - ucWindowHeader1.TabIndex = 139; - // // FrmSellThing // AutoScaleMode = AutoScaleMode.None; BackColor = Color.FromArgb(235, 243, 255); ClientSize = new Size(1072, 486); - Controls.Add(ucWindowHeader1); Controls.Add(dgvRoomSell); Controls.Add(btnCancel); Controls.Add(btnAdd); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs index 809ec9b..9bdce49 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs @@ -41,15 +41,12 @@ namespace EOM.TSHotelManagement.FormUI ReadRoomOutputDto r = null; private static ReadSpendOutputDto spend = null; - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSellThing)); private LoadingProgress loadingProgress; public FrmSellThing() { InitializeComponent(); loadingProgress = new LoadingProgress(); - - ucWindowHeader1.ApplySettingsWithoutMinimize("商品消费", string.Empty, (Image)resources.GetObject("FrmSellThing.Icon")!); } #region 窗体加载事件 diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api index dfbd3a5..29f534d 160000 --- a/topsky-hotel-management-system-web-api +++ b/topsky-hotel-management-system-web-api @@ -1 +1 @@ -Subproject commit dfbd3a5659c889a5a2dc2b604609df6f89518ab0 +Subproject commit 29f534d6b98aa0ae193814603417fd3d90bf45a4 -- Gitee From eee22c8f1123da06b338912d8679c411a67a6cc4 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 18 Oct 2025 15:16:37 +0800 Subject: [PATCH 4/9] add csrf token for http header. --- .../BackendApi/ApiConstants.cs | 3 + .../Helper/CsrfTokenHelper.cs | 39 +++++ .../Helper/HttpHelper.cs | 7 + .../LocalInfo/LoginInfo.cs | 10 ++ .../UIControlIconConstant.cs | 2 + .../FrmCustomerManagement.Designer.cs | 12 ++ .../ClientModule/FrmCustomerManagement.cs | 8 + .../ClientModule/FrmSellThing.Designer.cs | 157 +++++++++--------- .../ClientModule/FrmSellThing.cs | 8 +- topsky-hotel-management-system-web-api | 2 +- 10 files changed, 171 insertions(+), 77 deletions(-) create mode 100644 EOM.TSHotelManagement.Common/Helper/CsrfTokenHelper.cs diff --git a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs b/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs index 8114313..4aa76f2 100644 --- a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs +++ b/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs @@ -3,6 +3,9 @@ public static class ApiConstants { public const string Default_Version = "version"; + public const string Common_GetCsrfToken = "Login/GetCsrfToken"; + public const string Common_RefreshCsrfToken = "Login/RefreshCSRFToken"; + // Base URLs public const string Base_SelectNationAll = "Base/SelectNationAll"; public const string Base_SelectGenderTypeAll = "Base/SelectGenderTypeAll"; diff --git a/EOM.TSHotelManagement.Common/Helper/CsrfTokenHelper.cs b/EOM.TSHotelManagement.Common/Helper/CsrfTokenHelper.cs new file mode 100644 index 0000000..7677a20 --- /dev/null +++ b/EOM.TSHotelManagement.Common/Helper/CsrfTokenHelper.cs @@ -0,0 +1,39 @@ +using EOM.TSHotelManagement.Common.Contract; +using jvncorelib.EntityLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common +{ + public static class CsrfTokenHelper + { + public static string GetCsrfToken() + { + var apiResponse = HttpHelper.Request(ApiConstants.Common_GetCsrfToken, string.Empty); + var response = HttpHelper.JsonToModel>(apiResponse.message); + if (response.Success && response.Data != null) + { + LoginInfo.CsrfToken = response.Data.Token; + LoginInfo.NeedRefreshCsrfToken = response.Data.NeedsRefresh; + } + + return LoginInfo.CsrfToken ?? string.Empty; + } + + public static string RefreshCsrfToken() + { + var apiResponse = HttpHelper.Request(ApiConstants.Common_RefreshCsrfToken, string.Empty); + var response = HttpHelper.JsonToModel>(apiResponse.message); + if (response.Success && response.Data != null) + { + LoginInfo.CsrfToken = response.Data.Token; + LoginInfo.NeedRefreshCsrfToken = response.Data.NeedsRefresh; + } + + return LoginInfo.CsrfToken ?? string.Empty; + } + } +} diff --git a/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs b/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs index 64f88b5..cd2206f 100644 --- a/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs +++ b/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs @@ -327,6 +327,13 @@ namespace EOM.TSHotelManagement.Common request.AddHeader("Authorization", string.Format("Bearer {0}", token)); + if (LoginInfo.NeedRefreshCsrfToken) + { + CsrfTokenHelper.RefreshCsrfToken(); + } + + request.AddHeader("X-CSRF-TOKEN-HEADER", LoginInfo.CsrfToken ?? CsrfTokenHelper.RefreshCsrfToken()); + reponse = client.ExecutePost(request); var responseString = reponse.Content; diff --git a/EOM.TSHotelManagement.Common/LocalInfo/LoginInfo.cs b/EOM.TSHotelManagement.Common/LocalInfo/LoginInfo.cs index e4160e4..c5930c9 100644 --- a/EOM.TSHotelManagement.Common/LocalInfo/LoginInfo.cs +++ b/EOM.TSHotelManagement.Common/LocalInfo/LoginInfo.cs @@ -59,6 +59,16 @@ namespace EOM.TSHotelManagement.Common /// public static string UserToken = ""; + /// + /// 存储当前用户CSRF-Token + /// + public static string? CsrfToken = null; + + /// + /// 存储当前用户CSRF-Token是否需要刷新标记 + /// + public static bool NeedRefreshCsrfToken = false; + /// /// 存储当前用户密码 /// diff --git a/EOM.TSHotelManagement.Common/UIControlIconConstant.cs b/EOM.TSHotelManagement.Common/UIControlIconConstant.cs index 9537359..cfa1d57 100644 --- a/EOM.TSHotelManagement.Common/UIControlIconConstant.cs +++ b/EOM.TSHotelManagement.Common/UIControlIconConstant.cs @@ -26,5 +26,7 @@ public const string Setting = ""; public const string Minimize = ""; public const string Close = ""; + + public const string Clear = ""; } } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs index dc9d4a2..9084fcc 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs @@ -42,6 +42,7 @@ txtCustoName = new AntdUI.Input(); txtCustoNo = new AntdUI.Input(); divider1 = new AntdUI.Divider(); + btnClear = new AntdUI.Button(); cmsCustomerAction.SuspendLayout(); SuspendLayout(); // @@ -177,12 +178,22 @@ divider1.Text = "右键可复制快速客户编号"; divider1.Thickness = 1F; // + // btnClear + // + btnClear.Location = new Point(554, 444); + btnClear.Name = "btnClear"; + btnClear.Radius = 16; + btnClear.Size = new Size(42, 42); + btnClear.TabIndex = 154; + btnClear.Click += btnClear_Click; + // // FrmCustomerManagement // AutoScaleDimensions = new SizeF(7F, 17F); AutoScaleMode = AutoScaleMode.Font; BackColor = Color.FromArgb(235, 243, 255); ClientSize = new Size(1072, 490); + Controls.Add(btnClear); Controls.Add(divider1); Controls.Add(label1); Controls.Add(label2); @@ -216,5 +227,6 @@ private ContextMenuStrip cmsCustomerAction; private ToolStripMenuItem tsmiCustoNoCopy; private AntdUI.Divider divider1; + private AntdUI.Button btnClear; } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs index b77810e..4770379 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs @@ -67,6 +67,7 @@ namespace EOM.TSHotelManagement.FormUI #region 用户管理界面加载事件方法 private void FrmCustomerManagement_Load(object sender, EventArgs e) { + btnClear.IconSvg = UIControlIconConstant.Clear; this.btnPg.PageSize = 15; LoadCustomer(); } @@ -255,6 +256,13 @@ namespace EOM.TSHotelManagement.FormUI frmInputs.ShowDialog(); } } + + private void btnClear_Click(object sender, EventArgs e) + { + txtCustoName.Clear(); + txtCustoNo.Clear(); + LoadCustomer(); + } } } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs index 05a9fdf..c6a3b73 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs @@ -30,35 +30,36 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSellThing)); groupBox2 = new GroupBox(); - label6 = new AntdUI.Label(); label5 = new AntdUI.Label(); label4 = new AntdUI.Label(); label3 = new AntdUI.Label(); + label7 = new AntdUI.Label(); nudNum = new AntdUI.InputNumber(); txtPrice = new AntdUI.Input(); txtSellName = new AntdUI.Input(); txtSellNo = new AntdUI.Input(); - label1 = new AntdUI.Label(); txtFind = new AntdUI.Input(); btnFind = new AntdUI.Button(); - label2 = new AntdUI.Label(); txtRoomNo = new AntdUI.Input(); btnCheck = new AntdUI.Button(); - lblState = new AntdUI.Label(); dgvSellthing = new AntdUI.Table(); btnPg = new AntdUI.Pagination(); btnAdd = new AntdUI.Button(); btnCancel = new AntdUI.Button(); dgvRoomSell = new AntdUI.Table(); + label1 = new AntdUI.Label(); + label2 = new AntdUI.Label(); + lblState = new AntdUI.Label(); + btnClear = new AntdUI.Button(); groupBox2.SuspendLayout(); SuspendLayout(); // // groupBox2 // - groupBox2.Controls.Add(label6); groupBox2.Controls.Add(label5); groupBox2.Controls.Add(label4); groupBox2.Controls.Add(label3); + groupBox2.Controls.Add(label7); groupBox2.Controls.Add(nudNum); groupBox2.Controls.Add(txtPrice); groupBox2.Controls.Add(txtSellName); @@ -71,47 +72,45 @@ groupBox2.TabStop = false; groupBox2.Text = "订购中心"; // - // label6 - // - label6.BackColor = Color.Transparent; - label6.Font = new Font("Noto Sans SC", 12F); - label6.Location = new Point(258, 32); - label6.Name = "label6"; - label6.Size = new Size(61, 23); - label6.TabIndex = 38; - label6.Text = "数量:"; - // // label5 // - label5.BackColor = Color.Transparent; - label5.Font = new Font("Noto Sans SC", 12F); label5.Location = new Point(258, 78); label5.Name = "label5"; - label5.Size = new Size(61, 23); - label5.TabIndex = 37; + label5.Size = new Size(55, 23); + label5.TabIndex = 144; + label5.Tag = ""; label5.Text = "单价:"; + label5.TextAlign = ContentAlignment.MiddleRight; // // label4 // - label4.BackColor = Color.Transparent; - label4.Font = new Font("Noto Sans SC", 12F); - label4.Location = new Point(19, 78); + label4.Location = new Point(258, 32); label4.Name = "label4"; - label4.Size = new Size(92, 23); - label4.TabIndex = 36; - label4.Text = "商品名称:"; - label4.TextAlign = ContentAlignment.MiddleCenter; + label4.Size = new Size(55, 23); + label4.TabIndex = 143; + label4.Tag = ""; + label4.Text = "数量:"; + label4.TextAlign = ContentAlignment.MiddleRight; // // label3 // - label3.BackColor = Color.Transparent; - label3.Font = new Font("Noto Sans SC", 12F); - label3.Location = new Point(19, 32); + label3.Location = new Point(4, 78); label3.Name = "label3"; - label3.Size = new Size(92, 23); - label3.TabIndex = 35; - label3.Text = "商品编号:"; - label3.TextAlign = ContentAlignment.MiddleCenter; + label3.Size = new Size(107, 23); + label3.TabIndex = 142; + label3.Tag = ""; + label3.Text = "商品名称:"; + label3.TextAlign = ContentAlignment.MiddleRight; + // + // label7 + // + label7.Location = new Point(4, 32); + label7.Name = "label7"; + label7.Size = new Size(107, 23); + label7.TabIndex = 141; + label7.Tag = ""; + label7.Text = "商品编号:"; + label7.TextAlign = ContentAlignment.MiddleRight; // // nudNum // @@ -154,21 +153,10 @@ txtSellNo.Size = new Size(145, 38); txtSellNo.TabIndex = 31; // - // label1 - // - label1.BackColor = Color.Transparent; - label1.Font = new Font("Noto Sans SC", 12F); - label1.Location = new Point(45, 22); - label1.Name = "label1"; - label1.Size = new Size(145, 23); - label1.TabIndex = 26; - label1.Text = "要查找的商品名称:"; - label1.TextAlign = ContentAlignment.MiddleCenter; - // // txtFind // txtFind.Font = new Font("Noto Sans SC", 12F); - txtFind.Location = new Point(200, 13); + txtFind.Location = new Point(148, 13); txtFind.Name = "txtFind"; txtFind.Round = true; txtFind.Size = new Size(197, 38); @@ -177,7 +165,7 @@ // btnFind // btnFind.Font = new Font("Noto Sans SC", 12F); - btnFind.Location = new Point(403, 13); + btnFind.Location = new Point(351, 13); btnFind.Name = "btnFind"; btnFind.Shape = AntdUI.TShape.Round; btnFind.Size = new Size(101, 38); @@ -186,17 +174,6 @@ btnFind.Type = AntdUI.TTypeMini.Primary; btnFind.Click += btnFind_Click; // - // label2 - // - label2.BackColor = Color.Transparent; - label2.Font = new Font("Noto Sans SC", 12F); - label2.Location = new Point(518, 22); - label2.Name = "label2"; - label2.Size = new Size(92, 23); - label2.TabIndex = 29; - label2.Text = "消费房号:"; - label2.TextAlign = ContentAlignment.MiddleCenter; - // // txtRoomNo // txtRoomNo.Font = new Font("Noto Sans SC", 12F); @@ -220,17 +197,6 @@ btnCheck.Type = AntdUI.TTypeMini.Primary; btnCheck.Click += btnCheck_Click; // - // lblState - // - lblState.BackColor = Color.Transparent; - lblState.Font = new Font("Noto Sans SC", 12F); - lblState.Location = new Point(875, 22); - lblState.Name = "lblState"; - lblState.Size = new Size(130, 23); - lblState.TabIndex = 32; - lblState.Text = ""; - lblState.TextAlign = ContentAlignment.MiddleCenter; - // // dgvSellthing // dgvSellthing.AutoSizeColumnsMode = AntdUI.ColumnsMode.Fill; @@ -290,23 +256,63 @@ dgvRoomSell.TabIndex = 138; dgvRoomSell.CellClick += dgvRoomSell_CellClick; // + // label1 + // + label1.Location = new Point(22, 22); + label1.Name = "label1"; + label1.Size = new Size(120, 23); + label1.TabIndex = 139; + label1.Tag = "消费房号:"; + label1.Text = "要查找的商品名称:"; + label1.TextAlign = ContentAlignment.MiddleRight; + // + // label2 + // + label2.Location = new Point(510, 22); + label2.Name = "label2"; + label2.Size = new Size(107, 23); + label2.TabIndex = 140; + label2.Tag = ""; + label2.Text = "消费房号:"; + label2.TextAlign = ContentAlignment.MiddleRight; + // + // lblState + // + lblState.Location = new Point(886, 22); + lblState.Name = "lblState"; + lblState.Size = new Size(107, 23); + lblState.TabIndex = 141; + lblState.Tag = ""; + lblState.Text = ""; + lblState.TextAlign = ContentAlignment.MiddleCenter; + // + // btnClear + // + btnClear.Location = new Point(462, 12); + btnClear.Name = "btnClear"; + btnClear.Radius = 16; + btnClear.Size = new Size(42, 39); + btnClear.TabIndex = 155; + btnClear.Click += btnClear_Click; + // // FrmSellThing // AutoScaleMode = AutoScaleMode.None; BackColor = Color.FromArgb(235, 243, 255); ClientSize = new Size(1072, 486); + Controls.Add(btnClear); + Controls.Add(lblState); + Controls.Add(label2); + Controls.Add(label1); Controls.Add(dgvRoomSell); Controls.Add(btnCancel); Controls.Add(btnAdd); Controls.Add(btnPg); Controls.Add(dgvSellthing); - Controls.Add(lblState); Controls.Add(btnCheck); Controls.Add(txtRoomNo); - Controls.Add(label2); Controls.Add(btnFind); Controls.Add(txtFind); - Controls.Add(label1); Controls.Add(groupBox2); FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); @@ -346,13 +352,10 @@ private System.Windows.Forms.DataGridViewTextBoxColumn clSellPrice; private System.Windows.Forms.DataGridViewTextBoxColumn clFormat; private System.Windows.Forms.DataGridViewTextBoxColumn clStock; - private AntdUI.Label label1; private AntdUI.Input txtFind; private AntdUI.Button btnFind; - private AntdUI.Label label2; private AntdUI.Input txtRoomNo; private AntdUI.Button btnCheck; - private AntdUI.Label lblState; private AntdUI.Table dgvSellthing; private AntdUI.Pagination btnPg; private AntdUI.Button btnAdd; @@ -363,9 +366,13 @@ private AntdUI.Input txtPrice; private AntdUI.Input txtSellName; private AntdUI.Input txtSellNo; - private AntdUI.Label label6; + private AntdUI.Label label1; + private AntdUI.Label label2; private AntdUI.Label label5; private AntdUI.Label label4; private AntdUI.Label label3; + private AntdUI.Label label7; + private AntdUI.Label lblState; + private AntdUI.Button btnClear; } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs index 9bdce49..109fa73 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs @@ -52,8 +52,8 @@ namespace EOM.TSHotelManagement.FormUI #region 窗体加载事件 private void FrmSellThing_Load(object sender, EventArgs e) { + btnClear.IconSvg = UIControlIconConstant.Clear; LoadSellThingInfo(); - } #endregion @@ -443,5 +443,11 @@ namespace EOM.TSHotelManagement.FormUI }; } } + + private void btnClear_Click(object sender, EventArgs e) + { + txtFind.Clear(); + LoadSellThingInfo(); + } } } diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api index 29f534d..2bf2319 160000 --- a/topsky-hotel-management-system-web-api +++ b/topsky-hotel-management-system-web-api @@ -1 +1 @@ -Subproject commit 29f534d6b98aa0ae193814603417fd3d90bf45a4 +Subproject commit 2bf23193ff1344712e3882c8ecc292eaa757e2ec -- Gitee From f54c31320115d8d3be2c8cab2c9679f479c1b754 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 15 Nov 2025 18:11:22 +0800 Subject: [PATCH 5/9] disconnect submodule --- .gitmodules | 3 --- .../EOM.TSHotelManagement.Common.csproj | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitmodules b/.gitmodules index 968a7c2..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "topsky-hotel-management-system-web-api"] - path = topsky-hotel-management-system-web-api - url = https://gitee.com/java-and-net/topsky-hotel-management-system-web-api.git diff --git a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj b/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj index 5835996..fdfd576 100644 --- a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj +++ b/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj @@ -12,12 +12,9 @@ + - - - - -- Gitee From bc5962d7b8a0b6757dd29e08791862025f34a8a1 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 15 Nov 2025 19:27:36 +0800 Subject: [PATCH 6/9] disconnect submodule. --- EOM.Client.TopSkyHotelManagementSystem.sln | 102 +-------------------- topsky-hotel-management-system-web-api | 1 - 2 files changed, 2 insertions(+), 101 deletions(-) delete mode 160000 topsky-hotel-management-system-web-api diff --git a/EOM.Client.TopSkyHotelManagementSystem.sln b/EOM.Client.TopSkyHotelManagementSystem.sln index 98c469c..242651c 100644 --- a/EOM.Client.TopSkyHotelManagementSystem.sln +++ b/EOM.Client.TopSkyHotelManagementSystem.sln @@ -1,132 +1,34 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.4.33213.308 +# Visual Studio Version 18 +VisualStudioVersion = 18.3.11206.111 d18.3 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{6A3E4936-8B95-49E0-842B-E002C0E024CE}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{3B8902EC-CAB9-406A-AAF7-24DABD885AC0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Application", "topsky-hotel-management-system-web-api\EOM.TSHotelManagement.Application\EOM.TSHotelManagement.Application.csproj", "{B55975AB-2C89-4C01-B107-D87FCA21A5E3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.EntityFramework", "topsky-hotel-management-system-web-api\EOM.TSHotelManagement.EntityFramework\EOM.TSHotelManagement.EntityFramework.csproj", "{8F5CF88A-1111-44CC-AFFA-4637EA10E191}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.WebApi", "topsky-hotel-management-system-web-api\EOM.TSHotelManagement.WebApi\EOM.TSHotelManagement.WebApi.csproj", "{566D7064-EA90-45C1-93B7-F512BBAD7BA1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Common.Core", "topsky-hotel-management-system-web-api\EOM.TSHotelManagement.Common.Core\EOM.TSHotelManagement.Common.Core.csproj", "{48B3F864-88D2-4BD1-A766-B9EBF342AED1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Common.Util", "topsky-hotel-management-system-web-api\EOM.TSHotelManagement.Common.Util\EOM.TSHotelManagement.Common.Util.csproj", "{9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Common", "EOM.TSHotelManagement.Common\EOM.TSHotelManagement.Common.csproj", "{781CEE04-DDB4-4037-8175-9A6548716871}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.FormUI", "EOM.TSHotelManagement.FormUI\EOM.TSHotelManagement.FormUI.csproj", "{D89E76F5-007B-4915-91A8-265CCA6814BF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Shared", "topsky-hotel-management-system-web-api\EOM.TSHotelManagement.Shared\EOM.TSHotelManagement.Shared.csproj", "{1A37446C-A721-4507-89B5-7BFF6F66A004}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Common.Contract", "topsky-hotel-management-system-web-api\EOM.TSHotelManagement.Common.Contract\EOM.TSHotelManagement.Common.Contract.csproj", "{7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Migration", "topsky-hotel-management-system-web-api\EOM.TSHotelManagement.Migration\EOM.TSHotelManagement.Migration.csproj", "{A1A986E0-E59D-4913-B63E-D965453B8CC0}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 Release|x64 = Release|x64 - Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B55975AB-2C89-4C01-B107-D87FCA21A5E3}.Debug|x64.ActiveCfg = Debug|x64 - {B55975AB-2C89-4C01-B107-D87FCA21A5E3}.Debug|x64.Build.0 = Debug|x64 - {B55975AB-2C89-4C01-B107-D87FCA21A5E3}.Debug|x86.ActiveCfg = Debug|x64 - {B55975AB-2C89-4C01-B107-D87FCA21A5E3}.Debug|x86.Build.0 = Debug|x64 - {B55975AB-2C89-4C01-B107-D87FCA21A5E3}.Release|x64.ActiveCfg = Release|x64 - {B55975AB-2C89-4C01-B107-D87FCA21A5E3}.Release|x86.ActiveCfg = Release|x86 - {B55975AB-2C89-4C01-B107-D87FCA21A5E3}.Release|x86.Build.0 = Release|x86 - {8F5CF88A-1111-44CC-AFFA-4637EA10E191}.Debug|x64.ActiveCfg = Debug|x64 - {8F5CF88A-1111-44CC-AFFA-4637EA10E191}.Debug|x64.Build.0 = Debug|x64 - {8F5CF88A-1111-44CC-AFFA-4637EA10E191}.Debug|x86.ActiveCfg = Debug|x64 - {8F5CF88A-1111-44CC-AFFA-4637EA10E191}.Debug|x86.Build.0 = Debug|x64 - {8F5CF88A-1111-44CC-AFFA-4637EA10E191}.Release|x64.ActiveCfg = Release|x64 - {8F5CF88A-1111-44CC-AFFA-4637EA10E191}.Release|x64.Build.0 = Release|x64 - {8F5CF88A-1111-44CC-AFFA-4637EA10E191}.Release|x86.ActiveCfg = Release|x64 - {8F5CF88A-1111-44CC-AFFA-4637EA10E191}.Release|x86.Build.0 = Release|x64 - {566D7064-EA90-45C1-93B7-F512BBAD7BA1}.Debug|x64.ActiveCfg = Debug|x64 - {566D7064-EA90-45C1-93B7-F512BBAD7BA1}.Debug|x64.Build.0 = Debug|x64 - {566D7064-EA90-45C1-93B7-F512BBAD7BA1}.Debug|x86.ActiveCfg = Debug|x64 - {566D7064-EA90-45C1-93B7-F512BBAD7BA1}.Debug|x86.Build.0 = Debug|x64 - {566D7064-EA90-45C1-93B7-F512BBAD7BA1}.Release|x64.ActiveCfg = Release|x64 - {566D7064-EA90-45C1-93B7-F512BBAD7BA1}.Release|x64.Build.0 = Release|x64 - {566D7064-EA90-45C1-93B7-F512BBAD7BA1}.Release|x86.ActiveCfg = Release|x64 - {566D7064-EA90-45C1-93B7-F512BBAD7BA1}.Release|x86.Build.0 = Release|x64 - {48B3F864-88D2-4BD1-A766-B9EBF342AED1}.Debug|x64.ActiveCfg = Debug|x64 - {48B3F864-88D2-4BD1-A766-B9EBF342AED1}.Debug|x64.Build.0 = Debug|x64 - {48B3F864-88D2-4BD1-A766-B9EBF342AED1}.Debug|x86.ActiveCfg = Debug|x64 - {48B3F864-88D2-4BD1-A766-B9EBF342AED1}.Debug|x86.Build.0 = Debug|x64 - {48B3F864-88D2-4BD1-A766-B9EBF342AED1}.Release|x64.ActiveCfg = Release|x64 - {48B3F864-88D2-4BD1-A766-B9EBF342AED1}.Release|x64.Build.0 = Release|x64 - {48B3F864-88D2-4BD1-A766-B9EBF342AED1}.Release|x86.ActiveCfg = Release|x64 - {48B3F864-88D2-4BD1-A766-B9EBF342AED1}.Release|x86.Build.0 = Release|x64 - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}.Debug|x64.ActiveCfg = Debug|x64 - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}.Debug|x64.Build.0 = Debug|x64 - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}.Debug|x86.ActiveCfg = Debug|x64 - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}.Debug|x86.Build.0 = Debug|x64 - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}.Release|x64.ActiveCfg = Release|x64 - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}.Release|x64.Build.0 = Release|x64 - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}.Release|x86.ActiveCfg = Release|x64 - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837}.Release|x86.Build.0 = Release|x64 {781CEE04-DDB4-4037-8175-9A6548716871}.Debug|x64.ActiveCfg = Debug|x64 {781CEE04-DDB4-4037-8175-9A6548716871}.Debug|x64.Build.0 = Debug|x64 - {781CEE04-DDB4-4037-8175-9A6548716871}.Debug|x86.ActiveCfg = Debug|x64 - {781CEE04-DDB4-4037-8175-9A6548716871}.Debug|x86.Build.0 = Debug|x64 {781CEE04-DDB4-4037-8175-9A6548716871}.Release|x64.ActiveCfg = Release|x64 {781CEE04-DDB4-4037-8175-9A6548716871}.Release|x64.Build.0 = Release|x64 - {781CEE04-DDB4-4037-8175-9A6548716871}.Release|x86.ActiveCfg = Release|x64 - {781CEE04-DDB4-4037-8175-9A6548716871}.Release|x86.Build.0 = Release|x64 {D89E76F5-007B-4915-91A8-265CCA6814BF}.Debug|x64.ActiveCfg = Debug|x64 {D89E76F5-007B-4915-91A8-265CCA6814BF}.Debug|x64.Build.0 = Debug|x64 - {D89E76F5-007B-4915-91A8-265CCA6814BF}.Debug|x86.ActiveCfg = Debug|x64 - {D89E76F5-007B-4915-91A8-265CCA6814BF}.Debug|x86.Build.0 = Debug|x64 {D89E76F5-007B-4915-91A8-265CCA6814BF}.Release|x64.ActiveCfg = Release|x64 {D89E76F5-007B-4915-91A8-265CCA6814BF}.Release|x64.Build.0 = Release|x64 - {D89E76F5-007B-4915-91A8-265CCA6814BF}.Release|x86.ActiveCfg = Release|x64 - {D89E76F5-007B-4915-91A8-265CCA6814BF}.Release|x86.Build.0 = Release|x64 - {1A37446C-A721-4507-89B5-7BFF6F66A004}.Debug|x64.ActiveCfg = Debug|x64 - {1A37446C-A721-4507-89B5-7BFF6F66A004}.Debug|x64.Build.0 = Debug|x64 - {1A37446C-A721-4507-89B5-7BFF6F66A004}.Debug|x86.ActiveCfg = Debug|x64 - {1A37446C-A721-4507-89B5-7BFF6F66A004}.Debug|x86.Build.0 = Debug|x64 - {1A37446C-A721-4507-89B5-7BFF6F66A004}.Release|x64.ActiveCfg = Release|x64 - {1A37446C-A721-4507-89B5-7BFF6F66A004}.Release|x64.Build.0 = Release|x64 - {1A37446C-A721-4507-89B5-7BFF6F66A004}.Release|x86.ActiveCfg = Release|x64 - {1A37446C-A721-4507-89B5-7BFF6F66A004}.Release|x86.Build.0 = Release|x64 - {7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55}.Debug|x64.ActiveCfg = Debug|x64 - {7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55}.Debug|x64.Build.0 = Debug|x64 - {7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55}.Debug|x86.ActiveCfg = Debug|x64 - {7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55}.Debug|x86.Build.0 = Debug|x64 - {7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55}.Release|x64.ActiveCfg = Release|x64 - {7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55}.Release|x86.ActiveCfg = Release|x86 - {7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55}.Release|x86.Build.0 = Release|x86 - {A1A986E0-E59D-4913-B63E-D965453B8CC0}.Debug|x64.ActiveCfg = Debug|x64 - {A1A986E0-E59D-4913-B63E-D965453B8CC0}.Debug|x64.Build.0 = Debug|x64 - {A1A986E0-E59D-4913-B63E-D965453B8CC0}.Debug|x86.ActiveCfg = Debug|x64 - {A1A986E0-E59D-4913-B63E-D965453B8CC0}.Debug|x86.Build.0 = Debug|x64 - {A1A986E0-E59D-4913-B63E-D965453B8CC0}.Release|x64.ActiveCfg = Release|x64 - {A1A986E0-E59D-4913-B63E-D965453B8CC0}.Release|x64.Build.0 = Release|x64 - {A1A986E0-E59D-4913-B63E-D965453B8CC0}.Release|x86.ActiveCfg = Release|x64 - {A1A986E0-E59D-4913-B63E-D965453B8CC0}.Release|x86.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {B55975AB-2C89-4C01-B107-D87FCA21A5E3} = {6A3E4936-8B95-49E0-842B-E002C0E024CE} - {8F5CF88A-1111-44CC-AFFA-4637EA10E191} = {6A3E4936-8B95-49E0-842B-E002C0E024CE} - {566D7064-EA90-45C1-93B7-F512BBAD7BA1} = {6A3E4936-8B95-49E0-842B-E002C0E024CE} - {48B3F864-88D2-4BD1-A766-B9EBF342AED1} = {6A3E4936-8B95-49E0-842B-E002C0E024CE} - {9A62B6BE-7C26-465F-A8D1-2CEE66D6F837} = {6A3E4936-8B95-49E0-842B-E002C0E024CE} {781CEE04-DDB4-4037-8175-9A6548716871} = {3B8902EC-CAB9-406A-AAF7-24DABD885AC0} {D89E76F5-007B-4915-91A8-265CCA6814BF} = {3B8902EC-CAB9-406A-AAF7-24DABD885AC0} - {1A37446C-A721-4507-89B5-7BFF6F66A004} = {6A3E4936-8B95-49E0-842B-E002C0E024CE} - {7E8046FD-4CB3-4BBC-8ADD-E27FE3DBBB55} = {6A3E4936-8B95-49E0-842B-E002C0E024CE} - {A1A986E0-E59D-4913-B63E-D965453B8CC0} = {6A3E4936-8B95-49E0-842B-E002C0E024CE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B93ABE6D-89AD-45B3-94FB-65BD98597CC6} diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api deleted file mode 160000 index 2bf2319..0000000 --- a/topsky-hotel-management-system-web-api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2bf23193ff1344712e3882c8ecc292eaa757e2ec -- Gitee From b8ec2bb9f8be4f7db4d236beb6a7169f1b7be168 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 15 Nov 2025 19:34:27 +0800 Subject: [PATCH 7/9] add default package source. --- .gitmodules | 0 nuget.config | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) delete mode 100644 .gitmodules create mode 100644 nuget.config diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000..9a79d04 --- /dev/null +++ b/nuget.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- Gitee From 373c0fa0502935a7a93843a72e25ae66b8a34247 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 3 Jan 2026 14:55:05 +0800 Subject: [PATCH 8/9] update project layer. upgrade to net 10. --- EOM.Client.TopSkyHotelManagementSystem.sln | 4 +- .../ClientCustomControls/ucRoom.cs | 108 ++++---- .../ClientCustomControls/ucWindowHeader.cs | 2 +- .../ClientEntrance/FrmLoading.cs | 2 +- .../ClientEntrance/FrmLogin.cs | 6 +- .../ClientMain/FrmMain.cs | 9 +- .../ClientModule/FrmAbout.cs | 2 +- .../ClientModule/FrmAccountSecurity.cs | 4 +- .../ClientModule/FrmAvator.cs | 3 +- .../ClientModule/FrmChangeRoom.cs | 2 +- .../ClientModule/FrmCheckIn.cs | 2 +- .../ClientModule/FrmCheckOutDetail.cs | 53 ++-- .../ClientModule/FrmCustomerInfo.cs | 8 +- .../ClientModule/FrmCustomerManagement.cs | 3 +- .../ClientModule/FrmEditInputs.cs | 9 +- .../ClientModule/FrmPersonnelInfo.cs | 11 +- .../ClientModule/FrmReserList.cs | 11 +- .../ClientModule/FrmReserManagement.cs | 4 +- .../ClientModule/FrmRoomManagement.cs | 16 +- .../ClientModule/FrmRoomStateManagement.cs | 2 +- .../ClientModule/FrmScreenLock.cs | 2 +- .../ClientModule/FrmSellThing.cs | 7 +- .../EOM.TSHotelManagement.FormUI.csproj | 22 +- .../InitConfig/Initialize.cs | 45 ---- .../EOM.TSHotelManagement.Common.Contract.xml | 248 +++++++++--------- .../Services/NotificationService.cs | 10 +- .../TableComponent/TableComHelper.cs | 2 +- .../BackendApi/ApiConstants.cs | 2 +- .../EOM.TSHotelManagement.Shared.csproj | 9 +- .../Helper/CsrfTokenHelper.cs | 4 +- .../Helper/DiscountHelper.cs | 171 ++++++++++++ .../Helper/HttpHelper.cs | 2 +- .../Helper/ResponseMsg.cs | 2 +- .../LocalInfo/LoginInfo.cs | 2 +- .../UIControlConstant.cs | 2 +- .../UIControlIconConstant.cs | 2 +- .../UIMessageConstant.cs | 2 +- .../Util/ApplicationUtil.cs | 6 +- .../Util/ClipboardHelper.cs | 2 +- .../Util/RecordHelper.cs | 6 +- nuget.config | 2 +- 41 files changed, 461 insertions(+), 350 deletions(-) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/BackendApi/ApiConstants.cs (99%) rename EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj => EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj (48%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/Helper/CsrfTokenHelper.cs (93%) create mode 100644 EOM.TSHotelManagement.Shared/Helper/DiscountHelper.cs rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/Helper/HttpHelper.cs (99%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/Helper/ResponseMsg.cs (86%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/LocalInfo/LoginInfo.cs (98%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/UIControlConstant.cs (96%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/UIControlIconConstant.cs (99%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/UIMessageConstant.cs (94%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/Util/ApplicationUtil.cs (97%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/Util/ClipboardHelper.cs (98%) rename {EOM.TSHotelManagement.Common => EOM.TSHotelManagement.Shared}/Util/RecordHelper.cs (89%) diff --git a/EOM.Client.TopSkyHotelManagementSystem.sln b/EOM.Client.TopSkyHotelManagementSystem.sln index 242651c..376a9d4 100644 --- a/EOM.Client.TopSkyHotelManagementSystem.sln +++ b/EOM.Client.TopSkyHotelManagementSystem.sln @@ -1,10 +1,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.3.11206.111 d18.3 +VisualStudioVersion = 18.3.11206.111 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{3B8902EC-CAB9-406A-AAF7-24DABD885AC0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Common", "EOM.TSHotelManagement.Common\EOM.TSHotelManagement.Common.csproj", "{781CEE04-DDB4-4037-8175-9A6548716871}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Shared", "EOM.TSHotelManagement.Shared\EOM.TSHotelManagement.Shared.csproj", "{781CEE04-DDB4-4037-8175-9A6548716871}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.FormUI", "EOM.TSHotelManagement.FormUI\EOM.TSHotelManagement.FormUI.csproj", "{D89E76F5-007B-4915-91A8-265CCA6814BF}" EndProject diff --git a/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs index bf82fc2..d3f8577 100644 --- a/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs +++ b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs @@ -1,12 +1,12 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.FormUI.Properties; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Drawing.Drawing2D; using System.Runtime.InteropServices; +using System.ComponentModel; namespace EOM.TSHotelManagement.FormUI { @@ -59,8 +59,10 @@ namespace EOM.TSHotelManagement.FormUI #region 实例化房态图的房间信息 public string romTypeName; - public ReadRoomOutputDto romRoomInfo { get; set; } - public ReadCustomerOutputDto romCustoInfo { get; set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ReadRoomOutputDto RomRoomInfo { get; set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ReadCustomerOutputDto RomCustoInfo { get; set; } #endregion private void btnRoom_Click(object sender, EventArgs e) @@ -164,13 +166,13 @@ namespace EOM.TSHotelManagement.FormUI public void LoadRoomInfo() { - co_RoomNo = romRoomInfo.RoomNumber; - co_CustoNo = romCustoInfo.CustomerNumber; - co_CustoName = romCustoInfo.CustomerName; - romTypeName = romRoomInfo.RoomName; - co_CheckTime = romRoomInfo.LastCheckInTime; - co_RoomPosition = romRoomInfo.RoomLocation; - co_RoomState = romRoomInfo.RoomState; + co_RoomNo = RomRoomInfo.RoomNumber; + co_CustoNo = RomCustoInfo.CustomerNumber; + co_CustoName = RomCustoInfo.CustomerName; + romTypeName = RomRoomInfo.RoomName; + co_CheckTime = RomRoomInfo.LastCheckInTime; + co_RoomPosition = RomRoomInfo.RoomLocation; + co_RoomState = RomRoomInfo.RoomState; } @@ -180,33 +182,33 @@ namespace EOM.TSHotelManagement.FormUI { this.CanPenetrate(); this.Region = new Region(GetRoundRectPath(new RectangleF(0, 0, this.Width, this.Height), 6f)); - if (romCustoInfo != null) + if (RomCustoInfo != null) { - us_CustoNo = romCustoInfo.CustomerNumber; - us_CustoName = romCustoInfo.CustomerName; - us_CustoSex = romCustoInfo.CustomerGender == 1 ? "男" : "女"; - us_CustoTel = romCustoInfo.CustomerPhoneNumber; - us_CustoID = romCustoInfo.IdCardNumber; - us_CustoBirthday = romCustoInfo.DateOfBirth == default ? "" : Convert.ToDateTime(romCustoInfo.DateOfBirth).ToString(); - us_CustoPassportType = Convert.ToInt32(romCustoInfo.PassportId); - us_CustoType = romCustoInfo.CustomerType; - us_CustoAddress = romCustoInfo.CustomerAddress; + us_CustoNo = RomCustoInfo.CustomerNumber; + us_CustoName = RomCustoInfo.CustomerName; + us_CustoSex = RomCustoInfo.CustomerGender == 1 ? "男" : "女"; + us_CustoTel = RomCustoInfo.CustomerPhoneNumber; + us_CustoID = RomCustoInfo.IdCardNumber; + us_CustoBirthday = RomCustoInfo.DateOfBirth == default ? "" : Convert.ToDateTime(RomCustoInfo.DateOfBirth).ToString(); + us_CustoPassportType = Convert.ToInt32(RomCustoInfo.PassportId); + us_CustoType = RomCustoInfo.CustomerType; + us_CustoAddress = RomCustoInfo.CustomerAddress; } - switch (romRoomInfo.RoomStateId) + switch (RomRoomInfo.RoomStateId) { - case (int)Shared.RoomState.Vacant: + case (int)Common.RoomState.Vacant: btnRoom.BackgroundImage = Resources.可住状态; break; - case (int)Shared.RoomState.Occupied: + case (int)Common.RoomState.Occupied: btnRoom.BackgroundImage = Resources.已住状态; break; - case (int)Shared.RoomState.Maintenance: + case (int)Common.RoomState.Maintenance: btnRoom.BackgroundImage = Resources.维修状态; break; - case (int)Shared.RoomState.Dirty: + case (int)Common.RoomState.Dirty: btnRoom.BackgroundImage = Resources.脏房状态; break; - case (int)Shared.RoomState.Reserved: + case (int)Common.RoomState.Reserved: btnRoom.BackgroundImage = Resources.预约状态; break; } @@ -222,15 +224,15 @@ namespace EOM.TSHotelManagement.FormUI private void tsmiCheckIn_Click(object sender, EventArgs e) { - if (romCustoInfo != null && romRoomInfo != null) + if (RomCustoInfo != null && RomRoomInfo != null) { - rm_CustoNo = romCustoInfo.CustomerNumber; - rm_RoomNo = romRoomInfo.RoomNumber; - rm_RoomType = romRoomInfo.RoomName; - rm_RoomMoney = Convert.ToDecimal(romRoomInfo.RoomRent).ToString(); - if (r.RoomStateId == new EnumHelper().GetEnumValue(Shared.RoomState.Reserved)) + rm_CustoNo = RomCustoInfo.CustomerNumber; + rm_RoomNo = RomRoomInfo.RoomNumber; + rm_RoomType = RomRoomInfo.RoomName; + rm_RoomMoney = Convert.ToDecimal(RomRoomInfo.RoomRent).ToString(); + if (r.RoomStateId == new EnumHelper().GetEnumValue(Common.RoomState.Reserved)) { - rm_RoomStateId = (int)Shared.RoomState.Reserved; + rm_RoomStateId = (int)Common.RoomState.Reserved; NotificationService.ShowInfo("欢迎入住,请先注册客户信息!"); FrmReserList frm = new FrmReserList(); frm.ShowDialog(); @@ -251,10 +253,10 @@ namespace EOM.TSHotelManagement.FormUI private void tsmiCheckOut_Click(object sender, EventArgs e) { - rm_CustoNo = romRoomInfo.CustomerNumber; - co_CustoName = romCustoInfo.CustomerName; - rm_RoomNo = romRoomInfo.RoomNumber; - rm_RoomType = romRoomInfo.RoomName; + rm_CustoNo = RomRoomInfo.CustomerNumber; + co_CustoName = RomCustoInfo.CustomerName; + rm_RoomNo = RomRoomInfo.RoomNumber; + rm_RoomType = RomRoomInfo.RoomName; FrmCheckOutDetail frm = new FrmCheckOutDetail(); frm.ShowDialog(); } @@ -264,18 +266,18 @@ namespace EOM.TSHotelManagement.FormUI public static string? RoomState; private void tsmiChangeRoom_Click(object sender, EventArgs e) { - if (romCustoInfo != null && romRoomInfo != null) + if (RomCustoInfo != null && RomRoomInfo != null) { - var dr = AntdUI.Modal.open(new AntdUI.Modal.Config(null, UIMessageConstant.Information, "是否要进行房间更换?", AntdUI.TType.Info) + var dr = AntdUI.Modal.open(new Modal.Config(UIMessageConstant.Information, "是否要进行房间更换?", AntdUI.TType.Info) { CancelText = LocalizationHelper.GetLocalizedString(UIMessageConstant.Eng_No, UIMessageConstant.Chs_No), OkText = LocalizationHelper.GetLocalizedString(UIMessageConstant.Eng_Yes, UIMessageConstant.Chs_Yes) }); if (dr == DialogResult.OK) { - RoomNo = romRoomInfo.RoomNumber; - CustoNo = romCustoInfo.CustomerNumber; - RoomState = romRoomInfo.RoomState; + RoomNo = RomRoomInfo.RoomNumber; + CustoNo = RomCustoInfo.CustomerNumber; + RoomState = RomRoomInfo.RoomState; FrmChangeRoom frm = new FrmChangeRoom(); frm.ShowDialog(); } @@ -289,15 +291,15 @@ namespace EOM.TSHotelManagement.FormUI private void tsmiSelectUserInfo_Click(object sender, EventArgs e) { - FrmCustomerInfo frm = new FrmCustomerInfo(romCustoInfo.CustomerNumber); + FrmCustomerInfo frm = new FrmCustomerInfo(RomCustoInfo.CustomerNumber); frm.ShowDialog(); } private void tsmiChangeState_Click(object sender, EventArgs e) { - if (r.RoomStateId == (int)Shared.RoomState.Reserved) + if (r.RoomStateId == (int)Common.RoomState.Reserved) { - var dr = AntdUI.Modal.open(new AntdUI.Modal.Config(null, UIMessageConstant.Warning, "当前房间已被预约,确认更改状态后将会删除原本预约状态及信息,你确定吗?", AntdUI.TType.Warn) + var dr = AntdUI.Modal.open(new AntdUI.Modal.Config(UIMessageConstant.Warning, "当前房间已被预约,确认更改状态后将会删除原本预约状态及信息,你确定吗?", AntdUI.TType.Warn) { CancelText = LocalizationHelper.GetLocalizedString(UIMessageConstant.Eng_No, UIMessageConstant.Chs_No), OkText = LocalizationHelper.GetLocalizedString(UIMessageConstant.Eng_Yes, UIMessageConstant.Chs_Yes) @@ -331,10 +333,10 @@ namespace EOM.TSHotelManagement.FormUI } } } - if (romCustoInfo != null && romRoomInfo != null) + if (RomCustoInfo != null && RomRoomInfo != null) { - rm_RoomStateId = romRoomInfo.RoomStateId; - rm_RoomNo = romRoomInfo.RoomNumber; + rm_RoomStateId = RomRoomInfo.RoomStateId; + rm_RoomNo = RomRoomInfo.RoomNumber; FrmRoomStateManager frsm = new FrmRoomStateManager(); frsm.ShowDialog(); } @@ -395,7 +397,7 @@ namespace EOM.TSHotelManagement.FormUI { switch (r.RoomStateId) { - case (int)Shared.RoomState.Vacant: + case (int)Common.RoomState.Vacant: item.Enabled = item.Text switch { UIControlConstant.CheckInRoom => true, @@ -407,7 +409,7 @@ namespace EOM.TSHotelManagement.FormUI _ => item.Enabled }; break; - case (int)Shared.RoomState.Occupied: + case (int)Common.RoomState.Occupied: item.Enabled = item.Text switch { UIControlConstant.CheckInRoom => false, @@ -419,8 +421,8 @@ namespace EOM.TSHotelManagement.FormUI _ => item.Enabled }; break; - case (int)Shared.RoomState.Maintenance: - case (int)Shared.RoomState.Dirty: + case (int)Common.RoomState.Maintenance: + case (int)Common.RoomState.Dirty: item.Enabled = item.Text switch { UIControlConstant.CheckInRoom => false, diff --git a/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucWindowHeader.cs b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucWindowHeader.cs index 9a55037..5b676d1 100644 --- a/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucWindowHeader.cs +++ b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucWindowHeader.cs @@ -1,4 +1,4 @@ -using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Shared; using System.Drawing.Drawing2D; namespace EOM.TSHotelManagement.FormUI diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs index 388da47..c5e0d7a 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs @@ -23,7 +23,7 @@ */ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Shared; using Newtonsoft.Json; using System; using System.Diagnostics; diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs index eb3a016..9089c67 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs @@ -24,8 +24,8 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.EncryptorLib; using jvncorelib.EntityLib; @@ -178,7 +178,7 @@ namespace EOM.TSHotelManagement.FormUI } catch (Exception ex) { - RecordHelper.Record(LocalizationHelper.GetLocalizedString($"Login error:{ex.Message}", $"登录异常:{ex.Message}"), Shared.LogLevel.Critical); + RecordHelper.Record(LocalizationHelper.GetLocalizedString($"Login error:{ex.Message}", $"登录异常:{ex.Message}"), Common.LogLevel.Critical); NotificationService.ShowError(LocalizationHelper.GetLocalizedString("The server is under maintenance, please try again later", "服务器维护中,请稍后再试!")); } } diff --git a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs index 7a8cdc4..cda3091 100644 --- a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs +++ b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs @@ -24,10 +24,9 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Util; -using EOM.TSHotelManagement.FormUI.Properties; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; +using EOM.TSHotelManagement.FormUI.Properties; using jvncorelib.CodeLib; using jvncorelib.EntityLib; using System.Diagnostics; @@ -203,13 +202,13 @@ namespace EOM.TSHotelManagement.FormUI return; } listData = response.Data.Items; - MenuItem menuItem = null; + AntdUI.MenuItem menuItem = null; muNavBar.Controls.Clear(); if (!listData.IsNullOrEmpty()) { foreach (var item in listData) { - menuItem = new MenuItem + menuItem = new AntdUI.MenuItem { Text = item.NavigationBarName }; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.cs index 15f2df0..edde48b 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.cs @@ -23,7 +23,7 @@ */ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Shared; namespace EOM.TSHotelManagement.FormUI { diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.cs index f926c36..f20ca23 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.cs @@ -1,7 +1,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; namespace EOM.TSHotelManagement.FormUI diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.cs index a118bed..e6a898e 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.cs @@ -1,6 +1,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.ComponentModel; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs index 83484ff..3130b55 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs @@ -24,7 +24,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs index 882e1cd..ed9ee40 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs @@ -25,7 +25,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Transactions; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs index f772a3d..48b380b 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs @@ -1,6 +1,6 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Data; @@ -19,12 +19,24 @@ namespace EOM.TSHotelManagement.FormUI ResponseMsg result = null; Dictionary dic = null; - public static CreateEnergyManagementInputDto w; - public static decimal TotalConsumptionAmount = 0M; + private static CreateEnergyManagementInputDto w; + private static decimal totalConsumptionAmount = 0M; + private static decimal roomRentMoney = 0M; + + public static CreateEnergyManagementInputDto W => w; + public static decimal TotalConsumptionAmount + { + get => totalConsumptionAmount; + private set => totalConsumptionAmount = value; + } + public static decimal RoomRentMoney + { + get => roomRentMoney; + private set => roomRentMoney = value; + } private void FrmCheckOutDetail_Load(object sender, EventArgs e) { - decimal sum = 0; CustoNo.Text = ucRoom.rm_CustoNo; txtRoomNo.Text = ucRoom.rm_RoomNo; CustoName.Text = ucRoom.co_CustoName; @@ -64,7 +76,7 @@ namespace EOM.TSHotelManagement.FormUI return; } - sum = Convert.ToDecimal(Convert.ToString(Convert.ToInt32(stayDays.Data.StayDays) * room.RoomRent)); + RoomRentMoney = Convert.ToDecimal(Convert.ToString(Convert.ToInt32(stayDays.Data.StayDays) * room.RoomRent)); lblDay.Text = Convert.ToString(Convert.ToInt32(stayDays.Data.StayDays)); @@ -120,27 +132,18 @@ namespace EOM.TSHotelManagement.FormUI var customerType = customerTypeResponse.Data; - //计算消费总额 - //dic = new Dictionary() - //{ - // { nameof(ReadSpendInputDto.RoomNumber), txtRoomNo.Text.Trim() }, - // { nameof(ReadSpendInputDto.CustomerNumber), CustoNo.Text.Trim() }, - //}; - //result = HttpHelper.Request(ApiConstants.Spend_SumConsumptionAmount, dic); - //var spendResponse = HttpHelper.JsonToModel>(result.message); - //if (spendResponse.Success == false) - //{ - // NotificationService.ShowError($"{ApiConstants.Spend_SumConsumptionAmount}+接口服务异常,请提交Issue或尝试更新版本!"); - // return; - //} - decimal total = TotalConsumptionAmount; - decimal m = total + sum; + decimal consumptionMoney = TotalConsumptionAmount; + decimal roomRentMoney = RoomRentMoney; + decimal totalMoney = consumptionMoney + roomRentMoney; decimal discount = (customerType != null && customerType.Discount > 0 && customerType.Discount < 100) - ? customerType.Discount / 100M - : 1M; - lblGetReceipts.Text = m.ToString("#,##0.00"); - lblVIPPrice.Text = (m * discount).ToString("#,##0.00"); - lblVIP.Text = (discount < 1M) ? DiscountHelper.ToZheString(customerType.Discount) : "无折扣(100%)"; + ? customerType.Discount / 100M + : 1M; + decimal originalAmount, discountedAmount; + string discountText; + DiscountHelper.CalculateDiscount(roomRentMoney, consumptionMoney, discount, out originalAmount, out discountedAmount, out discountText); + lblGetReceipts.Text = totalMoney.ToString("#,##0.00"); + lblVIPPrice.Text = discountedAmount.ToString("#,##0.00"); + lblVIP.Text = (discount < 1M) ? discountText : "无折扣(100%)"; } object GetPageData(int current, int pageSize, ref int totalCount) diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.cs index af59270..dd09eee 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.cs @@ -24,14 +24,17 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; +using EOM.TSHotelManagement.Shared; +using System.ComponentModel; namespace EOM.TSHotelManagement.FormUI { public partial class FrmCustomerInfo : Window { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmCustomerInfo)); - public string CustomerNumber { get; set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string CustomerNumber { get => customerNumber; set => customerNumber = value; } public FrmCustomerInfo(string customerNumber) { InitializeComponent(); @@ -42,6 +45,7 @@ namespace EOM.TSHotelManagement.FormUI Dictionary dic = null; ResponseMsg result = null; + private string customerNumber; private void FrmSelectCustoInfo_Load(object sender, EventArgs e) { diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs index 4770379..99a7aef 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs @@ -24,7 +24,8 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Runtime.InteropServices; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs index 3250e18..1342068 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs @@ -24,7 +24,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; using jvncorelib.CodeLib; using jvncorelib.EntityLib; @@ -79,12 +79,7 @@ namespace EOM.TSHotelManagement.FormUI #endregion #region 加载性别信息 - dic = new Dictionary - { - { nameof(ReadGenderTypeInputDto.IsDelete) , "0" }, - { nameof(ReadGenderTypeInputDto.IgnorePaging) , "true" } - }; - result = HttpHelper.Request(ApiConstants.Base_SelectGenderTypeAll, dic); + result = HttpHelper.Request(ApiConstants.Base_SelectGenderTypeAll); var genderTypes = HttpHelper.JsonToModel>(result.message); if (genderTypes.Success == false) { diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs index 51bf59b..9c4c703 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs @@ -1,9 +1,9 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Shared; +using EOM.TSHotelManagement.Contract; using jvncorelib.EntityLib; using System.Data; +using EOM.TSHotelManagement.Shared; namespace EOM.TSHotelManagement.FormUI { @@ -35,12 +35,7 @@ namespace EOM.TSHotelManagement.FormUI } cboEmployeeNation.Items.AddRange(nations.Data.Items.Select(item => new AntdUI.SelectItem(item.NationName, item.NationNumber)).ToArray()); //加载性别信息 - dic = new Dictionary - { - { nameof(ReadGenderTypeInputDto.IsDelete) , "0" }, - { nameof(ReadGenderTypeInputDto.IgnorePaging) , "true" } - }; - result = HttpHelper.Request(ApiConstants.Base_SelectGenderTypeAll, dic); + result = HttpHelper.Request(ApiConstants.Base_SelectGenderTypeAll); var genderTypes = HttpHelper.JsonToModel>(result.message); if (genderTypes.Success == false) { diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs index bf4ef3f..f282aae 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs @@ -22,8 +22,8 @@ * */ using AntdUI; -using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.CodeLib; using jvncorelib.EntityLib; @@ -139,12 +139,7 @@ namespace EOM.TSHotelManagement.FormUI #endregion #region 加载性别信息 - dic = new Dictionary - { - { nameof(ReadGenderTypeInputDto.IsDelete), "0"}, - { nameof(ReadGenderTypeInputDto.IgnorePaging), "true" } - }; - result = HttpHelper.Request(ApiConstants.Base_SelectGenderTypeAll, dic); + result = HttpHelper.Request(ApiConstants.Base_SelectGenderTypeAll); var genderTypeDataSource = HttpHelper.JsonToModel>(result.message); if (genderTypeDataSource.Success == false) { diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs index 5fa32be..64fba56 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs @@ -23,11 +23,11 @@ */ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Shared; +using EOM.TSHotelManagement.Contract; using jvncorelib.CodeLib; using jvncorelib.EntityLib; using System.Transactions; +using EOM.TSHotelManagement.Shared; namespace EOM.TSHotelManagement.FormUI { diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs index 927230e..13d01b8 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs @@ -24,10 +24,10 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.FormUI.Properties; -using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; +using EOM.TSHotelManagement.Shared; namespace EOM.TSHotelManagement.FormUI { @@ -180,12 +180,12 @@ namespace EOM.TSHotelManagement.FormUI Description = new EnumHelper().GetEnumDescription(e) }) .ToList(); - MenuItem? menuItem = null; + AntdUI.MenuItem? menuItem = null; if (!stateList.IsNullOrEmpty()) { foreach (var item in stateList) { - menuItem = new MenuItem + menuItem = new AntdUI.MenuItem { Text = item.Description + GetRoomCountText(item.Name), ID = item.Id.ToString(), @@ -339,8 +339,8 @@ namespace EOM.TSHotelManagement.FormUI { room = new ucRoom(this); room.btnRoom.Text = string.Format("{0}\n\n{1}\n\n{2}", romsty[i].RoomName, romsty[i].RoomNumber, romsty[i].CustomerName ?? " "); - room.romRoomInfo = romsty[i]; - room.romCustoInfo = new ReadCustomerOutputDto { CustomerNumber = romsty[i].CustomerNumber, CustomerName = romsty[i].CustomerName }; + room.RomRoomInfo = romsty[i]; + room.RomCustoInfo = new ReadCustomerOutputDto { CustomerNumber = romsty[i].CustomerNumber, CustomerName = romsty[i].CustomerName }; flpRoom.Controls.Add(room); } lblRoomNo.Text = ""; @@ -372,8 +372,8 @@ namespace EOM.TSHotelManagement.FormUI { room = new ucRoom(this); room.btnRoom.Text = string.Format("{0}\n\n{1}\n\n{2}", romsty[i].RoomName, romsty[i].RoomNumber, romsty[i].CustomerName); - room.romRoomInfo = romsty[i]; - room.romCustoInfo = new ReadCustomerOutputDto { CustomerNumber = romsty[i].CustomerNumber, CustomerName = romsty[i].CustomerName }; + room.RomRoomInfo = romsty[i]; + room.RomCustoInfo = new ReadCustomerOutputDto { CustomerNumber = romsty[i].CustomerNumber, CustomerName = romsty[i].CustomerName }; flpRoom.Controls.Add(room); } lblRoomNo.Text = ""; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs index e23d65c..a21ed82 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs @@ -24,7 +24,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.cs index dbc877f..a0ef617 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.cs @@ -1,5 +1,5 @@ using AntdUI; -using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Shared; using jvncorelib.EncryptorLib; namespace EOM.TSHotelManagement.FormUI diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs index 109fa73..1bb2cb5 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs @@ -24,8 +24,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Transactions; @@ -276,9 +275,9 @@ namespace EOM.TSHotelManagement.FormUI } if (!spend.IsNullOrEmpty()) { - if (spend.ConsumptionType == SpendType.Room.Code || spend.ConsumptionType == SpendType.Other.Code) + if (spend.ConsumptionType == SpendTypeConstant.Room.Code || spend.ConsumptionType == SpendTypeConstant.Other.Code) { - NotificationService.ShowError($"此条消费记录非{SpendType.Product.Description}记录,无法删除!"); + NotificationService.ShowError($"此条消费记录非{SpendTypeConstant.Product.Description}记录,无法删除!"); return; } var dr = AntdUI.Modal.open(new AntdUI.Modal.Config(this, UIMessageConstant.Information, $"你确定要撤回该消费记录吗?", AntdUI.TType.Info) diff --git a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj index a33ed3a..eb25734 100644 --- a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj +++ b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj @@ -6,12 +6,12 @@ true win-x64 WinExe - net8.0-windows + net10.0-windows enable true enable true - 2.8.6.0 + 2.10.7.0 EOM.TSHotelManagement.FormUI.Program x64 TS酒店管理系统 @@ -96,19 +96,11 @@ - - - True - True - True - - - - + - + @@ -116,7 +108,7 @@ - + @@ -127,9 +119,7 @@ - - PreserveNewest - + diff --git a/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs b/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs index 8ed3030..9bf8e7a 100644 --- a/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs +++ b/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs @@ -10,51 +10,6 @@ namespace EOM.TSHotelManagement.FormUI Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.SetHighDpiMode(HighDpiMode.SystemAware); - - AppDomain.CurrentDomain.AssemblyLoad += OnAssemblyLoad; - InitializeConstantsInLoadedAssemblies(); - } - - static void OnAssemblyLoad(object sender, AssemblyLoadEventArgs args) - { - InitializeConstantsInAssembly(args.LoadedAssembly); - } - - static void InitializeConstantsInLoadedAssemblies() - { - foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) - { - InitializeConstantsInAssembly(assembly); - } - } - - static void InitializeConstantsInAssembly(Assembly assembly) - { - var constantTypes = assembly.GetTypes() - .Where(t => IsSubclassOfRawGeneric(typeof(Constant<>), t) && t.IsClass); - - foreach (var type in constantTypes) - { - var fields = type.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); - foreach (var field in fields) - { - var value = field.GetValue(null); - } - } - } - - static bool IsSubclassOfRawGeneric(Type generic, Type toCheck) - { - while (toCheck != null && toCheck != typeof(object)) - { - var cur = toCheck.IsGenericType ? toCheck.GetGenericTypeDefinition() : toCheck; - if (generic == cur) - { - return true; - } - toCheck = toCheck.BaseType; - } - return false; } } } diff --git a/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Common.Contract.xml b/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Common.Contract.xml index 22f5b6d..069e1f8 100644 --- a/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Common.Contract.xml +++ b/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Common.Contract.xml @@ -1,635 +1,635 @@ - EOM.TSHotelManagement.Common.Contract + EOM.TSHotelManagement.Contract - + 资料创建人 - + 资料创建时间 - + 资料更新人 - + 资料更新时间 - + Token - + 删除标识 - + 状态码,例如 0 表示成功 - + 返回消息,用于描述请求结果 - + - + 带状态码和消息的构造函数 状态码 消息 - + 请求成功 - + 创建成功(常用于 POST 请求) - + 已接受(请求已接收但未处理完成) - + 无内容(响应体为空) - + 永久重定向 - + 临时重定向 - + 查看其他地址(常用于 POST 后重定向) - + 资源未修改(缓存用) - + 错误请求(参数或格式错误) - + 未授权(身份验证失败) - + 禁止访问(无权限) - + 未找到资源 - + 方法不允许(如 GET 接口用 POST 访问) - + 请求超时 - + 资源冲突(如重复提交) - + 服务器内部错误 - + 网关错误(上游服务异常) - + 服务不可用(维护或过载) - + 网关超时(上游服务响应超时) - + 页数 - + 总数 - + 忽略分页 - + 带总数的列表输出Dto - + 数据源 - + 菜单 - + 菜单主键 (Menu Key) - + 菜单标题 (Menu Title) - + 菜单路径 (Menu Path) - + 图标 - + 子菜单 (Child Menus) - + 数据源 - + 账号 (Account) - + 密码 (Password) - + 邮箱 (Email) - + 账号 (Account) - + 邮箱 (Email) - + 名称 (Name) - + 密码 (Password) - + 状态 (Status) - + 最后一次登录地址 (Last Login IP) - + 最后一次登录时间 (Last Login Time) - + 客户类型 (Customer Type) - + 客户类型名称 (Customer Type Name) - + 优惠折扣 - + 打卡编号 (Check-in/Check-out Number) - + 员工工号 (Employee ID) - + 打卡时间 (Check-in/Check-out Time) - + 打卡方式 (Check-in/Check-out Method) - + 打卡状态 (Check-in/Check-out Status) - + 是否为超级管理员描述 (Is Super Administrator Description) - + 管理员类型名称 (Administrator Type Name) - + 公告类型编号 (AppointmentNotice Type Number) - + 公告类型名称 (AppointmentNotice Type Name) - + 公告类型编号 (AppointmentNotice Type Number) - + 公告类型编号 (AppointmentNotice Type Number) - + 公告类型名称 (AppointmentNotice Type Name) - + 公告类型编号 (AppointmentNotice Type Number) - + 公告类型名称 (AppointmentNotice Type Name) - + 删除标识 - + 资料创建人 - + 资料创建时间 - + 资料更新人 - + 资料更新时间 - + 公告类型编号 (AppointmentNotice Type Number) - + 公告类型名称 (AppointmentNotice Type Name) - + 菜单视图模型 (Menu View Model) - + 菜单主键 (Menu Key) - + 菜单标题 (Menu Title) - + 菜单路径 (Menu Path) - + 子菜单 (Child Menus) - + 系统模块常量类 - + 基础信息 - + 财务信息 - + 水电管理 - + 监管统计 - + 客房管理 - + 客户管理 - + 人事管理 - + 物资管理 - + 员工操作日志 - + 系统管理 - + 备 注:角色编码 默认值: - + 备 注:角色名字 默认值: - + 备 注:角色描述 默认值: - + 备 注:角色编码 默认值: - + 备 注:角色编码 默认值: - + 备 注:角色名字 默认值: - + 备 注:角色描述 默认值: - + 备 注:角色编码 默认值: - + 备 注:角色名字 默认值: - + 备 注:角色描述 默认值: - + 备 注:角色编码 默认值: - + 备 注:角色名字 默认值: - + 备 注:角色描述 默认值: - + 请求路径 (Request Path) - + 响应时间 (Elapsed Time) - + 请求方法 (Http Method) - + 状态码 (Status Code) - + 异常消息 (Exception Message) - + 异常堆栈 (Exception Stack Trace) - + 请求路径 (URL Path) - + HTTP方法 (GET/POST等) - + 请求IP地址 - + 请求参数 - + HTTP状态码 - + 请求时长(毫秒) - + 用户代理 (浏览器信息) - + 用户名 (未登录则为空) - + 异常信息 - + 请求时间 (自动设置为当前时间) - + 响应大小(字节) - + API操作描述 - + 软件版本 diff --git a/EOM.TSHotelManagement.FormUI/Services/NotificationService.cs b/EOM.TSHotelManagement.FormUI/Services/NotificationService.cs index 437ff5b..835489a 100644 --- a/EOM.TSHotelManagement.FormUI/Services/NotificationService.cs +++ b/EOM.TSHotelManagement.FormUI/Services/NotificationService.cs @@ -1,6 +1,6 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Shared; namespace EOM.TSHotelManagement.FormUI { @@ -8,7 +8,7 @@ namespace EOM.TSHotelManagement.FormUI { public static void ShowSuccess(string message) { - Modal.open(new Modal.Config(null, UIMessageConstant.Success, message, TType.Success) + Modal.open(new Modal.Config(UIMessageConstant.Success, message, TType.Success) { Draggable = true, CancelText = null, @@ -22,7 +22,7 @@ namespace EOM.TSHotelManagement.FormUI public static void ShowError(string message) { - Modal.open(new Modal.Config(null, UIMessageConstant.Error, message, TType.Error) + Modal.open(new Modal.Config(UIMessageConstant.Error, message, TType.Error) { Draggable = true, CancelText = null, @@ -36,7 +36,7 @@ namespace EOM.TSHotelManagement.FormUI public static void ShowInfo(string message) { - Modal.open(new Modal.Config(null, UIMessageConstant.Information, message, TType.Info) + Modal.open(new Modal.Config(UIMessageConstant.Information, message, TType.Info) { Draggable = true, CancelText = null, @@ -50,7 +50,7 @@ namespace EOM.TSHotelManagement.FormUI public static void ShowWarning(string message) { - Modal.open(new Modal.Config(null, UIMessageConstant.Warning, message, TType.Warn) + Modal.open(new Modal.Config(UIMessageConstant.Warning, message, TType.Warn) { Draggable = true, CancelText = null, diff --git a/EOM.TSHotelManagement.FormUI/TableComponent/TableComHelper.cs b/EOM.TSHotelManagement.FormUI/TableComponent/TableComHelper.cs index 57ab213..f627494 100644 --- a/EOM.TSHotelManagement.FormUI/TableComponent/TableComHelper.cs +++ b/EOM.TSHotelManagement.FormUI/TableComponent/TableComHelper.cs @@ -1,5 +1,5 @@ using AntdUI; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Common; using System.Reflection; using System.Text; using System.Xml.Linq; diff --git a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs b/EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs similarity index 99% rename from EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs rename to EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs index 4aa76f2..cd31cd7 100644 --- a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs +++ b/EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs @@ -1,4 +1,4 @@ -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { public static class ApiConstants { diff --git a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj b/EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj similarity index 48% rename from EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj rename to EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj index fdfd576..86c3066 100644 --- a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj +++ b/EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 enable enable x64 @@ -9,12 +9,13 @@ + - - - + + + diff --git a/EOM.TSHotelManagement.Common/Helper/CsrfTokenHelper.cs b/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs similarity index 93% rename from EOM.TSHotelManagement.Common/Helper/CsrfTokenHelper.cs rename to EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs index 7677a20..7e4c7ca 100644 --- a/EOM.TSHotelManagement.Common/Helper/CsrfTokenHelper.cs +++ b/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs @@ -1,4 +1,4 @@ -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; using jvncorelib.EntityLib; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { public static class CsrfTokenHelper { diff --git a/EOM.TSHotelManagement.Shared/Helper/DiscountHelper.cs b/EOM.TSHotelManagement.Shared/Helper/DiscountHelper.cs new file mode 100644 index 0000000..f2611a6 --- /dev/null +++ b/EOM.TSHotelManagement.Shared/Helper/DiscountHelper.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace EOM.TSHotelManagement.Shared +{ + public static class DiscountHelper + { + /// + /// 计算折扣价格 + /// + /// 总消费金额 + /// 额外金额 + /// 客户类型 + /// 输出:原始金额 + /// 输出:折扣后金额 + /// 输出:折扣信息 + public static void CalculateDiscount( + decimal totalAmount, + decimal additionalAmount, + decimal discount, + out decimal originalAmount, + out decimal discountedAmount, + out string discountText) + { + // 计算总金额 + originalAmount = totalAmount + additionalAmount; + + // 计算折扣系数 + decimal discountRate = (discount > 0 && discount < 100) + ? discount / 100M + : 1M; + + // 计算折扣后金额 + discountedAmount = originalAmount * discountRate; + + // 获取折扣文本 + discountText = (discount > 0 && discount < 100) + ? ToZheString(discount) + : "无折扣(100%)"; + } + /// + /// 将折扣百分比转换为中文折扣字符串 + /// 例如:20 -> "八折",25 -> "七五折" + /// + /// 折扣百分比(如20表示8折,30表示7折) + /// 中文折扣字符串 + public static string ToZheString(decimal discountPercentage) + { + if (discountPercentage <= 0 || discountPercentage >= 100) + { + return "无折扣"; + } + + // 计算实际支付比例(100% - 折扣百分比) + decimal payPercentage = 100 - discountPercentage; + + // 将支付比例转换为"折"表示 + return ConvertToChineseZhe(payPercentage); + } + + /// + /// 将支付比例转换为中文折扣表示 + /// + /// 支付比例(如80表示支付80%,即8折) + /// 中文折扣字符串 + private static string ConvertToChineseZhe(decimal payPercentage) + { + // 常见折扣的简写 + var commonDiscounts = new Dictionary + { + { 100, "全价" }, + { 95, "九五折" }, + { 90, "九折" }, + { 85, "八五折" }, + { 80, "八折" }, + { 75, "七五折" }, + { 70, "七折" }, + { 65, "六五折" }, + { 60, "六折" }, + { 55, "五五折" }, + { 50, "五折" }, + { 45, "四五折" }, + { 40, "四折" }, + { 35, "三五折" }, + { 30, "三折" }, + { 25, "二五折" }, + { 20, "两折" }, + { 15, "一五折" }, + { 10, "一折" }, + { 5, "半折" } + }; + + // 如果找到常见的折扣,直接返回 + if (commonDiscounts.ContainsKey(payPercentage)) + { + return commonDiscounts[payPercentage]; + } + + // 对于不常见的折扣,转换为中文数字 + return ConvertPercentageToChinese(payPercentage) + "折"; + } + + /// + /// 将百分比转换为中文数字表示 + /// + private static string ConvertPercentageToChinese(decimal percentage) + { + // 将百分比除以10得到折数 + decimal zhe = percentage / 10; + + // 中文数字数组 + string[] chineseDigits = { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九" }; + string[] chineseUnits = { "", "十", "百", "千" }; + + // 处理常见的小数折扣 + if (zhe == (int)zhe) + { + // 整数折扣 + return ConvertIntegerToChinese((int)zhe, chineseDigits, chineseUnits); + } + else + { + // 小数折扣(如8.5折) + return ConvertDecimalToChinese(zhe, chineseDigits); + } + } + + /// + /// 将整数折扣转换为中文 + /// + private static string ConvertIntegerToChinese(int number, string[] digits, string[] units) + { + if (number == 10) return "十"; + if (number < 10) return digits[number]; + + // 处理10-99之间的数字 + string result = ""; + int tens = number / 10; + int ones = number % 10; + + if (tens > 1) result += digits[tens]; + result += "十"; + if (ones > 0) result += digits[ones]; + + return result; + } + + /// + /// 将小数折扣转换为中文 + /// + private static string ConvertDecimalToChinese(decimal number, string[] digits) + { + // 处理一位小数的情况(如8.5 -> 八五) + string str = number.ToString("0.0"); + string[] parts = str.Split('.'); + + int integerPart = int.Parse(parts[0]); + int decimalPart = int.Parse(parts[1]); + + string result = ConvertIntegerToChinese(integerPart, digits, new string[] { "", "十", "百", "千" }); + + if (decimalPart > 0) + { + result += digits[decimalPart]; + } + + return result; + } + } +} diff --git a/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs b/EOM.TSHotelManagement.Shared/Helper/HttpHelper.cs similarity index 99% rename from EOM.TSHotelManagement.Common/Helper/HttpHelper.cs rename to EOM.TSHotelManagement.Shared/Helper/HttpHelper.cs index cd2206f..4c3d893 100644 --- a/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs +++ b/EOM.TSHotelManagement.Shared/Helper/HttpHelper.cs @@ -6,7 +6,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Web; -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { /// /// 文件上传帮助类 diff --git a/EOM.TSHotelManagement.Common/Helper/ResponseMsg.cs b/EOM.TSHotelManagement.Shared/Helper/ResponseMsg.cs similarity index 86% rename from EOM.TSHotelManagement.Common/Helper/ResponseMsg.cs rename to EOM.TSHotelManagement.Shared/Helper/ResponseMsg.cs index 21c073f..09e5df8 100644 --- a/EOM.TSHotelManagement.Common/Helper/ResponseMsg.cs +++ b/EOM.TSHotelManagement.Shared/Helper/ResponseMsg.cs @@ -1,4 +1,4 @@ -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { public class ResponseMsg { diff --git a/EOM.TSHotelManagement.Common/LocalInfo/LoginInfo.cs b/EOM.TSHotelManagement.Shared/LocalInfo/LoginInfo.cs similarity index 98% rename from EOM.TSHotelManagement.Common/LocalInfo/LoginInfo.cs rename to EOM.TSHotelManagement.Shared/LocalInfo/LoginInfo.cs index c5930c9..b98e05f 100644 --- a/EOM.TSHotelManagement.Common/LocalInfo/LoginInfo.cs +++ b/EOM.TSHotelManagement.Shared/LocalInfo/LoginInfo.cs @@ -22,7 +22,7 @@ * *模块说明:登录信息静态类(前台工作人员登入后的本地信息存储) */ -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { /// /// 登录信息静态类(前台工作人员登入后的本地信息存储) diff --git a/EOM.TSHotelManagement.Common/UIControlConstant.cs b/EOM.TSHotelManagement.Shared/UIControlConstant.cs similarity index 96% rename from EOM.TSHotelManagement.Common/UIControlConstant.cs rename to EOM.TSHotelManagement.Shared/UIControlConstant.cs index 5ba682d..4eecd04 100644 --- a/EOM.TSHotelManagement.Common/UIControlConstant.cs +++ b/EOM.TSHotelManagement.Shared/UIControlConstant.cs @@ -1,4 +1,4 @@ -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { public class UIControlConstant { diff --git a/EOM.TSHotelManagement.Common/UIControlIconConstant.cs b/EOM.TSHotelManagement.Shared/UIControlIconConstant.cs similarity index 99% rename from EOM.TSHotelManagement.Common/UIControlIconConstant.cs rename to EOM.TSHotelManagement.Shared/UIControlIconConstant.cs index cfa1d57..ba01ac1 100644 --- a/EOM.TSHotelManagement.Common/UIControlIconConstant.cs +++ b/EOM.TSHotelManagement.Shared/UIControlIconConstant.cs @@ -1,4 +1,4 @@ -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { public class UIControlIconConstant { diff --git a/EOM.TSHotelManagement.Common/UIMessageConstant.cs b/EOM.TSHotelManagement.Shared/UIMessageConstant.cs similarity index 94% rename from EOM.TSHotelManagement.Common/UIMessageConstant.cs rename to EOM.TSHotelManagement.Shared/UIMessageConstant.cs index 2e8483a..bed888a 100644 --- a/EOM.TSHotelManagement.Common/UIMessageConstant.cs +++ b/EOM.TSHotelManagement.Shared/UIMessageConstant.cs @@ -1,4 +1,4 @@ -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { public class UIMessageConstant { diff --git a/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs b/EOM.TSHotelManagement.Shared/Util/ApplicationUtil.cs similarity index 97% rename from EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs rename to EOM.TSHotelManagement.Shared/Util/ApplicationUtil.cs index 363af44..8d9a060 100644 --- a/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs +++ b/EOM.TSHotelManagement.Shared/Util/ApplicationUtil.cs @@ -1,11 +1,11 @@ -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Contract; using jvncorelib.EntityLib; using System.Diagnostics; using System.Reflection; using System.Runtime.InteropServices; -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { /// /// 静态工具 diff --git a/EOM.TSHotelManagement.Common/Util/ClipboardHelper.cs b/EOM.TSHotelManagement.Shared/Util/ClipboardHelper.cs similarity index 98% rename from EOM.TSHotelManagement.Common/Util/ClipboardHelper.cs rename to EOM.TSHotelManagement.Shared/Util/ClipboardHelper.cs index 47be9ce..b01ce0c 100644 --- a/EOM.TSHotelManagement.Common/Util/ClipboardHelper.cs +++ b/EOM.TSHotelManagement.Shared/Util/ClipboardHelper.cs @@ -1,7 +1,7 @@ using System.Runtime.InteropServices; using System.Text; -namespace EOM.TSHotelManagement.Common; +namespace EOM.TSHotelManagement.Shared; public class ClipboardHelper { [DllImport("user32.dll", SetLastError = true)] diff --git a/EOM.TSHotelManagement.Common/Util/RecordHelper.cs b/EOM.TSHotelManagement.Shared/Util/RecordHelper.cs similarity index 89% rename from EOM.TSHotelManagement.Common/Util/RecordHelper.cs rename to EOM.TSHotelManagement.Shared/Util/RecordHelper.cs index a8f5bb7..11a9a07 100644 --- a/EOM.TSHotelManagement.Common/Util/RecordHelper.cs +++ b/EOM.TSHotelManagement.Shared/Util/RecordHelper.cs @@ -1,9 +1,9 @@ -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Shared; +using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Contract; using jvncorelib.CodeLib; using jvncorelib.EntityLib; -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { /// /// 日志记录助手 diff --git a/nuget.config b/nuget.config index 9a79d04..c714158 100644 --- a/nuget.config +++ b/nuget.config @@ -8,7 +8,7 @@ - + -- Gitee From 74940f4e69f0f2bffb524739ba9ca94670d7ebd9 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 10 Jan 2026 17:46:37 +0800 Subject: [PATCH 9/9] upgrade to net10. fix bugs. --- .../ClientCustomControls/ucRoom.cs | 14 +- .../ClientEntrance/FrmLoading.cs | 52 +- .../ClientEntrance/FrmLogin.cs | 2 +- .../ClientMain/FrmMain.cs | 6 +- .../FrmAccountSecurity.Designer.cs | 2 +- .../ClientModule/FrmAvator.Designer.cs | 2 +- .../ClientModule/FrmChangeRoom.cs | 2 +- .../ClientModule/FrmCheckIn.cs | 2 +- .../FrmCheckOutDetail.Designer.cs | 2 +- .../ClientModule/FrmCheckOutDetail.cs | 2 +- .../FrmCustomerManagement.Designer.cs | 2 +- .../ClientModule/FrmCustomerManagement.cs | 10 +- .../ClientModule/FrmPersonnelInfo.Designer.cs | 81 ++- .../ClientModule/FrmPersonnelInfo.cs | 57 +- .../ClientModule/FrmProgress.Designer.cs | 2 +- .../ClientModule/FrmReserList.cs | 2 +- .../ClientModule/FrmReserManagement.cs | 2 +- .../FrmRoomManagement.Designer.cs | 1 + .../ClientModule/FrmRoomManagement.cs | 55 +- .../ClientModule/FrmRoomStateManagement.cs | 2 +- .../ClientModule/FrmSellThing.Designer.cs | 25 +- .../ClientModule/FrmSellThing.cs | 99 ++-- .../EOM.TSHotelManagement.FormUI.csproj | 12 +- .../Properties/Resources.Designer.cs | 2 +- .../Properties/launchSettings.json | 8 + .../EOM.TSHotelManagement.Contract.xml | 515 ++++++++++++++++++ .../EOM.TSHotelManagement.Contract.xml | 515 ++++++++++++++++++ .../TableComponent/TableComHelper.cs | 43 +- .../BackendApi/ApiConstants.cs | 1 - .../EOM.TSHotelManagement.Shared.csproj | 2 +- .../Helper/CsrfTokenHelper.cs | 12 +- .../Helper/HttpHelper.cs | 62 ++- 32 files changed, 1388 insertions(+), 208 deletions(-) create mode 100644 EOM.TSHotelManagement.FormUI/Properties/launchSettings.json create mode 100644 EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Contract.xml create mode 100644 EOM.TSHotelManagement.FormUI/TableComponent/ContractXml/EOM.TSHotelManagement.Contract.xml diff --git a/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs index d3f8577..716b45c 100644 --- a/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs +++ b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs @@ -133,15 +133,15 @@ namespace EOM.TSHotelManagement.FormUI private const int GWL_EXSTYLE = (-20); [DllImport("user32", EntryPoint = "SetWindowLong")] private static extern uint SetWindowLong( - IntPtr hwnd, - int nIndex, - uint dwNewLong - ); + IntPtr hwnd, + int nIndex, + uint dwNewLong + ); [DllImport("user32", EntryPoint = "GetWindowLong")] private static extern uint GetWindowLong( - IntPtr hwnd, - int nIndex - ); + IntPtr hwnd, + int nIndex + ); /// /// 使窗口有鼠标穿透功能 /// diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs index c5e0d7a..e54fd4f 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs @@ -99,37 +99,45 @@ namespace EOM.TSHotelManagement.FormUI rtbReleaseLog.Text = $"{releaseBody}"; lbInternetSoftwareVersion.Text = version; lbInternetSoftwareVersion.Refresh(); - if (version.Equals(lblLocalSoftwareVersion.Text.Trim())) - { - progressBar.Value = 100; - LoginInfo.SoftwareReleaseLog = $"{releaseBody}"; - NotificationService.ShowSuccess(LocalizationHelper.GetLocalizedString("The current version is already the latest, no need to update!", "当前已是最新版本,无需更新!")); - lblTips.Text = LocalizationHelper.GetLocalizedString("The current version is already the latest, no need to update!", "当前已是最新版本,无需更新!"); - return; - } - string downloadUrl = string.Empty; - if (isGitee) + // 将版本字符串转换为 Version 对象进行比较 + var localVersion = new Version(lblLocalSoftwareVersion.Text.Trim()); + var serverVersion = new Version(version); + + // 只有当服务器版本大于本地版本时才需要更新 + if (serverVersion > localVersion) { - dynamic executableAsset = assets.SingleOrDefault(a => ((dynamic)a).FileName?.EndsWith(".exe") == true); + string downloadUrl = string.Empty; + if (isGitee) + { + dynamic executableAsset = assets.SingleOrDefault(a => ((dynamic)a).FileName?.EndsWith(".exe") == true); - if (executableAsset == null) return; + if (executableAsset == null) return; - downloadUrl = executableAsset.DownloadUrl; - } - else - { - dynamic executableAsset = assets.SingleOrDefault(a => ((dynamic)a).Name?.EndsWith(".exe") == true); + downloadUrl = executableAsset.DownloadUrl; + } + else + { + dynamic executableAsset = assets.SingleOrDefault(a => ((dynamic)a).Name?.EndsWith(".exe") == true); - if (executableAsset == null) return; + if (executableAsset == null) return; - downloadUrl = $"{GithubProxyUrl}/{executableAsset.BrowserDownloadUrl}"; - } + downloadUrl = $"{GithubProxyUrl}/{executableAsset.BrowserDownloadUrl}"; + } - DownloadAndInstallUpdate(downloadUrl, "TS酒店管理系统.exe", new Progress(ReportProgress), version); - lblTips.Text = "安装包正在下载中,请稍等..."; + DownloadAndInstallUpdate(downloadUrl, "TS酒店管理系统.exe", new Progress(ReportProgress), version); + lblTips.Text = "安装包正在下载中,请稍等..."; + } + else + { + progressBar.Value = 100; + LoginInfo.SoftwareReleaseLog = $"{releaseBody}"; + NotificationService.ShowSuccess(LocalizationHelper.GetLocalizedString("The current version is already the latest, no need to update!", "当前已是最新版本,无需更新!")); + lblTips.Text = LocalizationHelper.GetLocalizedString("The current version is already the latest, no need to update!", "当前已是最新版本,无需更新!"); + return; + } } private async Task GetDefaultUserAgentAsync() diff --git a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs index 9089c67..49f8384 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLogin.cs @@ -128,7 +128,7 @@ namespace EOM.TSHotelManagement.FormUI { if (CheckInput()) { - var worker = new ReadEmployeeInputDto() { EmployeeId = txtAccount.Text.Trim(), EmailAddress = txtAccount.Text.Trim(), Password = txtWorkerPwd.Text.Trim() }; + var worker = new ReadEmployeeInputDto() { EmployeeId = txtAccount.Text.Trim(), EmailAddress = txtAccount.Text.Trim(), Password = new EncryptLib().Encryption(txtWorkerPwd.Text.Trim(), EncryptionLevel.Enhanced) }; result = HttpHelper.Request(ApiConstants.Employee_SelectEmployeeInfoByEmployeeIdAndEmployeePwd, worker.ModelToJson()); diff --git a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs index cda3091..b4ebc20 100644 --- a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs +++ b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs @@ -236,8 +236,8 @@ namespace EOM.TSHotelManagement.FormUI #endregion } - AntdUI.IContextMenuStripItem[] menulist = new AntdUI.IContextMenuStripItem[] - { + AntdUI.IContextMenuStripItem[] menulist = + [ new AntdUI.ContextMenuStripItem(UIControlConstant.ChangeAccount).SetIcon(UIControlIconConstant.ChangeAccount), new AntdUI.ContextMenuStripItem(UIControlConstant.PersonnalCenter).SetIcon(UIControlIconConstant.PersonnalCenter).SetSub( new AntdUI.ContextMenuStripItem(UIControlConstant.PersonnalInformation).SetIcon(UIControlIconConstant.PersonnalInformation), @@ -251,7 +251,7 @@ namespace EOM.TSHotelManagement.FormUI ), new AntdUI.ContextMenuStripItem(UIControlConstant.About).SetIcon(UIControlIconConstant.About), new AntdUI.ContextMenuStripItem(UIControlConstant.ExitSystem).SetIcon(UIControlIconConstant.Exit) - }; + ]; #region 窗体加载事件方法 private void FrmMain_Load(object sender, EventArgs e) diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs index a96a4a0..ad25bf3 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs @@ -145,7 +145,7 @@ Name = "FrmAccountSecurity"; Resizable = false; StartPosition = FormStartPosition.CenterScreen; - Text = "FrmAccountSecurity"; + Text = "账号安全"; Load += FrmAccountSecurity_Load; ResumeLayout(false); } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs index 2be7ef1..75a037a 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs @@ -85,7 +85,7 @@ Name = "FrmAvator"; Resizable = false; StartPosition = FormStartPosition.CenterScreen; - Text = "FrmAvator"; + Text = "账号头像"; Load += FrmAvator_Load; ((System.ComponentModel.ISupportInitialize)picWorkerPic).EndInit(); ResumeLayout(false); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs index 3130b55..25a9677 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs @@ -82,7 +82,7 @@ namespace EOM.TSHotelManagement.FormUI #endregion - FrmRoomManager.Reload(""); + FrmRoomManager.Reload(0); FrmRoomManager._RefreshRoomCount(); #region 获取添加操作日志所需的信息 RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + transferRoom.DataChgDate + "位于" + LoginInfo.SoftwareVersion + "执行:" + transferRoom.CustomerNumber + "于" + transferRoom.DataChgDate + "进行了换房!", LogLevel.Warning); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs index ed9ee40..ce1e883 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs @@ -189,7 +189,7 @@ namespace EOM.TSHotelManagement.FormUI } NotificationService.ShowSuccess("登记入住成功!"); txtCustomerNo.Text = ""; - FrmRoomManager.Reload(""); + FrmRoomManager.Reload(0); FrmRoomManager._RefreshRoomCount(); #region 获取添加操作日志所需的信息 RecordHelper.Record(LoginInfo.WorkerClub + "-" + LoginInfo.WorkerPosition + "-" + LoginInfo.WorkerName + "于" + Convert.ToDateTime(DateTime.Now) + "帮助" + r.CustomerNumber + "进行了入住操作!", LogLevel.Normal); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs index 8079c50..405e990 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.Designer.cs @@ -351,7 +351,7 @@ Name = "FrmCheckOutDetail"; Resizable = false; StartPosition = FormStartPosition.CenterScreen; - Text = "FrmCheckOutDetail"; + Text = "结算退房"; Load += FrmCheckOutDetail_Load; ResumeLayout(false); PerformLayout(); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs index 48b380b..525368f 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckOutDetail.cs @@ -198,7 +198,7 @@ namespace EOM.TSHotelManagement.FormUI return; } NotificationService.ShowSuccess("结算成功!"); - FrmRoomManager.Reload(""); + FrmRoomManager.Reload(0); FrmRoomManager._RefreshRoomCount(); #region 获取添加操作日志所需的信息 diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs index 9084fcc..c0fd442 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs @@ -207,7 +207,7 @@ FormBorderStyle = FormBorderStyle.FixedSingle; Margin = new Padding(4); Name = "FrmCustomerManagement"; - Text = "TS酒店管理系统"; + Text = "客户管理"; Load += FrmCustomerManagement_Load; cmsCustomerAction.ResumeLayout(false); ResumeLayout(false); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs index 99a7aef..4b5b300 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs @@ -102,6 +102,14 @@ namespace EOM.TSHotelManagement.FormUI { nameof(ReadCustomerInputDto.PageSize), pageSize.ToString() }, { nameof(ReadCustomerInputDto.IsDelete), "0" } }; + if (!txtCustoName.Text.Trim().IsNullOrEmpty()) + { + dic.Add(nameof(ReadCustomerInputDto.CustomerName), txtCustoName.Text.Trim()); + } + if (!txtCustoNo.Text.Trim().IsNullOrEmpty()) + { + dic.Add(nameof(ReadCustomerInputDto.CustomerNumber), txtCustoNo.Text.Trim()); + } result = HttpHelper.Request(ApiConstants.Customer_SelectCustomers, dic); var customers = HttpHelper.JsonToModel>(result.message); if (customers.Success == false) @@ -153,7 +161,7 @@ namespace EOM.TSHotelManagement.FormUI custos = response.Data.Items; var totalCount = response.Data.TotalCount; var listTableData = new List(); - + btnPg.Total = totalCount; custos = custos.OrderBy(a => a.CustomerNumber).ThenBy(a => a.CustomerName).ToList(); TableComHelper tableComHelper = new TableComHelper(); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.Designer.cs index baf2445..43a5385 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.Designer.cs @@ -47,15 +47,17 @@ cboEmployeePosition = new AntdUI.Select(); cboEmployeeDepartment = new AntdUI.Select(); ucWindowHeader1 = new ucWindowHeader(); + txtEmailAddress = new AntdUI.Input(); + label3 = new Label(); SuspendLayout(); // // label7 // label7.AutoSize = true; label7.Font = new Font("Noto Sans SC", 14.2499981F); - label7.Location = new Point(18, 214); + label7.Location = new Point(18, 206); label7.Name = "label7"; - label7.Size = new Size(85, 19); + label7.Size = new Size(88, 27); label7.TabIndex = 148; label7.Text = "联系方式"; // @@ -63,9 +65,9 @@ // label5.AutoSize = true; label5.Font = new Font("Noto Sans SC", 14.2499981F); - label5.Location = new Point(329, 112); + label5.Location = new Point(329, 111); label5.Name = "label5"; - label5.Size = new Size(85, 19); + label5.Size = new Size(88, 27); label5.TabIndex = 136; label5.Text = "现任职位"; // @@ -73,9 +75,9 @@ // label32.AutoSize = true; label32.Font = new Font("Noto Sans SC", 14.2499981F); - label32.Location = new Point(18, 61); + label32.Location = new Point(18, 59); label32.Name = "label32"; - label32.Size = new Size(85, 19); + label32.Size = new Size(88, 27); label32.TabIndex = 132; label32.Text = "员工编号"; // @@ -83,9 +85,9 @@ // label31.AutoSize = true; label31.Font = new Font("Noto Sans SC", 14.2499981F); - label31.Location = new Point(18, 112); + label31.Location = new Point(18, 108); label31.Name = "label31"; - label31.Size = new Size(85, 19); + label31.Size = new Size(88, 27); label31.TabIndex = 133; label31.Text = "员工姓名"; // @@ -93,9 +95,9 @@ // label30.AutoSize = true; label30.Font = new Font("Noto Sans SC", 14.2499981F); - label30.Location = new Point(18, 162); + label30.Location = new Point(18, 157); label30.Name = "label30"; - label30.Size = new Size(77, 19); + label30.Size = new Size(74, 27); label30.TabIndex = 134; label30.Text = "性 别"; // @@ -103,19 +105,19 @@ // label1.AutoSize = true; label1.Font = new Font("Noto Sans SC", 14.2499981F); - label1.Location = new Point(329, 162); + label1.Location = new Point(334, 157); label1.Name = "label1"; - label1.Size = new Size(77, 19); + label1.Size = new Size(78, 27); label1.TabIndex = 145; - label1.Text = "民 族"; + label1.Text = "民 族"; // // label2 // label2.AutoSize = true; label2.Font = new Font("Noto Sans SC", 14.2499981F); - label2.Location = new Point(18, 264); + label2.Location = new Point(18, 304); label2.Name = "label2"; - label2.Size = new Size(85, 19); + label2.Size = new Size(88, 27); label2.TabIndex = 137; label2.Text = "居住地址"; // @@ -125,7 +127,7 @@ label16.Font = new Font("Noto Sans SC", 14.2499981F); label16.Location = new Point(329, 61); label16.Name = "label16"; - label16.Size = new Size(85, 19); + label16.Size = new Size(88, 27); label16.TabIndex = 135; label16.Text = "所在部门"; // @@ -142,7 +144,7 @@ // txtEmployeeName // txtEmployeeName.Font = new Font("Noto Sans SC", 12F); - txtEmployeeName.Location = new Point(103, 102); + txtEmployeeName.Location = new Point(103, 100); txtEmployeeName.Name = "txtEmployeeName"; txtEmployeeName.Round = true; txtEmployeeName.Size = new Size(205, 45); @@ -151,7 +153,7 @@ // txtEmployeeAddress // txtEmployeeAddress.Font = new Font("Noto Sans SC", 12F); - txtEmployeeAddress.Location = new Point(103, 251); + txtEmployeeAddress.Location = new Point(103, 296); txtEmployeeAddress.Name = "txtEmployeeAddress"; txtEmployeeAddress.Round = true; txtEmployeeAddress.Size = new Size(515, 45); @@ -160,7 +162,7 @@ // txtEmployeeTel // txtEmployeeTel.Font = new Font("Noto Sans SC", 12F); - txtEmployeeTel.Location = new Point(104, 202); + txtEmployeeTel.Location = new Point(104, 198); txtEmployeeTel.Name = "txtEmployeeTel"; txtEmployeeTel.Round = true; txtEmployeeTel.Size = new Size(515, 45); @@ -169,7 +171,7 @@ // btnUpdate // btnUpdate.Font = new Font("Noto Sans SC", 12F); - btnUpdate.Location = new Point(530, 302); + btnUpdate.Location = new Point(531, 361); btnUpdate.Name = "btnUpdate"; btnUpdate.Shape = AntdUI.TShape.Round; btnUpdate.Size = new Size(87, 43); @@ -183,7 +185,7 @@ cboGender.Font = new Font("Noto Sans SC", 12F); cboGender.List = true; cboGender.ListAutoWidth = true; - cboGender.Location = new Point(103, 152); + cboGender.Location = new Point(103, 149); cboGender.Name = "cboGender"; cboGender.Placement = AntdUI.TAlignFrom.Bottom; cboGender.Round = true; @@ -195,11 +197,11 @@ cboEmployeeNation.Font = new Font("Noto Sans SC", 12F); cboEmployeeNation.List = true; cboEmployeeNation.ListAutoWidth = true; - cboEmployeeNation.Location = new Point(413, 152); + cboEmployeeNation.Location = new Point(414, 147); cboEmployeeNation.Name = "cboEmployeeNation"; cboEmployeeNation.Placement = AntdUI.TAlignFrom.Bottom; cboEmployeeNation.Round = true; - cboEmployeeNation.Size = new Size(204, 45); + cboEmployeeNation.Size = new Size(205, 45); cboEmployeeNation.TabIndex = 176; // // cboEmployeePosition @@ -207,7 +209,7 @@ cboEmployeePosition.Font = new Font("Noto Sans SC", 12F); cboEmployeePosition.List = true; cboEmployeePosition.ListAutoWidth = true; - cboEmployeePosition.Location = new Point(413, 102); + cboEmployeePosition.Location = new Point(414, 100); cboEmployeePosition.Name = "cboEmployeePosition"; cboEmployeePosition.Placement = AntdUI.TAlignFrom.Bottom; cboEmployeePosition.Round = true; @@ -219,7 +221,7 @@ cboEmployeeDepartment.Font = new Font("Noto Sans SC", 12F); cboEmployeeDepartment.List = true; cboEmployeeDepartment.ListAutoWidth = true; - cboEmployeeDepartment.Location = new Point(413, 51); + cboEmployeeDepartment.Location = new Point(414, 51); cboEmployeeDepartment.Name = "cboEmployeeDepartment"; cboEmployeeDepartment.Placement = AntdUI.TAlignFrom.Bottom; cboEmployeeDepartment.Round = true; @@ -228,17 +230,38 @@ // // ucWindowHeader1 // - ucWindowHeader1.Location = new Point(-1, -1); + ucWindowHeader1.Location = new Point(-1, -3); ucWindowHeader1.Name = "ucWindowHeader1"; ucWindowHeader1.Size = new Size(639, 35); ucWindowHeader1.TabIndex = 179; // + // txtEmailAddress + // + txtEmailAddress.Font = new Font("Noto Sans SC", 12F); + txtEmailAddress.Location = new Point(104, 247); + txtEmailAddress.Name = "txtEmailAddress"; + txtEmailAddress.Round = true; + txtEmailAddress.Size = new Size(515, 45); + txtEmailAddress.TabIndex = 181; + // + // label3 + // + label3.AutoSize = true; + label3.Font = new Font("Noto Sans SC", 14.2499981F); + label3.Location = new Point(18, 255); + label3.Name = "label3"; + label3.Size = new Size(88, 27); + label3.TabIndex = 180; + label3.Text = "电子邮箱"; + // // FrmPersonnelInfo // AutoScaleDimensions = new SizeF(7F, 17F); AutoScaleMode = AutoScaleMode.Font; BackColor = Color.FromArgb(235, 243, 255); - ClientSize = new Size(637, 359); + ClientSize = new Size(637, 416); + Controls.Add(txtEmailAddress); + Controls.Add(label3); Controls.Add(ucWindowHeader1); Controls.Add(cboEmployeeDepartment); Controls.Add(cboEmployeePosition); @@ -262,7 +285,7 @@ Name = "FrmPersonnelInfo"; Resizable = false; StartPosition = FormStartPosition.CenterScreen; - Text = "FrmPersonnelInfo"; + Text = "我的信息"; Load += FrmPersonnelInfo_Load; ResumeLayout(false); PerformLayout(); @@ -288,5 +311,7 @@ private AntdUI.Select cboEmployeePosition; private AntdUI.Select cboEmployeeDepartment; private ucWindowHeader ucWindowHeader1; + private AntdUI.Input txtEmailAddress; + private Label label3; } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs index 9c4c703..78f90d1 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs @@ -10,13 +10,14 @@ namespace EOM.TSHotelManagement.FormUI public partial class FrmPersonnelInfo : Window { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmPersonnelInfo)); + private readonly LoadingProgress _loadingProgress; public FrmPersonnelInfo() { InitializeComponent(); - + _loadingProgress = new LoadingProgress(); ucWindowHeader1.ApplySettingsWithoutMinimize("我的信息", string.Empty, (Image)resources.GetObject("FrmPersonnelInfo.Icon")!); } - + ReadEmployeeOutputDto currentEmployee; private void FrmPersonnelInfo_Load(object sender, EventArgs e) { @@ -83,20 +84,21 @@ namespace EOM.TSHotelManagement.FormUI NotificationService.ShowError($"{ApiConstants.Employee_SelectEmployeeInfoByEmployeeId}+接口服务异常,请提交Issue或尝试更新版本!"); return; } - ReadEmployeeOutputDto worker = employees.Data; - if (!worker.IsNullOrEmpty()) - { - txtEmployeeId.Text = worker.EmployeeId; - txtEmployeeName.Text = worker.EmployeeName; - cboGender.SelectedValue = worker.Gender; - cboEmployeePosition.Text = worker.PositionName; - cboEmployeePosition.SelectedValue = worker.Position; - cboEmployeeDepartment.Text = worker.DepartmentName; - cboEmployeeDepartment.SelectedValue = worker.Department; - cboEmployeeNation.Text = worker.EthnicityName; - cboEmployeeNation.SelectedValue = worker.Ethnicity; - txtEmployeeAddress.Text = worker.Address; - txtEmployeeTel.Text = worker.PhoneNumber; + currentEmployee = employees.Data; + if (!currentEmployee.IsNullOrEmpty()) + { + txtEmployeeId.Text = currentEmployee.EmployeeId; + txtEmployeeName.Text = currentEmployee.EmployeeName; + cboGender.SelectedValue = currentEmployee.Gender; + cboEmployeePosition.Text = currentEmployee.PositionName; + cboEmployeePosition.SelectedValue = currentEmployee.Position; + cboEmployeeDepartment.Text = currentEmployee.DepartmentName; + cboEmployeeDepartment.SelectedValue = currentEmployee.Department; + cboEmployeeNation.Text = currentEmployee.EthnicityName; + cboEmployeeNation.SelectedValue = currentEmployee.Ethnicity; + txtEmployeeAddress.Text = currentEmployee.Address; + txtEmailAddress.Text = currentEmployee.EmailAddress; + txtEmployeeTel.Text = currentEmployee.PhoneNumber; } Refresh(); } @@ -133,27 +135,44 @@ namespace EOM.TSHotelManagement.FormUI ResponseMsg result = new ResponseMsg(); private void btnUpdate_Click(object sender, EventArgs e) { - UpdateEmployeeInputDto worker = new UpdateEmployeeInputDto() + _loadingProgress.Show(); + UpdateEmployeeInputDto employee = new UpdateEmployeeInputDto() { + Id = currentEmployee.Id, EmployeeId = txtEmployeeId.Text.Trim(), EmployeeName = txtEmployeeName.Text.Trim(), Gender = cboGender.Text == "男" ? 1 : 0, Ethnicity = cboEmployeeNation.SelectedValue.ToString(), PhoneNumber = txtEmployeeTel.Text.Trim(), Address = txtEmployeeAddress.Text.Trim(), + EmailAddress = txtEmailAddress.Text.Trim(), + PoliticalAffiliation = currentEmployee.PoliticalAffiliation, + Position = currentEmployee.Position, + Department = currentEmployee.Department, + HireDate = DateOnly.FromDateTime(currentEmployee.HireDate), + IdCardNumber = currentEmployee.IdCardNumber, + EducationLevel = currentEmployee.EducationLevel, + DateOfBirth = DateOnly.FromDateTime(currentEmployee.DateOfBirth), + IsEnable = currentEmployee.IsEnable, + IsDelete = currentEmployee.IsDelete, + IdCardType = currentEmployee.IdCardType, + Password = currentEmployee.Password, + OldPassword = currentEmployee.Password, + IsInitialize = currentEmployee.IsInitialize, DataChgUsr = LoginInfo.WorkerNo, DataChgDate = DateTime.Now }; - if (CheckInput(worker)) + if (CheckInput(employee)) { - result = HttpHelper.Request(ApiConstants.Employee_UpdateEmployee, worker.ModelToJson()); + result = HttpHelper.Request(ApiConstants.Employee_UpdateEmployee, employee.ModelToJson()); var response = HttpHelper.JsonToModel(result.message); if (response.Success == false) { NotificationService.ShowError($"{ApiConstants.Employee_UpdateEmployee}+接口服务异常,请提交Issue或尝试更新版本!"); return; } + _loadingProgress.Close(); NotificationService.ShowSuccess("修改成功!"); #region 获取添加操作日志所需的信息 RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "修改个人信息操作!", LogLevel.Warning); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmProgress.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmProgress.Designer.cs index 319a074..1a0fa6e 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmProgress.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmProgress.Designer.cs @@ -60,7 +60,7 @@ ShowInTaskbar = false; SizeGripStyle = SizeGripStyle.Show; StartPosition = FormStartPosition.CenterScreen; - Text = "Loading..."; + Text = "加载中......"; TopMost = true; Load += FrmProgress_Load; ResumeLayout(false); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs index f282aae..e18be64 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs @@ -195,7 +195,7 @@ namespace EOM.TSHotelManagement.FormUI NotificationService.ShowSuccess("操作成功"); LoadReserData(); - FrmRoomManager.Reload(""); + FrmRoomManager.Reload(0); FrmRoomManager._RefreshRoomCount(); this.Close(); } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs index 64fba56..67e4fb5 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.cs @@ -92,7 +92,7 @@ namespace EOM.TSHotelManagement.FormUI RecordHelper.Record(LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + Convert.ToDateTime(DateTime.Now) + "帮助" + txtCustoTel.Text + "进行了预订房间操作!", LogLevel.Normal); #endregion scope.Complete(); - FrmRoomManager.Reload(""); + FrmRoomManager.Reload(0); FrmRoomManager._RefreshRoomCount(); this.Close(); } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs index 2125f85..22f944e 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.Designer.cs @@ -215,6 +215,7 @@ Margin = new Padding(4); Name = "FrmRoomManager"; StartPosition = FormStartPosition.CenterScreen; + Text = "客房管理"; TransparencyKey = Color.White; Load += FrmRoomManager_Load; pnlRoomInfo.ResumeLayout(false); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs index 13d01b8..22dad05 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs @@ -35,7 +35,7 @@ namespace EOM.TSHotelManagement.FormUI { - public delegate void ReLoadRoomList(string typeName); + public delegate void ReLoadRoomList(int typeId); public delegate void ReadRoomInfo(); @@ -254,10 +254,10 @@ namespace EOM.TSHotelManagement.FormUI flpRoomTypes.Controls.Clear(); - AddRoomTypeButton("全部房间", "btnAll", btnAll_Click); + AddRoomTypeButton("全部房间", "btnAll", btnAll_Click, 0); foreach (var type in listRoomTypes) { - AddRoomTypeButton(type.RoomTypeName, Convert.ToString(type.RoomTypeName), btnRoomType_Click); + AddRoomTypeButton(type.RoomTypeName, Convert.ToString(type.RoomTypeName), btnRoomType_Click, type.RoomTypeId); } } catch (Exception ex) @@ -266,11 +266,12 @@ namespace EOM.TSHotelManagement.FormUI } } - private void AddRoomTypeButton(string text, string name, EventHandler clickEvent) + private void AddRoomTypeButton(string text, string name, EventHandler clickEvent, int id) { var ucRoomType = new ucRoomType(); ucRoomType.btnRoomType.Text = text; ucRoomType.btnRoomType.Name = name; + ucRoomType.btnRoomType.Tag = id; ucRoomType.btnRoomType.Click += clickEvent; flpRoomTypes.Controls.Add(ucRoomType); } @@ -279,8 +280,8 @@ namespace EOM.TSHotelManagement.FormUI { if (sender is AntdUI.Button button) { - string buttonName = button.Text; - LoadData(buttonName); + var typeId = button.Tag != null ? (int)button.Tag : 0; + LoadData(typeId); } } @@ -299,42 +300,32 @@ namespace EOM.TSHotelManagement.FormUI lblRoomState.Text = ucRoom.co_RoomState; } - private void LoadData(string typeName = "") + private void LoadData(int typeId = 0) { flpRoom.Controls.Clear(); - if (string.IsNullOrEmpty(typeName)) + dic = new Dictionary { - dic = new Dictionary - { - { nameof(ReadRoomInputDto.IsDelete), "0" }, - { nameof(ReadRoomInputDto.IgnorePaging), "true" } - }; - result = HttpHelper.Request(ApiConstants.Room_SelectRoomAll, dic); - var response = HttpHelper.JsonToModel>(result.message); - if (response.Success == false) - { - NotificationService.ShowError($"{ApiConstants.Room_SelectRoomAll}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - romsty = response.Data.Items; - } - else + { nameof(ReadRoomInputDto.IsDelete), "0" }, + { nameof(ReadRoomInputDto.IgnorePaging), "true" } + }; + if (typeId > 0) { dic = new Dictionary { { nameof(ReadRoomInputDto.IsDelete), "0" }, { nameof(ReadRoomInputDto.IgnorePaging), "true" }, - { nameof(ReadRoomInputDto.RoomTypeName), typeName } + { nameof(ReadRoomInputDto.RoomTypeId), typeId.ToString() } }; - result = HttpHelper.Request(ApiConstants.Room_SelectRoomByTypeName, dic); - var response = HttpHelper.JsonToModel>(result.message); - if (response.Success == false) - { - NotificationService.ShowError($"{ApiConstants.Room_SelectRoomByTypeName}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - romsty = response.Data.Items; } + result = HttpHelper.Request(ApiConstants.Room_SelectRoomAll, dic); + var response = HttpHelper.JsonToModel>(result.message); + if (response.Success == false) + { + NotificationService.ShowError($"{ApiConstants.Room_SelectRoomAll}+接口服务异常,请提交Issue或尝试更新版本!"); + return; + } + romsty = response.Data.Items; + for (int i = 0; i < romsty.Count; i++) { room = new ucRoom(this); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs index a21ed82..ae14e89 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs @@ -81,7 +81,7 @@ namespace EOM.TSHotelManagement.FormUI return; } NotificationService.ShowSuccess("房间" + txtRoomNo.Text + "成功修改为" + cboRoomState.Text); - FrmRoomManager.Reload(""); + FrmRoomManager.Reload(0); FrmRoomManager._RefreshRoomCount(); this.Close(); break; diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs index c6a3b73..cf0fbe6 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs @@ -49,8 +49,8 @@ dgvRoomSell = new AntdUI.Table(); label1 = new AntdUI.Label(); label2 = new AntdUI.Label(); - lblState = new AntdUI.Label(); btnClear = new AntdUI.Button(); + tgState = new AntdUI.Tag(); groupBox2.SuspendLayout(); SuspendLayout(); // @@ -276,16 +276,6 @@ label2.Text = "消费房号:"; label2.TextAlign = ContentAlignment.MiddleRight; // - // lblState - // - lblState.Location = new Point(886, 22); - lblState.Name = "lblState"; - lblState.Size = new Size(107, 23); - lblState.TabIndex = 141; - lblState.Tag = ""; - lblState.Text = ""; - lblState.TextAlign = ContentAlignment.MiddleCenter; - // // btnClear // btnClear.Location = new Point(462, 12); @@ -295,13 +285,22 @@ btnClear.TabIndex = 155; btnClear.Click += btnClear_Click; // + // tgState + // + tgState.Location = new Point(875, 23); + tgState.Name = "tgState"; + tgState.Size = new Size(158, 23); + tgState.TabIndex = 156; + tgState.Text = "tag1"; + tgState.Visible = false; + // // FrmSellThing // AutoScaleMode = AutoScaleMode.None; BackColor = Color.FromArgb(235, 243, 255); ClientSize = new Size(1072, 486); + Controls.Add(tgState); Controls.Add(btnClear); - Controls.Add(lblState); Controls.Add(label2); Controls.Add(label1); Controls.Add(dgvRoomSell); @@ -372,7 +371,7 @@ private AntdUI.Label label4; private AntdUI.Label label3; private AntdUI.Label label7; - private AntdUI.Label lblState; private AntdUI.Button btnClear; + private AntdUI.Tag tgState; } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs index 1bb2cb5..bc47593 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs @@ -69,9 +69,12 @@ namespace EOM.TSHotelManagement.FormUI { dic = new Dictionary() { - { nameof(ReadSellThingInputDto.ProductName) , sellthing.Trim() }, { nameof(ReadSellThingInputDto.IsDelete) , "0" } }; + if (!sellthing.IsNullOrEmpty()) + { + dic.Add(nameof(ReadSellThingInputDto.ProductName), sellthing.Trim()); + } result = HttpHelper.Request(ApiConstants.Sellthing_SelectSellThingAll, dic); var response = HttpHelper.JsonToModel>(result.message); if (response.Success == false) @@ -87,6 +90,8 @@ namespace EOM.TSHotelManagement.FormUI TableComHelper tableComHelper = new TableComHelper(); listTableData = tableComHelper.ConvertToAntdItems(lstData); + btnPg.Total = response.Data.TotalCount; + dgvSellthing.Spin("正在加载中...", config => { this.dgvSellthing.Columns = tableComHelper.ConvertToAntdColumns(tableComHelper.GenerateDataColumns()); @@ -152,6 +157,10 @@ namespace EOM.TSHotelManagement.FormUI { nameof(ReadSellThingInputDto.PageSize), pageSize.ToString() }, { nameof(ReadSellThingInputDto.IsDelete), "0"} }; + if (!txtFind.Text.Trim().IsNullOrEmpty()) + { + dic.Add(nameof(ReadSellThingInputDto), txtFind.Text.Trim()); + } result = HttpHelper.Request(ApiConstants.Sellthing_SelectSellThingAll, dic); var response = HttpHelper.JsonToModel>(result.message); if (response.Success == false) @@ -161,6 +170,7 @@ namespace EOM.TSHotelManagement.FormUI } List lstData = response.Data.Items; totalCount = lstData.Count; + btnPg.Total = totalCount; var listTableData = new List(); TableComHelper tableComHelper = new TableComHelper(); @@ -215,7 +225,12 @@ namespace EOM.TSHotelManagement.FormUI /// private void btnAdd_Click(object sender, EventArgs e) { - if (lblState.Visible == false) + if(tgState.Type != TTypeMini.Success) + { + NotificationService.ShowWarning("该房间不可消费!"); + return; + } + if (txtRoomNo.Text.Trim().IsNullOrEmpty()) { NotificationService.ShowWarning("请先输入消费的房间!"); return; @@ -225,40 +240,39 @@ namespace EOM.TSHotelManagement.FormUI NotificationService.ShowWarning("请输入消费数量!"); return; } - if (lblState.Text == "该房间可消费") - { - if (!CheckInput()) return; - try - { - var customerSpend = new AddCustomerSpendInputDto - { - RoomNumber = txtRoomNo.Text.Trim(), - ProductNumber = txtSellNo.Text.Trim(), - ProductName = txtSellName.Text.Trim(), - Quantity = (int)nudNum.Value, - Price = Convert.ToDecimal(txtPrice.Text), - WorkerNo = LoginInfo.WorkerNo, - SoftwareVersion = LoginInfo.SoftwareVersion - }; - var result = HttpHelper.Request(ApiConstants.Spend_AddCustomerSpend, customerSpend.ModelToJson()); - var response = HttpHelper.JsonToModel(result.message!); - if (response.Success == false) - { - NotificationService.ShowError(response.Message ?? "添加消费记录失败"); - return; - } - NotificationService.ShowSuccess("添加成功"); + if (!CheckInput()) return; - LoadSpendInfoByRoomNo(r); - LoadSellThingInfo(); - } - catch (Exception ex) + try + { + var customerSpend = new AddCustomerSpendInputDto + { + RoomNumber = txtRoomNo.Text.Trim(), + ProductNumber = txtSellNo.Text.Trim(), + ProductName = txtSellName.Text.Trim(), + Quantity = (int)nudNum.Value, + Price = Convert.ToDecimal(txtPrice.Text), + WorkerNo = LoginInfo.WorkerNo, + SoftwareVersion = LoginInfo.SoftwareVersion + }; + var result = HttpHelper.Request(ApiConstants.Spend_AddCustomerSpend, customerSpend.ModelToJson()); + var response = HttpHelper.JsonToModel(result.message!); + if (response.Success == false) { - NotificationService.ShowError($"接口调用异常: {ex.Message}"); + NotificationService.ShowError(response.Message ?? "添加消费记录失败"); return; } + NotificationService.ShowSuccess("添加成功"); + + LoadSpendInfoByRoomNo(r); + LoadSellThingInfo(); + } + catch (Exception ex) + { + NotificationService.ShowError($"接口调用异常: {ex.Message}"); + return; } + } /// @@ -268,7 +282,7 @@ namespace EOM.TSHotelManagement.FormUI /// private void btnCancel_Click(object sender, EventArgs e) { - if (lblState.Visible == false) + if (txtRoomNo.Text.Trim().IsNullOrEmpty()) { NotificationService.ShowWarning("请先输入消费的房间!"); return; @@ -381,28 +395,29 @@ namespace EOM.TSHotelManagement.FormUI r = checkResponse.Data; if (txtRoomNo.Text == "") { - lblState.Text = ""; + tgState.Text = ""; + tgState.Type = TTypeMini.Warn; } else if (r == null) { - lblState.Visible = true; - lblState.Text = "该房间不存在"; - lblState.ForeColor = Color.Red; + tgState.Visible = true; + tgState.Text = "该房间不存在"; + tgState.Type = TTypeMini.Error; } else if (!r.IsNullOrEmpty()) { if (r.RoomStateId == new EnumHelper().GetEnumValue(RoomState.Occupied)) { - lblState.Visible = true; - lblState.Text = "该房间可消费"; - lblState.ForeColor = Color.Black; + tgState.Visible = true; + tgState.Text = "该房间可消费"; + tgState.Type = TTypeMini.Success; LoadSpendInfoByRoomNo(r); } else { - lblState.Visible = true; - lblState.Text = "该房间不可消费"; - lblState.ForeColor = Color.Red; + tgState.Visible = true; + tgState.Text = "该房间不可消费"; + tgState.Type = TTypeMini.Error; } } } @@ -410,7 +425,7 @@ namespace EOM.TSHotelManagement.FormUI TableComHelper helper = new TableComHelper(); private void dgvSellthing_CellClick(object sender, AntdUI.TableClickEventArgs e) { - if (lblState.Visible == false) + if (txtRoomNo.Text.Trim().IsNullOrEmpty()) { NotificationService.ShowWarning("请先输入消费的房间!"); return; diff --git a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj index eb25734..0a58791 100644 --- a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj +++ b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj @@ -12,6 +12,7 @@ enable true 2.10.7.0 + 2.10.7.0 EOM.TSHotelManagement.FormUI.Program x64 TS酒店管理系统 @@ -20,8 +21,8 @@ false app.manifest x64 - - + + Form @@ -108,7 +109,7 @@ - + @@ -118,6 +119,11 @@ Always + + + Always + + diff --git a/EOM.TSHotelManagement.FormUI/Properties/Resources.Designer.cs b/EOM.TSHotelManagement.FormUI/Properties/Resources.Designer.cs index 662e6ee..79089c4 100644 --- a/EOM.TSHotelManagement.FormUI/Properties/Resources.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace EOM.TSHotelManagement.FormUI.Properties { // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/EOM.TSHotelManagement.FormUI/Properties/launchSettings.json b/EOM.TSHotelManagement.FormUI/Properties/launchSettings.json new file mode 100644 index 0000000..c97a01c --- /dev/null +++ b/EOM.TSHotelManagement.FormUI/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "EOM.TSHotelManagement.FormUI": { + "commandName": "Project", + "nativeDebugging": true + } + } +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Contract.xml b/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Contract.xml new file mode 100644 index 0000000..db94a53 --- /dev/null +++ b/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Contract.xml @@ -0,0 +1,515 @@ + + + + EOM.TSHotelManagement.Contract + + + + + 资料创建人 + + + + + 资料创建时间 + + + + + 资料更新人 + + + + + 资料更新时间 + + + + + Token + + + + + 删除标识 + + + + + 状态码,例如 0 表示成功 + + + + + 返回消息,用于描述请求结果 + + + + + + + + + + 带状态码和消息的构造函数 + + 状态码 + 消息 + + + + 请求成功 + + + + + 创建成功(常用于 POST 请求) + + + + + 已接受(请求已接收但未处理完成) + + + + + 无内容(响应体为空) + + + + + 永久重定向 + + + + + 临时重定向 + + + + + 查看其他地址(常用于 POST 后重定向) + + + + + 资源未修改(缓存用) + + + + + 错误请求(参数或格式错误) + + + + + 未授权(身份验证失败) + + + + + 禁止访问(无权限) + + + + + 未找到资源 + + + + + 方法不允许(如 GET 接口用 POST 访问) + + + + + 请求超时 + + + + + 资源冲突(如重复提交) + + + + + 服务器内部错误 + + + + + 网关错误(上游服务异常) + + + + + 服务不可用(维护或过载) + + + + + 网关超时(上游服务响应超时) + + + + + + + + + + 页数 + + + + + 总数 + + + + + 忽略分页 + + + + + 带总数的列表输出Dto + + + + + 数据源 + + + + + 菜单 + + + + + 菜单主键 (Menu Key) + + + + + 菜单标题 (Menu Title) + + + + + 菜单路径 (Menu Path) + + + + + 图标 + + + + + 该菜单下允许的权限编码集合(如:department.create / department.update 等) + + + + + 子菜单 (Child Menus) + + + + + 数据源 + + + + + 账号 (Account) + + + + + 密码 (Password) + + + + + 邮箱 (Email) + + + + + 账号 (Account) + + + + + 邮箱 (Email) + + + + + 名称 (Name) + + + + + 密码 (Password) + + + + + 状态 (Status) + + + + + 最后一次登录地址 (Last Login IP) + + + + + 最后一次登录时间 (Last Login Time) + + + + + 客户类型 (Customer Type) + + + + + 客户类型名称 (Customer Type Name) + + + + + 优惠折扣 + + + + + 打卡编号 (Check-in/Check-out Number) + + + + + 员工工号 (Employee ID) + + + + + 打卡时间 (Check-in/Check-out Time) + + + + + 打卡方式 (Check-in/Check-out Method) + + + + + 打卡状态 (Check-in/Check-out Status) + + + + + 锟角凤拷为锟斤拷锟斤拷锟斤拷锟斤拷员锟斤拷锟斤拷 (Is Super Administrator Description) + + + + + 锟斤拷锟斤拷员锟斤拷锟斤拷锟斤拷锟斤拷 (Administrator Type Name) + + + + + 菜单视图模型 (Menu View Model) + + + + + 菜单主键 (Menu Key) + + + + + 菜单标题 (Menu Title) + + + + + 菜单路径 (Menu Path) + + + + + 子菜单 (Child Menus) + + + + + 系统模块常量类 + + + + + 基础信息 + + + + + 财务信息 + + + + + 水电管理 + + + + + 监管统计 + + + + + 客房管理 + + + + + 客户管理 + + + + + 人事管理 + + + + + 物资管理 + + + + + 员工操作日志 + + + + + 系统管理 + + + + + 为角色分配管理员(全量覆盖式) + + + + + 角色编码 + + + + + 管理员用户编码集合(Administrator.Number) + + + + + 请求路径 (Request Path) + + + + + 响应时间 (Elapsed Time) + + + + + 请求方法 (Http Method) + + + + + 状态码 (Status Code) + + + + + 异常消息 (Exception Message) + + + + + 异常堆栈 (Exception Stack Trace) + + + + + 请求路径 (URL Path) + + + + + HTTP方法 (GET/POST等) + + + + + 请求IP地址 + + + + + 请求参数 + + + + + HTTP状态码 + + + + + 请求时长(毫秒) + + + + + 用户代理 (浏览器信息) + + + + + 用户名 (未登录则为空) + + + + + 异常信息 + + + + + 请求时间 (自动设置为当前时间) + + + + + 响应大小(字节) + + + + + API操作描述 + + + + + 软件版本 + + + + diff --git a/EOM.TSHotelManagement.FormUI/TableComponent/ContractXml/EOM.TSHotelManagement.Contract.xml b/EOM.TSHotelManagement.FormUI/TableComponent/ContractXml/EOM.TSHotelManagement.Contract.xml new file mode 100644 index 0000000..db94a53 --- /dev/null +++ b/EOM.TSHotelManagement.FormUI/TableComponent/ContractXml/EOM.TSHotelManagement.Contract.xml @@ -0,0 +1,515 @@ + + + + EOM.TSHotelManagement.Contract + + + + + 资料创建人 + + + + + 资料创建时间 + + + + + 资料更新人 + + + + + 资料更新时间 + + + + + Token + + + + + 删除标识 + + + + + 状态码,例如 0 表示成功 + + + + + 返回消息,用于描述请求结果 + + + + + + + + + + 带状态码和消息的构造函数 + + 状态码 + 消息 + + + + 请求成功 + + + + + 创建成功(常用于 POST 请求) + + + + + 已接受(请求已接收但未处理完成) + + + + + 无内容(响应体为空) + + + + + 永久重定向 + + + + + 临时重定向 + + + + + 查看其他地址(常用于 POST 后重定向) + + + + + 资源未修改(缓存用) + + + + + 错误请求(参数或格式错误) + + + + + 未授权(身份验证失败) + + + + + 禁止访问(无权限) + + + + + 未找到资源 + + + + + 方法不允许(如 GET 接口用 POST 访问) + + + + + 请求超时 + + + + + 资源冲突(如重复提交) + + + + + 服务器内部错误 + + + + + 网关错误(上游服务异常) + + + + + 服务不可用(维护或过载) + + + + + 网关超时(上游服务响应超时) + + + + + + + + + + 页数 + + + + + 总数 + + + + + 忽略分页 + + + + + 带总数的列表输出Dto + + + + + 数据源 + + + + + 菜单 + + + + + 菜单主键 (Menu Key) + + + + + 菜单标题 (Menu Title) + + + + + 菜单路径 (Menu Path) + + + + + 图标 + + + + + 该菜单下允许的权限编码集合(如:department.create / department.update 等) + + + + + 子菜单 (Child Menus) + + + + + 数据源 + + + + + 账号 (Account) + + + + + 密码 (Password) + + + + + 邮箱 (Email) + + + + + 账号 (Account) + + + + + 邮箱 (Email) + + + + + 名称 (Name) + + + + + 密码 (Password) + + + + + 状态 (Status) + + + + + 最后一次登录地址 (Last Login IP) + + + + + 最后一次登录时间 (Last Login Time) + + + + + 客户类型 (Customer Type) + + + + + 客户类型名称 (Customer Type Name) + + + + + 优惠折扣 + + + + + 打卡编号 (Check-in/Check-out Number) + + + + + 员工工号 (Employee ID) + + + + + 打卡时间 (Check-in/Check-out Time) + + + + + 打卡方式 (Check-in/Check-out Method) + + + + + 打卡状态 (Check-in/Check-out Status) + + + + + 锟角凤拷为锟斤拷锟斤拷锟斤拷锟斤拷员锟斤拷锟斤拷 (Is Super Administrator Description) + + + + + 锟斤拷锟斤拷员锟斤拷锟斤拷锟斤拷锟斤拷 (Administrator Type Name) + + + + + 菜单视图模型 (Menu View Model) + + + + + 菜单主键 (Menu Key) + + + + + 菜单标题 (Menu Title) + + + + + 菜单路径 (Menu Path) + + + + + 子菜单 (Child Menus) + + + + + 系统模块常量类 + + + + + 基础信息 + + + + + 财务信息 + + + + + 水电管理 + + + + + 监管统计 + + + + + 客房管理 + + + + + 客户管理 + + + + + 人事管理 + + + + + 物资管理 + + + + + 员工操作日志 + + + + + 系统管理 + + + + + 为角色分配管理员(全量覆盖式) + + + + + 角色编码 + + + + + 管理员用户编码集合(Administrator.Number) + + + + + 请求路径 (Request Path) + + + + + 响应时间 (Elapsed Time) + + + + + 请求方法 (Http Method) + + + + + 状态码 (Status Code) + + + + + 异常消息 (Exception Message) + + + + + 异常堆栈 (Exception Stack Trace) + + + + + 请求路径 (URL Path) + + + + + HTTP方法 (GET/POST等) + + + + + 请求IP地址 + + + + + 请求参数 + + + + + HTTP状态码 + + + + + 请求时长(毫秒) + + + + + 用户代理 (浏览器信息) + + + + + 用户名 (未登录则为空) + + + + + 异常信息 + + + + + 请求时间 (自动设置为当前时间) + + + + + 响应大小(字节) + + + + + API操作描述 + + + + + 软件版本 + + + + diff --git a/EOM.TSHotelManagement.FormUI/TableComponent/TableComHelper.cs b/EOM.TSHotelManagement.FormUI/TableComponent/TableComHelper.cs index f627494..40ea6b9 100644 --- a/EOM.TSHotelManagement.FormUI/TableComponent/TableComHelper.cs +++ b/EOM.TSHotelManagement.FormUI/TableComponent/TableComHelper.cs @@ -10,26 +10,58 @@ namespace EOM.TSHotelManagement.FormUI { private XDocument _xmlDoc; - public TableComHelper() + public TableComHelper(string resourceType = ".xml", string? specificFileName = null) { try { var assembly = Assembly.GetExecutingAssembly(); + string[] resourceNames = assembly.GetManifestResourceNames(); - var resourceName = assembly.GetManifestResourceNames() - .FirstOrDefault(name => name.EndsWith("EOM.TSHotelManagement.Common.Contract.xml")); + // 根据传入的参数筛选资源 + string? resourceName = null; + + if (!string.IsNullOrEmpty(specificFileName)) + { + // 如果有特定的文件名,精确匹配 + resourceName = resourceNames.FirstOrDefault(name => + name.EndsWith(specificFileName, StringComparison.OrdinalIgnoreCase)); + } + else + { + // 否则根据资源类型筛选 + resourceName = resourceNames.FirstOrDefault(name => + name.EndsWith(resourceType, StringComparison.OrdinalIgnoreCase) || + name.Contains(resourceType, StringComparison.OrdinalIgnoreCase)); + } + + if (string.IsNullOrEmpty(resourceName)) + { + // 如果没有找到,尝试其他常见名称模式 + if (resourceType.ToLower() == ".xml") + { + resourceName = resourceNames.FirstOrDefault(name => + name.EndsWith(".xml", StringComparison.OrdinalIgnoreCase) || + name.Contains("Contract.xml") || + name.Contains(".contract.")); + } + } if (string.IsNullOrEmpty(resourceName)) - throw new FileNotFoundException("未找到嵌入的XML资源"); + { + // 记录可用的资源名称以便调试 + var availableResources = string.Join(", ", resourceNames); + throw new FileNotFoundException($"未找到指定的嵌入资源。资源类型: {resourceType}, 特定文件名: {specificFileName}。可用资源: {availableResources}"); + } using (var stream = assembly.GetManifestResourceStream(resourceName)) { if (stream == null) - throw new FileNotFoundException("无法加载资源流"); + throw new FileNotFoundException($"无法加载资源流: {resourceName}"); using (var reader = new StreamReader(stream, Encoding.UTF8)) { _xmlDoc = XDocument.Load(reader); + Console.WriteLine($"成功加载嵌入资源: {resourceName}"); } } } @@ -37,7 +69,6 @@ namespace EOM.TSHotelManagement.FormUI { throw new InvalidOperationException("无法加载嵌入的XML内容", ex); } - } /// diff --git a/EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs b/EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs index cd31cd7..384a5ee 100644 --- a/EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs +++ b/EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs @@ -4,7 +4,6 @@ { public const string Default_Version = "version"; public const string Common_GetCsrfToken = "Login/GetCsrfToken"; - public const string Common_RefreshCsrfToken = "Login/RefreshCSRFToken"; // Base URLs public const string Base_SelectNationAll = "Base/SelectNationAll"; diff --git a/EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj b/EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj index 86c3066..21d7def 100644 --- a/EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj +++ b/EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj @@ -13,7 +13,7 @@ - + diff --git a/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs b/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs index 7e4c7ca..1d58c0b 100644 --- a/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs +++ b/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs @@ -12,7 +12,7 @@ namespace EOM.TSHotelManagement.Shared { public static string GetCsrfToken() { - var apiResponse = HttpHelper.Request(ApiConstants.Common_GetCsrfToken, string.Empty); + var apiResponse = HttpHelper.CsrfTokenRequest(ApiConstants.Common_GetCsrfToken); var response = HttpHelper.JsonToModel>(apiResponse.message); if (response.Success && response.Data != null) { @@ -25,15 +25,7 @@ namespace EOM.TSHotelManagement.Shared public static string RefreshCsrfToken() { - var apiResponse = HttpHelper.Request(ApiConstants.Common_RefreshCsrfToken, string.Empty); - var response = HttpHelper.JsonToModel>(apiResponse.message); - if (response.Success && response.Data != null) - { - LoginInfo.CsrfToken = response.Data.Token; - LoginInfo.NeedRefreshCsrfToken = response.Data.NeedsRefresh; - } - - return LoginInfo.CsrfToken ?? string.Empty; + return GetCsrfToken(); } } } diff --git a/EOM.TSHotelManagement.Shared/Helper/HttpHelper.cs b/EOM.TSHotelManagement.Shared/Helper/HttpHelper.cs index 4c3d893..6210317 100644 --- a/EOM.TSHotelManagement.Shared/Helper/HttpHelper.cs +++ b/EOM.TSHotelManagement.Shared/Helper/HttpHelper.cs @@ -209,6 +209,25 @@ namespace EOM.TSHotelManagement.Shared return msg; } + /// + /// CSRF令牌请求方法 + /// + /// + public static ResponseMsg CsrfTokenRequest(string url) + { + ResponseMsg msg = new ResponseMsg(); + + //处理url + var sourceStr = url.Replace("​", string.Empty); + + var requestUrl = apiUrl + sourceStr; + + msg = DoGet(requestUrl); + + return msg; + + } + /// /// GET请求 /// @@ -286,12 +305,16 @@ namespace EOM.TSHotelManagement.Shared /// /// /// + /// 是否跳过CSRF令牌刷新(用于刷新令牌的请求本身) /// - public static ResponseMsg DoPost(string url, string? jsonParam = null, string? contentType = null, string? referer = null, string? cookie = null, Dictionary? dicHeaders = null) + public static ResponseMsg DoPost(string url, string? jsonParam = null, string? contentType = null, + string? referer = null, string? cookie = null, + Dictionary? dicHeaders = null, bool skipCsrfRefresh = false) { var reponse = new RestResponse(); var client = new RestClient(url); var request = new RestRequest(); + if (!string.IsNullOrEmpty(contentType)) { request.AddHeader("Content-Type", contentType); @@ -321,18 +344,44 @@ namespace EOM.TSHotelManagement.Shared request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"); - request.AddBody(jsonParam!); + if (!jsonParam.IsNullOrEmpty()) + { + request.AddBody(jsonParam!, ContentType.Json); + } var token = LoginInfo.UserToken; - request.AddHeader("Authorization", string.Format("Bearer {0}", token)); - if (LoginInfo.NeedRefreshCsrfToken) + // 处理CSRF令牌 + string? csrfToken = null; + + if (!skipCsrfRefresh) { - CsrfTokenHelper.RefreshCsrfToken(); + // 只有在需要刷新时才刷新令牌 + if (LoginInfo.NeedRefreshCsrfToken) + { + csrfToken = CsrfTokenHelper.RefreshCsrfToken(); + // 重置刷新标志 + LoginInfo.NeedRefreshCsrfToken = false; + } + else + { + // 使用现有的令牌 + csrfToken = LoginInfo.CsrfToken; + + // 如果令牌为空,尝试获取一个 + if (string.IsNullOrEmpty(csrfToken)) + { + csrfToken = CsrfTokenHelper.GetCsrfToken(); + } + } } - request.AddHeader("X-CSRF-TOKEN-HEADER", LoginInfo.CsrfToken ?? CsrfTokenHelper.RefreshCsrfToken()); + // 只有令牌不为空时才添加 + if (!string.IsNullOrEmpty(csrfToken)) + { + request.AddHeader("X-CSRF-TOKEN-HEADER", csrfToken); + } reponse = client.ExecutePost(request); @@ -340,7 +389,6 @@ namespace EOM.TSHotelManagement.Shared return new ResponseMsg() { message = responseString }; } - /// /// 获取文件的MIME类型 /// -- Gitee