diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 968a7c2c6185d8b741531eaa625fb31aa6d3f269..0000000000000000000000000000000000000000 --- a/.gitmodules +++ /dev/null @@ -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.Client.TopSkyHotelManagementSystem.sln b/EOM.Client.TopSkyHotelManagementSystem.sln index 98c469cd39ec71284ea520ed596a11b2e44325f8..376a9d419dfd7046e7f4bc93d6a63393360f254d 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 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}" +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 -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/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs b/EOM.TSHotelManagement.FormUI/ClientCustomControls/ucRoom.cs index 3c67ced7a845f1875ef36321eb5d49fd3b3d644b..716b45c463c8ee9cc911dbfa1222091526a1f137 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) @@ -131,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 + ); /// /// 使窗口有鼠标穿透功能 /// @@ -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)Common.Core.RoomState.Vacant: + case (int)Common.RoomState.Vacant: btnRoom.BackgroundImage = Resources.可住状态; break; - case (int)Common.Core.RoomState.Occupied: + case (int)Common.RoomState.Occupied: btnRoom.BackgroundImage = Resources.已住状态; break; - case (int)Common.Core.RoomState.Maintenance: + case (int)Common.RoomState.Maintenance: btnRoom.BackgroundImage = Resources.维修状态; break; - case (int)Common.Core.RoomState.Dirty: + case (int)Common.RoomState.Dirty: btnRoom.BackgroundImage = Resources.脏房状态; break; - case (int)Common.Core.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(Common.Core.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)Common.Core.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)Common.Core.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)Common.Core.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)Common.Core.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)Common.Core.RoomState.Maintenance: - case (int)Common.Core.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 9a550373df88c134d0f55178064fbcefc584ac68..5b676d144b5264d13ad727b7cc825f100b142312 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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs index de1909200ddadf7d5aad83e2d376886e7f4a4d20..3595ed9b0115e7fd221d5ca6384c4e9b30e359e0 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.Designer.cs @@ -34,9 +34,11 @@ 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(); + label4 = new AntdUI.Label(); SuspendLayout(); // // lblTips @@ -93,40 +95,69 @@ 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, 167); + 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, 378); + 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, 378); + 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; + // + // 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, 517); - Controls.Add(lblReleaseLog); - Controls.Add(label3); + ClientSize = new Size(335, 424); + Controls.Add(label4); + 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 +176,10 @@ 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; + 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 22de129c17103577c2e3bd2c431e18d2587ca91e..e54fd4f026ad1a3d086af5837f9c77b5fdc51948 100644 --- a/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs +++ b/EOM.TSHotelManagement.FormUI/ClientEntrance/FrmLoading.cs @@ -23,8 +23,9 @@ */ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Shared; 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; @@ -95,41 +96,48 @@ 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()); - 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() @@ -167,7 +175,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); @@ -350,5 +360,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 189cfa68ab7d5793c0f5f045f0419e1c6d1fe9b9..cb9afe07fb209d44ca8c3d13b15b707c57815c1e 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 ab62a35415077619c23ac642d6b2077c06fd02d9..49f83842f89c13e59553a52692c459315351eb0f 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; @@ -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()); @@ -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}"), Common.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 acf83d45e4532e1905904769cc97f0f22c59609d..03e3b82ca8cdaf8ef28aa9369093b8fc5b6d01a1 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 55954f094e76f2e43f7d7c6fa5c4c456bca9f22b..b4ebc20a2369439584793bb2bc160c318680da4d 100644 --- a/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.cs +++ b/EOM.TSHotelManagement.FormUI/ClientMain/FrmMain.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 EOM.TSHotelManagement.FormUI.Properties; using jvncorelib.CodeLib; using jvncorelib.EntityLib; @@ -56,7 +56,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; @@ -202,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 }; @@ -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) @@ -519,12 +519,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/FrmAbout.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.Designer.cs index 14611b9ab920f2b06d3e3a84492df8f23e2a723c..29d7983c456cbb1643f8ae90e71fe30384979072 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/FrmAbout.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAbout.cs index 15f2df0a7920145ad9a488dab29cde3e416df843..edde48b75d06398fbd388e72d07b2256a57a4a13 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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs index 807d38ec10c12e8b756c7e86a94bdcba8316b303..ad25bf3108e69ebc00bced8b69560295cb0e2160 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.Designer.cs @@ -140,12 +140,12 @@ 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; StartPosition = FormStartPosition.CenterScreen; - Text = "FrmAccountSecurity"; + Text = "账号安全"; Load += FrmAccountSecurity_Load; ResumeLayout(false); } diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAccountSecurity.cs index f926c360d9628ac01743a2d190713cb842cc7b02..f20ca2322cc695fc0a69bf95faeba878be01f2cc 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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs index f97042de8229674bf8bdaca41c7b1d5c53f2453c..75a037aa124edb2e71f4cd090748a6cb409ff4b1 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.Designer.cs @@ -80,12 +80,12 @@ 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; StartPosition = FormStartPosition.CenterScreen; - Text = "FrmAvator"; + Text = "账号头像"; Load += FrmAvator_Load; ((System.ComponentModel.ISupportInitialize)picWorkerPic).EndInit(); ResumeLayout(false); diff --git a/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmAvator.cs index a118bed49e43232ba06dbb19ae873a748e130ff1..e6a898e9f2a1c0e6972c44fd29cf36d77feadfdf 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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.Designer.cs index 01d3d02f951ce31570473f505d2f506fa38fffc1..a5a7892f74a19114db2d49f5a1dfd1a1ce6f2828 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 9f2d88951f036b0644a64d1cb77b87319d267cb2..25a96777e53fce6281fb96cf3c079e1c1fbea9e6 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmChangeRoom.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; namespace EOM.TSHotelManagement.FormUI @@ -81,10 +82,10 @@ 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 + "进行了换房!", 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 d9177ae78397ae141a3b326cf0ee319220271087..3329a99e36420780519c399ff39a92c422233ac0 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 92453d0af46bda937da9c447c68333169e898107..ce1e883a6bc2a760f7c0429702b98e35a81726be 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCheckIn.cs @@ -25,8 +25,8 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Contract; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Transactions; @@ -189,10 +189,10 @@ 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 + "进行了入住操作!", 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 44eb3f3a7c724830d4ae3d45c77f94c49b014ce8..405e9904629567970463a4e1856bc2f9d29e8c2e 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 = "实收金额:"; // @@ -346,12 +346,12 @@ 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; 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 74ab54aad52449307e96180e4e8a8f234e576fa5..525368f4e6462e50a79066ee7a6c722fa59bd2d7 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) @@ -195,11 +198,11 @@ namespace EOM.TSHotelManagement.FormUI return; } NotificationService.ShowSuccess("结算成功!"); - FrmRoomManager.Reload(""); + FrmRoomManager.Reload(0); 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 9338d0e8f361c5783578204310febad01de3b88e..c8537ecb6c8092b8141a34652baeb3eea5934ce8 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/FrmCustomerInfo.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerInfo.cs index af592709f26fd09bf8b098da3617e58defe079ca..dd09eee64dbd63cf5054e6f763d5916176b26326 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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.Designer.cs index 303ea3c1995d6f536d0f5b027fc3cbfeef65a98e..c0fd442e750f0c7ecb95034366b3d00bb0a6c44b 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. @@ -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; // - // FrmCustomerManager + // 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); @@ -193,12 +204,11 @@ Controls.Add(btnUpdCustomer); Controls.Add(btnAddCusto); Controls.Add(btnSerach); - FormBorderStyle = FormBorderStyle.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Margin = new Padding(4); - Name = "FrmCustomerManager"; - StartPosition = FormStartPosition.CenterScreen; - Text = "TS酒店管理系统"; - Load += FrmCustomerManager_Load; + Name = "FrmCustomerManagement"; + Text = "客户管理"; + Load += FrmCustomerManagement_Load; cmsCustomerAction.ResumeLayout(false); ResumeLayout(false); } @@ -217,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 692e14fad600cabbc0fe0b62e88883d8de3bbb2c..4b5b300bbf7ccf72d0d89fa7816f7df4d91b4449 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmCustomerManagement.cs @@ -22,14 +22,16 @@ * */ +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; 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 +53,7 @@ namespace EOM.TSHotelManagement.FormUI public static ReloadCustomerList ReloadCustomer; private LoadingProgress _loadingProgress; - public FrmCustomerManager() + public FrmCustomerManagement() { InitializeComponent(); _loadingProgress = new LoadingProgress(); @@ -64,8 +66,9 @@ 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) { + btnClear.IconSvg = UIControlIconConstant.Clear; this.btnPg.PageSize = 15; LoadCustomer(); } @@ -99,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) @@ -150,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(); @@ -254,6 +265,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/FrmEditInputs.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.Designer.cs index a22ed947dfbb65ad20f0eb702806f28111f441d9..a4362dd7a62c2cef7ab4a998deaf8c3ee57a37a0 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 ce87bc7bdc0fe707ff3a4f4d4011320da6339285..1342068e978748c106e87c4bcb53670b6d972b59 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmEditInputs.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.CodeLib; using jvncorelib.EntityLib; @@ -78,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) { @@ -96,15 +92,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); @@ -124,7 +120,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()), @@ -148,10 +144,10 @@ 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); + FrmCustomerManagement.ReloadCustomer(false); } private void FrmEditInputs_ButtonOkClick(object sender, EventArgs e) @@ -180,9 +176,9 @@ 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, 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 d6f798df64c4153d3eb0cde8e562cd6a663bbd61..43a538541b1306e15751ea109e710407553a38b5 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); @@ -257,12 +280,12 @@ 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; 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 f30ffe8b32a84d91384640b28e7d5e81ade24bb6..78f90d13c8434de73eece997fe2f215f9074c09b 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmPersonnelInfo.cs @@ -1,21 +1,23 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Contract; using jvncorelib.EntityLib; using System.Data; +using EOM.TSHotelManagement.Shared; 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) { @@ -34,12 +36,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) { @@ -87,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(); } @@ -137,30 +135,47 @@ 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 + "执行:" + "修改个人信息操作!", 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 80684614f47bb0621b30a36b81a48dd064560968..1a0fa6e1ebf9701645f80bcc177edc81f927de0c 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; @@ -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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.Designer.cs index f76b7f72170a5982b9e1f65374a37d647aa90d53..ec19e782efc2affa2f2a55a7e0f2cff5e1043d4e 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/FrmReserList.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserList.cs index bf4ef3f29062072ba1fed8b82a654411c9a7dc8a..e18be64608adbc8e7ebcfaf84f0c2a74c6cb0826 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) { @@ -200,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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmReserManagement.Designer.cs index f4cfef3c0865c8fccf82e2e269e048474bc20b1a..7e1fe4f9de5cf969d858c6deaf6bc945e09881fd 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 c328bf3152993c929afcab0a8ab6205036cae0a6..67e4fb555a7a3713bfa07c7de4f058a62b472274 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.Common.Core; +using EOM.TSHotelManagement.Contract; using jvncorelib.CodeLib; using jvncorelib.EntityLib; using System.Transactions; +using EOM.TSHotelManagement.Shared; namespace EOM.TSHotelManagement.FormUI { @@ -89,10 +89,10 @@ 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(""); + 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 b8b30236f84491633444a2cbde2b286ee15ff91e..22f944edb8ca1bbef3f618da36bd0e01341337ca 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, 282); pnlRoomInfo.Margin = new Padding(4); pnlRoomInfo.Name = "pnlRoomInfo"; - pnlRoomInfo.Size = new Size(255, 346); + pnlRoomInfo.Size = new Size(255, 337); 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, 271); muRoomState.TabIndex = 96; muRoomState.SelectChanged += muRoomState_SelectChanged; // @@ -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 79a5e5d4023307fb3969fba6287d776ceea6d978..22dad05cf378af143587037cf06b7e20b5be2950 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomManagement.cs @@ -24,11 +24,10 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.FormUI.Properties; -using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; +using EOM.TSHotelManagement.Shared; namespace EOM.TSHotelManagement.FormUI { @@ -36,7 +35,7 @@ namespace EOM.TSHotelManagement.FormUI { - public delegate void ReLoadRoomList(string typeName); + public delegate void ReLoadRoomList(int typeId); public delegate void ReadRoomInfo(); @@ -181,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(), @@ -255,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) @@ -267,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); } @@ -280,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); } } @@ -300,48 +300,38 @@ 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); 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 = ""; @@ -373,8 +363,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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.Designer.cs index 1964a7e3730a4332a6049f70744be66d1ae46163..ff3065b196f850132747faf6072398715bc5efc0 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 cffc0237c053a0598cb199edbf227236e0782ef1..ae14e89150eadb2142256aea76c07d48cd416b1e 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmRoomStateManagement.cs @@ -24,8 +24,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; @@ -82,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/FrmScreenLock.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.Designer.cs index 8a5f7b824c0a43469d6e5cc69b6ef24aa9996a87..82351757c2ceddbe84dca964f32b33c14d11856f 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/FrmScreenLock.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmScreenLock.cs index dbc877f15fa0270ae39e917e50c19c7e718a976f..a0ef617afdd19f9dbaf42636ee45b6c09e781045 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.Designer.cs b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs index 0acb8b806b4dee6749b0af93f5aec7ac50cd323e..cf0fbe67feac1c97d93e721c4188908d2ac56c48 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.Designer.cs @@ -30,89 +30,87 @@ { 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(); - ucWindowHeader1 = new ucWindowHeader(); + label1 = new AntdUI.Label(); + label2 = new AntdUI.Label(); + btnClear = new AntdUI.Button(); + tgState = new AntdUI.Tag(); 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); 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 = "订购中心"; // - // 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 // @@ -155,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, 51); - 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, 42); + txtFind.Location = new Point(148, 13); txtFind.Name = "txtFind"; txtFind.Round = true; txtFind.Size = new Size(197, 38); @@ -178,7 +165,7 @@ // btnFind // btnFind.Font = new Font("Noto Sans SC", 12F); - btnFind.Location = new Point(403, 42); + btnFind.Location = new Point(351, 13); btnFind.Name = "btnFind"; btnFind.Shape = AntdUI.TShape.Round; btnFind.Size = new Size(101, 38); @@ -187,21 +174,10 @@ 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, 51); - 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); - 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 +188,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); @@ -221,26 +197,15 @@ 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, 51); - lblState.Name = "lblState"; - lblState.Size = new Size(130, 23); - lblState.TabIndex = 32; - lblState.Text = ""; - lblState.TextAlign = ContentAlignment.MiddleCenter; - // // dgvSellthing // dgvSellthing.AutoSizeColumnsMode = AntdUI.ColumnsMode.Fill; 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 +223,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 +235,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,39 +250,70 @@ 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 + // 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; + // + // 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; // - ucWindowHeader1.Location = new Point(1, 1); - ucWindowHeader1.Name = "ucWindowHeader1"; - ucWindowHeader1.Size = new Size(1071, 35); - ucWindowHeader1.TabIndex = 139; + // 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(ucWindowHeader1); + Controls.Add(tgState); + Controls.Add(btnClear); + 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.None; + FormBorderStyle = FormBorderStyle.FixedSingle; Icon = (Icon)resources.GetObject("$this.Icon"); MaximizeBox = false; MinimizeBox = false; @@ -355,13 +351,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; @@ -372,9 +365,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.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 753da66d24caf5b78afb2202a959282d3622e0b3..bc47593244cc5d78ce523fc5d4d996e1a9743bcc 100644 --- a/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs +++ b/EOM.TSHotelManagement.FormUI/ClientModule/FrmSellThing.cs @@ -24,9 +24,7 @@ using AntdUI; using EOM.TSHotelManagement.Common; -using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; -using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.Contract; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; using System.Transactions; @@ -42,22 +40,19 @@ 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 窗体加载事件 private void FrmSellThing_Load(object sender, EventArgs e) { + btnClear.IconSvg = UIControlIconConstant.Clear; LoadSellThingInfo(); - } #endregion @@ -74,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) @@ -92,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()); @@ -157,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) @@ -166,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(); @@ -220,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; @@ -230,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; + } + } /// @@ -273,16 +282,16 @@ namespace EOM.TSHotelManagement.FormUI /// private void btnCancel_Click(object sender, EventArgs e) { - if (lblState.Visible == false) + if (txtRoomNo.Text.Trim().IsNullOrEmpty()) { NotificationService.ShowWarning("请先输入消费的房间!"); return; } 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) @@ -323,13 +332,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(); @@ -386,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; } } } @@ -415,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; @@ -447,5 +457,11 @@ namespace EOM.TSHotelManagement.FormUI }; } } + + private void btnClear_Click(object sender, EventArgs e) + { + txtFind.Clear(); + LoadSellThingInfo(); + } } } diff --git a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj index c56024d7665936580556956b4759cea3573080b5..0a58791263ed1ffc6b6a2a2999d0d333f1ad0e66 100644 --- a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj +++ b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj @@ -6,12 +6,13 @@ true win-x64 WinExe - net8.0-windows + net10.0-windows enable true enable true - 2.8.6.0 + 2.10.7.0 + 2.10.7.0 EOM.TSHotelManagement.FormUI.Program x64 TS酒店管理系统 @@ -20,8 +21,8 @@ false app.manifest x64 - - + + Form @@ -38,7 +39,7 @@ Form - + Form @@ -96,26 +97,11 @@ - - - True - True - True - - - - True - True - True - - - - - + - + @@ -123,7 +109,7 @@ - + @@ -134,10 +120,13 @@ - - PreserveNewest + + Always + + + Always diff --git a/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs b/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs index 8ed3030558f98e57a466b993d1adbb30ecc4f8fd..9bf8e7a6d743c5a62c36565db1361606c2592422 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/Properties/Resources.Designer.cs b/EOM.TSHotelManagement.FormUI/Properties/Resources.Designer.cs index 662e6eede2060907279327f3a5aee65949b1ea3e..79089c43a260497a5060ccf1efbfcb61f5bff6c5 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 0000000000000000000000000000000000000000..c97a01cd8062d5792a2a6997a7f95a1a8abfcfd4 --- /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.Common.Contract.xml b/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Common.Contract.xml index 22f5b6d7c8d4d74489d106dd7b5c360ca8022e38..069e1f800aca75f667da2d0a370e653f50ebbc8d 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/Resources/EOM.TSHotelManagement.Contract.xml b/EOM.TSHotelManagement.FormUI/Resources/EOM.TSHotelManagement.Contract.xml new file mode 100644 index 0000000000000000000000000000000000000000..db94a53700f66bdc65d906fa1bbe99787bf72a7b --- /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/Services/NotificationService.cs b/EOM.TSHotelManagement.FormUI/Services/NotificationService.cs index 437ff5b8c4ddba65ebc184e5a668f70f32822ae1..835489acde10514dc18626514349c92744fa3dbc 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/ContractXml/EOM.TSHotelManagement.Contract.xml b/EOM.TSHotelManagement.FormUI/TableComponent/ContractXml/EOM.TSHotelManagement.Contract.xml new file mode 100644 index 0000000000000000000000000000000000000000..db94a53700f66bdc65d906fa1bbe99787bf72a7b --- /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 57ab21302dcd9a8bc3f94f3c1737eb43a7a49f9d..40ea6b9b6bda4ef25bd5de533e63903b8166c573 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; @@ -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.Common/BackendApi/ApiConstants.cs b/EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs similarity index 98% rename from EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs rename to EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs index 8114313a858ac58ec8897f8f91db71c85353b807..384a5ee7a89ee5fd6e609923604f5c90525b1c87 100644 --- a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs +++ b/EOM.TSHotelManagement.Shared/BackendApi/ApiConstants.cs @@ -1,8 +1,10 @@ -namespace EOM.TSHotelManagement.Common +namespace EOM.TSHotelManagement.Shared { public static class ApiConstants { public const string Default_Version = "version"; + public const string Common_GetCsrfToken = "Login/GetCsrfToken"; + // Base URLs public const string Base_SelectNationAll = "Base/SelectNationAll"; public const string Base_SelectGenderTypeAll = "Base/SelectGenderTypeAll"; diff --git a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj b/EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj similarity index 51% rename from EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj rename to EOM.TSHotelManagement.Shared/EOM.TSHotelManagement.Shared.csproj index fc0d7c3486a79de3d9dfe73665d173d800799f61..21d7defed8237b5b8049cefb6062e38eedd35fb8 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,16 +9,13 @@ + + - - - - - - + diff --git a/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs b/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..1d58c0ba066b8dd391d7f291b764d0391581b4bb --- /dev/null +++ b/EOM.TSHotelManagement.Shared/Helper/CsrfTokenHelper.cs @@ -0,0 +1,31 @@ +using EOM.TSHotelManagement.Contract; +using jvncorelib.EntityLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Shared +{ + public static class CsrfTokenHelper + { + public static string GetCsrfToken() + { + var apiResponse = HttpHelper.CsrfTokenRequest(ApiConstants.Common_GetCsrfToken); + 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() + { + return GetCsrfToken(); + } + } +} diff --git a/EOM.TSHotelManagement.Shared/Helper/DiscountHelper.cs b/EOM.TSHotelManagement.Shared/Helper/DiscountHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..f2611a68a98656d3617eeaecbae7aca66b8cd122 --- /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 86% rename from EOM.TSHotelManagement.Common/Helper/HttpHelper.cs rename to EOM.TSHotelManagement.Shared/Helper/HttpHelper.cs index 64f88b50bfc00502a72433e2516aa91a476868c5..6210317be8b695ce1cdd3c294e048a91ca3321dd 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 { /// /// 文件上传帮助类 @@ -209,6 +209,25 @@ namespace EOM.TSHotelManagement.Common 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.Common /// /// /// + /// 是否跳过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,19 +344,51 @@ namespace EOM.TSHotelManagement.Common 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)); + // 处理CSRF令牌 + string? csrfToken = null; + + if (!skipCsrfRefresh) + { + // 只有在需要刷新时才刷新令牌 + if (LoginInfo.NeedRefreshCsrfToken) + { + csrfToken = CsrfTokenHelper.RefreshCsrfToken(); + // 重置刷新标志 + LoginInfo.NeedRefreshCsrfToken = false; + } + else + { + // 使用现有的令牌 + csrfToken = LoginInfo.CsrfToken; + + // 如果令牌为空,尝试获取一个 + if (string.IsNullOrEmpty(csrfToken)) + { + csrfToken = CsrfTokenHelper.GetCsrfToken(); + } + } + } + + // 只有令牌不为空时才添加 + if (!string.IsNullOrEmpty(csrfToken)) + { + request.AddHeader("X-CSRF-TOKEN-HEADER", csrfToken); + } + reponse = client.ExecutePost(request); var responseString = reponse.Content; return new ResponseMsg() { message = responseString }; } - /// /// 获取文件的MIME类型 /// 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 21c073f46a99e83a3d55586d89823e04a0b82a5d..09e5df876dc0391146261b4ba6ee667231ee3752 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 87% rename from EOM.TSHotelManagement.Common/LocalInfo/LoginInfo.cs rename to EOM.TSHotelManagement.Shared/LocalInfo/LoginInfo.cs index e4160e49f7fb87a6be1ccf6cbc18039681107854..b98e05fc8a02fbb920d8b3901bcc6a8b4f1815bb 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 { /// /// 登录信息静态类(前台工作人员登入后的本地信息存储) @@ -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/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 5ba682dca99445aa8005fdb8bae68a5885c7d58b..4eecd0411d31e9f2cf4c8dc496d7e61c81001b58 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 96% rename from EOM.TSHotelManagement.Common/UIControlIconConstant.cs rename to EOM.TSHotelManagement.Shared/UIControlIconConstant.cs index 95373597d0dffe64e0c2e0dffea9614cf2dcd421..ba01ac19f41b863dce7712ffcb61aff77db9e4a7 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 { @@ -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.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 2e8483ac1df937e337bfc2d2dd510307e8c79743..bed888a881608574c0c9362153ab8bf5ad40edc3 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 91% rename from EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs rename to EOM.TSHotelManagement.Shared/Util/ApplicationUtil.cs index d84931e8c03ec66e11c623c7b90dadfedb65fc6b..8d9a0600590a506449965224a10dcbd7b7a7650b 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 { /// /// 静态工具 @@ -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.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 47be9cebc3ef2b9dc13d34b778c9219a89af1168..b01ce0c2421084ad964f8023c42664d796150e30 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 fbbb88c99f19b045c04d0bcd91c16eb1ab12d727..11a9a07235a3c64ed3e89a2df4302b0ceb027873 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.Common.Core; +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 new file mode 100644 index 0000000000000000000000000000000000000000..c71415837c8fe72eb1445eb6254511cd9914fc93 --- /dev/null +++ b/nuget.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api deleted file mode 160000 index ccf133f885049974dd3cc5078406ba4d13eb42db..0000000000000000000000000000000000000000 --- a/topsky-hotel-management-system-web-api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ccf133f885049974dd3cc5078406ba4d13eb42db