From 0738b9e9b6893e343b40f6e9dc7cf5f7ec7561aa Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sun, 1 Jun 2025 02:13:07 +0800 Subject: [PATCH 1/9] add submodule. update README.md. --- .../EOM.TSHotelManagement.FormUI.csproj | 2 +- README.en.md | 6 +----- README.md | 6 +----- topsky-hotel-management-system-web-api | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj index 623b0dd..16eb163 100644 --- a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj +++ b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj @@ -11,7 +11,7 @@ true enable true - 2.8.5.0 + 2.8.5.1 EOM.TSHotelManagement.FormUI.Program x64 TS酒店管理系统 diff --git a/README.en.md b/README.en.md index fbf221e..5e7d0d9 100644 --- a/README.en.md +++ b/README.en.md @@ -125,10 +125,6 @@ EOM.Client.TopSkyHotelManagerSystem # :inbox_tray: Database Setup and Deployment (Local): -**The author and development team strongly recommend using the PostgreSQL database. Install the PostgreSQL database and start the service, establish the database through a visualization management tool, and quickly create data tables and import data by opening the .sql format files within the database script folder. Steps (using PostgreSQL database as an example):** - -**1. Link to the PostgreSQL database through a visualization management tool, then create a new database named ‘tshoteldb’.** - -**2. Open the db_file.sql in the database script\PostgreSQL version folder through the visualization management tool for data table creation and data import.** +**Omitted. This project does not include backend business logic. For details, please refer to: [Business Logic Project](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api/blob/master/README.en.md)** [![java-and-net/TopskyHotelManagementSystem](https://gitee.com/java-and-net/TopskyHotelManagementSystem/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b)](https://gitee.com/java-and-net/TopskyHotelManagerSystem) diff --git a/README.md b/README.md index a060a79..367541a 100644 --- a/README.md +++ b/README.md @@ -123,10 +123,6 @@ EOM.Client.TopskyHotelManagementSystem # :inbox_tray: 数据库运行部署(本地): -**作者及开发团队强烈建议使用MariaDB数据库,安装MariaDB数据库并开启服务,通过可视化管理工具对数据库进行建立,可通过打开执行数据库脚本文件夹内的.sql后缀格式文件进行快速建立数据表和导入数据,执行步骤(以MariaDB数据库为例):** - -**1、通过可视化管理工具链接MariaDB数据库,随后新建名为‘tshoteldb’数据库。** - -**2、通过可视化管理工具打开:数据库脚本\MariaDB版本\MDB_tshotel_script_table.sql以及数据库脚本\MariaDB版本\MDB_tshotel_script_data.sql进行数据表建立和数据导入。** +**略,本项目不包含后台业务逻辑。详情请查看:[业务逻辑项目](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api/blob/master/README.md)** [![java-and-net/TopskyHotelManagementSystem](https://gitee.com/java-and-net/TopskyHotelManagementSystem/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b)](https://gitee.com/java-and-net/TopskyHotelManagerSystem) \ No newline at end of file diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api index e6513d6..608cd09 160000 --- a/topsky-hotel-management-system-web-api +++ b/topsky-hotel-management-system-web-api @@ -1 +1 @@ -Subproject commit e6513d6270cd376a629b4b924d3d5f33054e8fea +Subproject commit 608cd097595d1ed1a8f2bade89d19dad8294b001 -- Gitee From cfd8d5427df5dadc088de591f1134b1f495f394d Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sun, 1 Jun 2025 16:56:55 +0000 Subject: [PATCH 2/9] update README.md. Signed-off-by: ck_yeun9 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 367541a..c7695cf 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@

中文文档 | English Document

+ # :exclamation: 重要说明: **注意:目前master分支随v2.x版本变动而变动,v2.x版本与v1.x版本变动极大,因此想要v1.x版本的可移步至v1.x分支地址** : https://gitee.com/java-and-net/TopskyHotelManagerSystem/tree/v1.x/ -- Gitee From 379180ae277b6191ae0f148dfed1c4e44c850da5 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Fri, 6 Jun 2025 08:15:14 +0000 Subject: [PATCH 3/9] =?UTF-8?q?update=20README.md.=20update=20hyperlink=20?= =?UTF-8?q?for=20=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=90=E8=A1=8C=E9=83=A8?= =?UTF-8?q?=E7=BD=B2(=E6=9C=AC=E5=9C=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ck_yeun9 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7695cf..3ad023d 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,6 @@ EOM.Client.TopskyHotelManagementSystem # :inbox_tray: 数据库运行部署(本地): -**略,本项目不包含后台业务逻辑。详情请查看:[业务逻辑项目](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api/blob/master/README.md)** +**略,本项目不包含后台业务逻辑。详情请查看:[业务逻辑项目](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api/blob/master/README.md#%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%90%E8%A1%8C%E9%83%A8%E7%BD%B2%E6%9C%AC%E5%9C%B0)** [![java-and-net/TopskyHotelManagementSystem](https://gitee.com/java-and-net/TopskyHotelManagementSystem/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b)](https://gitee.com/java-and-net/TopskyHotelManagerSystem) \ No newline at end of file -- Gitee From 261d35ce5515bb151f6c065eaae8529e0150a6d1 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 14 Jun 2025 03:32:48 +0800 Subject: [PATCH 4/9] housekeeping. change room,check out,check in,transfer room throw by http api. remove not use Converter. update README.md. --- .../AppConstant/Constant.cs | 40 ---- .../BackendApi/ApiConstants.cs | 8 +- .../Helper/DiscountConverter.cs | 45 ---- .../Helper/HttpHelper.cs | 11 +- .../Util/ApplicationUtil.cs | 8 +- .../Util/ClipboardHelper.cs | 83 +++++++ .../AppFunction/FrmChangeRoom.cs | 15 +- .../AppFunction/FrmCheckIn.cs | 5 +- .../AppFunction/FrmCheckOutForm.Designer.cs | 51 ++--- .../AppFunction/FrmCheckOutForm.cs | 29 +-- .../AppFunction/FrmCustomerManagement.cs | 33 +-- .../AppFunction/FrmEditInputs.cs | 3 +- .../AppFunction/FrmReserList.cs | 94 +++----- .../AppFunction/FrmRoomManagement.cs | 3 +- .../AppFunction/FrmSellThing.cs | 208 +++--------------- .../AppFunction/FrmUnLockSystem.Designer.cs | 123 ----------- .../AppFunction/FrmUnLockSystem.cs | 160 -------------- .../AppFunction/FrmUnLockSystem.resx | 123 ----------- .../AppInterface/FrmLoading.cs | 2 +- .../AppInterface/FrmLogin.cs | 4 +- .../AppMain/FrmMain.cs | 2 - .../EOM.TSHotelManagement.FormUI.csproj | 5 +- .../InitConfig/Initialize.cs | 2 +- README.en.md | 2 + README.md | 2 + topsky-hotel-management-system-web-api | 2 +- 26 files changed, 240 insertions(+), 823 deletions(-) delete mode 100644 EOM.TSHotelManagement.Common/AppConstant/Constant.cs delete mode 100644 EOM.TSHotelManagement.Common/Helper/DiscountConverter.cs create mode 100644 EOM.TSHotelManagement.Common/Util/ClipboardHelper.cs delete mode 100644 EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.Designer.cs delete mode 100644 EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.cs delete mode 100644 EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.resx diff --git a/EOM.TSHotelManagement.Common/AppConstant/Constant.cs b/EOM.TSHotelManagement.Common/AppConstant/Constant.cs deleted file mode 100644 index 4e056a3..0000000 --- a/EOM.TSHotelManagement.Common/AppConstant/Constant.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace EOM.TSHotelManagement.Common -{ - public class Constant where T : Constant - { - public string Code { get; } - public string Description { get; } - - private static List _constants = new List(); - - protected Constant(string code, string description) - { - Code = code; - Description = description; - _constants.Add((T)this); - } - - public static IEnumerable GetAll() - { - return _constants; - } - - public static string GetDescriptionByCode(string code) - { - var constant = _constants.SingleOrDefault(c => c.Code == code); - return constant?.Description ?? string.Empty; - } - - public static string GetCodeByDescription(string description) - { - var constant = _constants.SingleOrDefault(c => c.Description == description); - return constant?.Code ?? string.Empty; - } - - public static T? GetConstantByCode(string code) - { - var constant = _constants.FirstOrDefault(c => c.Code == code); - return constant ?? null; - } - } -} diff --git a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs b/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs index fd0544a..8f93a08 100644 --- a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs +++ b/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs @@ -16,7 +16,7 @@ public const string Employee_SelectEmployeeInfoByEmployeeId = "Employee/SelectEmployeeInfoByEmployeeId"; public const string Employee_UpdateEmployee = "Employee/UpdateEmployee"; public const string Employee_SelectEmployeeInfoByEmployeeIdAndEmployeePwd = "Employee/SelectEmployeeInfoByEmployeeIdAndEmployeePwd"; - public const string Employee_UpdateEmployeeAccountPassword= "Employee/UpdateEmployeeAccountPassword"; + public const string Employee_UpdateEmployeeAccountPassword = "Employee/UpdateEmployeeAccountPassword"; // EmployeePhoto URLs public const string EmployeePhoto_EmployeePhoto = "EmployeePhoto/EmployeePhoto"; @@ -46,6 +46,7 @@ public const string Room_SelectReservedRoomAllByRoomState = "Room/SelectReservedRoomAllByRoomState"; public const string Room_TransferRoom = "Room/TransferRoom"; public const string Room_CheckoutRoom = "Room/CheckoutRoom"; + public const string Room_CheckinRoomByReservation = "Room/CheckinRoomByReservation"; // Reser URLs public const string Reser_SelectReserAll = "Reser/SelectReserAll"; @@ -64,16 +65,19 @@ public const string Customer_UpdCustomerInfo = "Customer/UpdCustomerInfo"; public const string Customer_InsertCustomerInfo = "Customer/InsertCustomerInfo"; + // Customer Type URLs + public const string CustoType_SelectCustoTypeByTypeId = "Base/SelectCustoTypeByTypeId"; + // Spend URLs public const string Spend_SelectSpendByRoomNo = "Spend/SelectSpendByRoomNo"; public const string Spend_SumConsumptionAmount = "Spend/SumConsumptionAmount"; public const string Spend_UpdateMoneyState = "Spend/UpdateMoneyState"; - public const string Spend_SelectSpendByCustoNo = "Spend​/SelectSpendByCustoNo"; public const string Spend_UpdateSpendInfoByRoomNo = "Spend​/UpdateSpendInfoByRoomNo"; public const string Spend_InsertSpendInfo = "Spend​/InsertSpendInfo"; public const string Spend_SeletHistorySpendInfoAll = "Spend/SeletHistorySpendInfoAll"; public const string Spend_UpdSpenInfo = "Spend/UpdSpenInfo"; public const string Spend_UndoCustomerSpend = "Spend/UndoCustomerSpend"; + public const string Spend_AddCustomerSpend = "Spend/AddCustomerSpend"; // EnergyManagement URLs public const string EnergyManagement_SelectEnergyManagementInfo = "EnergyManagement/SelectEnergyManagementInfo"; diff --git a/EOM.TSHotelManagement.Common/Helper/DiscountConverter.cs b/EOM.TSHotelManagement.Common/Helper/DiscountConverter.cs deleted file mode 100644 index 193a5a9..0000000 --- a/EOM.TSHotelManagement.Common/Helper/DiscountConverter.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EOM.TSHotelManagement.Common -{ - public static class DiscountConverter - { - /// - /// 将 decimal 类型的折扣转换为中文xx折表示 - /// 例如:0.8m → "八折", 0.85m → "八五折" - /// - public static string ToZheString(this decimal discount) - { - int percentage = (int)(discount * 100); - - return percentage switch - { - 100 => "无折扣", - var x when x % 10 == 0 => $"{ConvertDigit(x / 10)}折", - _ => $"{ConvertDigit(percentage / 10)}{ConvertDigit(percentage % 10)}折" - }; - } - - /// - /// 数字转中文大写(0-9) - /// - private static string ConvertDigit(int num) => num switch - { - 0 => "〇", - 1 => "一", - 2 => "二", - 3 => "三", - 4 => "四", - 5 => "五", - 6 => "六", - 7 => "七", - 8 => "八", - 9 => "九", - _ => throw new ArgumentOutOfRangeException(nameof(num), "仅支持0-9数字转换") - }; - } -} diff --git a/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs b/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs index a4e619b..3c334a5 100644 --- a/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs +++ b/EOM.TSHotelManagement.Common/Helper/HttpHelper.cs @@ -13,14 +13,17 @@ namespace EOM.TSHotelManagement.Common /// public static class HttpHelper { - #region 受限于打包插件的限制才放在这,个人开发时建议统一在App.Config进行配置 - +#if DEBUG /// /// WebApi URL /// public const string apiUrl = "http://localhost:63001/api/"; - - #endregion +#elif RELEASE + /// + /// WebApi URL + /// + public const string apiUrl = "https://tshotel-api.oscode.top/api/"; +#endif public class IgnoreNullValuesConverter : JsonConverter { diff --git a/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs b/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs index d7e274e..a296c1b 100644 --- a/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs +++ b/EOM.TSHotelManagement.Common/Util/ApplicationUtil.cs @@ -25,7 +25,7 @@ namespace EOM.TSHotelManagement.Common { IdentityCardNumber = code.Substring(0, 6) }; - ResponseMsg result = HttpHelper.Request("Utility/SelectCardCode", input.ModelToJson()); + ResponseMsg result = HttpHelper.Request(ApiConstants.Utility_SelectCardCode, input.ModelToJson()); var response = HttpHelper.JsonToModel>(result.message); if (response.StatusCode != StatusCodeConstants.Success) { @@ -48,8 +48,10 @@ namespace EOM.TSHotelManagement.Common } return new Card { message = string.Empty, sex = sex, address = address, birthday = birthday }; } - - return new Card(); + else + { + return new Card() { message = "未配置号码表" }; + } } /// diff --git a/EOM.TSHotelManagement.Common/Util/ClipboardHelper.cs b/EOM.TSHotelManagement.Common/Util/ClipboardHelper.cs new file mode 100644 index 0000000..47be9ce --- /dev/null +++ b/EOM.TSHotelManagement.Common/Util/ClipboardHelper.cs @@ -0,0 +1,83 @@ +using System.Runtime.InteropServices; +using System.Text; + +namespace EOM.TSHotelManagement.Common; +public class ClipboardHelper +{ + [DllImport("user32.dll", SetLastError = true)] + private static extern bool OpenClipboard(IntPtr hWndNewOwner); + + [DllImport("user32.dll", SetLastError = true)] + private static extern bool CloseClipboard(); + + [DllImport("user32.dll", SetLastError = true)] + private static extern bool EmptyClipboard(); + + [DllImport("user32.dll", SetLastError = true)] + private static extern IntPtr SetClipboardData(uint uFormat, IntPtr hMem); + + [DllImport("kernel32.dll")] + private static extern IntPtr GlobalAlloc(uint uFlags, UIntPtr dwBytes); + + [DllImport("kernel32.dll")] + private static extern IntPtr GlobalLock(IntPtr hMem); + + [DllImport("kernel32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool GlobalUnlock(IntPtr hMem); + + private const uint CF_UNICODETEXT = 13; + + private const uint GMEM_MOVEABLE = 0x0002; + private const uint GMEM_ZEROINIT = 0x0040; + private const uint GMEM_DDESHARE = 0x2000; + + /// + /// 将文本复制到剪贴板 + /// + public static bool SetTextToClipboard(string text) + { + if (string.IsNullOrEmpty(text)) + return false; + + try + { + if (!OpenClipboard(IntPtr.Zero)) + return false; + + EmptyClipboard(); + + var textBytes = Encoding.Unicode.GetBytes(text + '\0'); + uint allocSize = (uint)(textBytes.Length * sizeof(byte)); + IntPtr hGlobal = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE | GMEM_ZEROINIT, (UIntPtr)allocSize); + + if (hGlobal == IntPtr.Zero) + return false; + + try + { + IntPtr pGlobal = GlobalLock(hGlobal); + if (pGlobal == IntPtr.Zero) + return false; + + try + { + Marshal.Copy(textBytes, 0, pGlobal, textBytes.Length); + } + finally + { + GlobalUnlock(hGlobal); + } + + return SetClipboardData(CF_UNICODETEXT, hGlobal) != IntPtr.Zero; + } + finally + { + } + } + finally + { + CloseClipboard(); + } + } +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmChangeRoom.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmChangeRoom.cs index 82aa20f..8276769 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmChangeRoom.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmChangeRoom.cs @@ -24,11 +24,8 @@ using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; -using EOM.TSHotelManagement.Shared; -using jvncorelib.CodeLib; +using jvncorelib.EntityLib; using Sunny.UI; -using System.Transactions; namespace EOM.TSHotelManagement.FormUI { @@ -41,7 +38,6 @@ namespace EOM.TSHotelManagement.FormUI ResponseMsg result = null; Dictionary dic = null; - static bool firstLoad = true; private void FrmChangeRoom_Load(object sender, EventArgs e) { @@ -55,7 +51,6 @@ namespace EOM.TSHotelManagement.FormUI cboRoomList.DataSource = datas.listSource; cboRoomList.DisplayMember = nameof(ReadRoomOutputDto.RoomNumber); cboRoomList.ValueMember = nameof(ReadRoomOutputDto.RoomNumber); - firstLoad = false; } private void btnChangeRoom_Click(object sender, EventArgs e) @@ -101,7 +96,13 @@ namespace EOM.TSHotelManagement.FormUI private void cboRoomList_TextChanged(object sender, EventArgs e) { - string str = firstLoad ? ucRoom.RoomNo.ToString() : cboRoomList.SelectedValue.ToString(); + string str = cboRoomList.SelectedValue.IsNullOrEmpty() ? string.Empty : cboRoomList.SelectedValue.ToString(); + if (string.IsNullOrEmpty(str)) + { + lblRoomType.Text = string.Empty; + return; + } + dic = new Dictionary() { { nameof(ReadRoomTypeInputDto.RoomNumber) , str } diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckIn.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckIn.cs index bcd8850..86df5cf 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckIn.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckIn.cs @@ -144,8 +144,9 @@ namespace EOM.TSHotelManagement.FormUI var spendAmount = listCustoSpend.Sum(a => a.ConsumptionAmount); var new_type = listVipRule .Where(vipRule => spendAmount >= vipRule.RuleValue) - .OrderByDescending(vipRule => vipRule.RuleValue) - .FirstOrDefault()?.VipLevelId ?? 0; + .OrderByDescending(vipRule => vipRule.RuleValue) + .ThenByDescending(vipRule => vipRule.VipLevelId) + .FirstOrDefault()?.VipLevelId ?? 0; // 如果会员等级有变,更新会员等级 if (new_type != 0) diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckOutForm.Designer.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckOutForm.Designer.cs index 0a26a0d..0509194 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckOutForm.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckOutForm.Designer.cs @@ -86,7 +86,7 @@ // lblVIPPrice.AutoSize = true; lblVIPPrice.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - lblVIPPrice.Location = new Point(517, 396); + lblVIPPrice.Location = new Point(509, 394); lblVIPPrice.Name = "lblVIPPrice"; lblVIPPrice.Size = new Size(40, 20); lblVIPPrice.TabIndex = 28; @@ -95,11 +95,11 @@ // label15 // label15.AutoSize = true; - label15.Font = new Font("Microsoft Sans Serif", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134); + label15.Font = new Font("Microsoft Sans Serif", 10.5F, FontStyle.Bold, GraphicsUnit.Point, 0); label15.ForeColor = Color.Red; label15.Location = new Point(7, 525); label15.Name = "label15"; - label15.Size = new Size(253, 17); + label15.Size = new Size(273, 17); label15.TabIndex = 11; label15.Text = "Tips:请提醒客人不要忘记带齐行李哦~"; // @@ -107,7 +107,7 @@ // lblDay.AutoSize = true; lblDay.Font = new Font("Microsoft Sans Serif", 15F, FontStyle.Regular, GraphicsUnit.Point, 0); - lblDay.Location = new Point(572, 76); + lblDay.Location = new Point(593, 76); lblDay.Name = "lblDay"; lblDay.Size = new Size(45, 25); lblDay.TabIndex = 114; @@ -117,17 +117,17 @@ // lable00.AutoSize = true; lable00.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - lable00.Location = new Point(422, 396); + lable00.Location = new Point(422, 394); lable00.Name = "lable00"; lable00.Size = new Size(89, 20); lable00.TabIndex = 26; - lable00.Text = "折后金额:"; + lable00.Text = "应付金额:"; // // label29 // label29.AutoSize = true; label29.Font = new Font("微软雅黑", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134); - label29.Location = new Point(551, 24); + label29.Location = new Point(572, 24); label29.Name = "label29"; label29.Size = new Size(88, 25); label29.TabIndex = 113; @@ -137,7 +137,7 @@ // lblVIP.AutoSize = true; lblVIP.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - lblVIP.Location = new Point(517, 364); + lblVIP.Location = new Point(508, 362); lblVIP.Name = "lblVIP"; lblVIP.Size = new Size(73, 20); lblVIP.TabIndex = 24; @@ -147,7 +147,7 @@ // label25.AutoSize = true; label25.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - label25.Location = new Point(422, 364); + label25.Location = new Point(422, 362); label25.Name = "label25"; label25.Size = new Size(89, 20); label25.TabIndex = 23; @@ -177,7 +177,7 @@ // lblChange.AutoSize = true; lblChange.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - lblChange.Location = new Point(516, 460); + lblChange.Location = new Point(509, 458); lblChange.Name = "lblChange"; lblChange.Size = new Size(40, 20); lblChange.TabIndex = 21; @@ -187,7 +187,7 @@ // label21.AutoSize = true; label21.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - label21.Location = new Point(421, 460); + label21.Location = new Point(421, 458); label21.Name = "label21"; label21.Size = new Size(89, 20); label21.TabIndex = 20; @@ -197,7 +197,7 @@ // lblGetReceipts.AutoSize = true; lblGetReceipts.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - lblGetReceipts.Location = new Point(516, 428); + lblGetReceipts.Location = new Point(509, 330); lblGetReceipts.Name = "lblGetReceipts"; lblGetReceipts.Size = new Size(40, 20); lblGetReceipts.TabIndex = 19; @@ -207,7 +207,7 @@ // label1.AutoSize = true; label1.Font = new Font("微软雅黑", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134); - label1.Location = new Point(26, 76); + label1.Location = new Point(7, 76); label1.Name = "label1"; label1.Size = new Size(88, 25); label1.TabIndex = 106; @@ -217,7 +217,7 @@ // label24.AutoSize = true; label24.Font = new Font("微软雅黑", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134); - label24.Location = new Point(26, 24); + label24.Location = new Point(7, 24); label24.Name = "label24"; label24.Size = new Size(88, 25); label24.TabIndex = 105; @@ -227,7 +227,7 @@ // label17.AutoSize = true; label17.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - label17.Location = new Point(421, 334); + label17.Location = new Point(421, 426); label17.Name = "label17"; label17.Size = new Size(89, 20); label17.TabIndex = 14; @@ -237,11 +237,11 @@ // label18.AutoSize = true; label18.Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); - label18.Location = new Point(421, 428); + label18.Location = new Point(422, 330); label18.Name = "label18"; label18.Size = new Size(89, 20); label18.TabIndex = 15; - label18.Text = "应收金额:"; + label18.Text = "消费总额:"; // // label2 // @@ -392,7 +392,7 @@ dtpCheckTime.Name = "dtpCheckTime"; dtpCheckTime.PlaceholderText = ""; dtpCheckTime.ReadOnly = true; - dtpCheckTime.Size = new Size(168, 42); + dtpCheckTime.Size = new Size(180, 42); dtpCheckTime.TabIndex = 161; // // txtRoomNo @@ -402,27 +402,27 @@ txtRoomNo.Name = "txtRoomNo"; txtRoomNo.PlaceholderText = ""; txtRoomNo.ReadOnly = true; - txtRoomNo.Size = new Size(168, 42); + txtRoomNo.Size = new Size(180, 42); txtRoomNo.TabIndex = 160; // // CustoName // CustoName.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134); - CustoName.Location = new Point(117, 67); + CustoName.Location = new Point(98, 67); CustoName.Name = "CustoName"; CustoName.PlaceholderText = ""; CustoName.ReadOnly = true; - CustoName.Size = new Size(143, 42); + CustoName.Size = new Size(180, 42); CustoName.TabIndex = 159; // // CustoNo // CustoNo.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134); - CustoNo.Location = new Point(117, 16); + CustoNo.Location = new Point(98, 16); CustoNo.Name = "CustoNo"; CustoNo.PlaceholderText = ""; CustoNo.ReadOnly = true; - CustoNo.Size = new Size(143, 42); + CustoNo.Size = new Size(180, 42); CustoNo.TabIndex = 158; // // btnBalance @@ -438,11 +438,12 @@ // txtReceipts // txtReceipts.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134); - txtReceipts.Location = new Point(506, 327); + txtReceipts.HandCursor = Cursors.IBeam; + txtReceipts.Location = new Point(508, 424); txtReceipts.Name = "txtReceipts"; txtReceipts.PlaceholderText = ""; txtReceipts.Radius = 0; - txtReceipts.Size = new Size(99, 33); + txtReceipts.Size = new Size(97, 29); txtReceipts.TabIndex = 156; txtReceipts.TextChanged += txtReceipts_TextChanged; // diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckOutForm.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckOutForm.cs index 18755e5..656bd32 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckOutForm.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmCheckOutForm.cs @@ -24,10 +24,8 @@ using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; -using jvncorelib.CodeLib; -using jvncorelib.EntityLib; +using EOM.TSHotelManagement.Shared; using Sunny.UI; -using System.Transactions; namespace EOM.TSHotelManagement.FormUI { @@ -165,7 +163,7 @@ namespace EOM.TSHotelManagement.FormUI txtCustomerGender.Text = customer?.Source.GenderName ?? string.Empty; txtCustomerType.Text = customer.Source.CustomerTypeName; txtPassportName.Text = customer.Source.PassportName; - txtDateOfBirth.Text = Convert.ToString(customer.Source.DateOfBirth); + txtDateOfBirth.Text = customer.Source.DateOfBirth.ToString("yyyy/MM/dd"); txtIdCardNumber.Text = customer.Source.IdCardNumber; txtCustomerAddress.Text = customer.Source.CustomerAddress; } @@ -212,7 +210,7 @@ namespace EOM.TSHotelManagement.FormUI var customerType = lstSourceGrid.SingleOrDefault(a => a.CustomerTypeName == txtCustomerType.Text); //计算消费总额 - dic = new Dictionary() + dic = new Dictionary() { { nameof(ReadSpendInputDto.RoomNumber), txtRoomNo.Text.Trim() }, { nameof(ReadSpendInputDto.CustomerNumber), txtCustomerNumber.Text.Trim() }, @@ -226,20 +224,13 @@ namespace EOM.TSHotelManagement.FormUI } decimal total = response.Source.ConsumptionAmount; decimal m = total + sum; - if (!customerType.IsNullOrEmpty() && customerType.Discount != 0) - { - lblGetReceipts.Text = m.ToString("#,##0.00"); - lblVIPPrice.Text = (m * customerType.Discount).ToString("#,##0.00"); - lblVIP.Text = customerType.Discount.ToZheString(); - Refresh(); - } - else - { - lblGetReceipts.Text = m.ToString("#,##0.00"); - lblVIPPrice.Text = m.ToString("#,##0.00"); - lblVIP.Text = "折扣未配置或无折扣"; - Refresh(); - } + 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) ? DiscountConverter.ToZheString(customerType.Discount) : "无折扣(100%)"; + Refresh(); } #endregion diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmCustomerManagement.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmCustomerManagement.cs index 259cd11..7d6c859 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmCustomerManagement.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmCustomerManagement.cs @@ -25,23 +25,27 @@ using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; using Sunny.UI; +using System.Runtime.InteropServices; namespace EOM.TSHotelManagement.FormUI { public partial class FrmCustomerManager : Form { + public static int cm_CustoId; public static string cm_CustoNo; public static string cm_CustoName; public static int cm_CustoSex; public static string cm_CustoTel; public static int cm_PassportType; - public static string cm_CustoID; + public static string cm_CustoIdCardNumber; public static string cm_CustoAddress; public static DateTime cm_CustoBirth; public static int cm_CustoType; public delegate void ReloadCustomerList(bool onlyVip); + [DllImport("user32.dll", SetLastError = true)] + private static extern IntPtr SetClipboardData(uint uFormat, IntPtr hMem); //定义委托类型的变量 public static ReloadCustomerList ReloadCustomer; @@ -170,15 +174,16 @@ namespace EOM.TSHotelManagement.FormUI AntdUI.Message.error(this, "未选中客户,无法继续操作!"); return; } - cm_CustoNo = cm_CustoNo; - cm_CustoName = cm_CustoName; - cm_CustoAddress = cm_CustoAddress.IsNullOrEmpty() ? "" : cm_CustoAddress.ToString(); - cm_CustoType = Convert.ToInt32(cm_CustoType); - cm_CustoSex = Convert.ToInt32(cm_CustoSex); - cm_PassportType = Convert.ToInt32(cm_PassportType); - cm_CustoBirth = Convert.ToDateTime(cm_CustoBirth); - cm_CustoID = cm_CustoID; - cm_CustoTel = cm_CustoTel; + //cm_CustoId = cm_CustoId; + //cm_CustoNo = cm_CustoNo; + //cm_CustoName = cm_CustoName; + //cm_CustoAddress = cm_CustoAddress.IsNullOrEmpty() ? "" : cm_CustoAddress.ToString(); + //cm_CustoType = Convert.ToInt32(cm_CustoType); + //cm_CustoSex = Convert.ToInt32(cm_CustoSex); + //cm_PassportType = Convert.ToInt32(cm_PassportType); + //cm_CustoBirth = Convert.ToDateTime(cm_CustoBirth); + //cm_CustoID = cm_CustoID; + //cm_CustoTel = cm_CustoTel; FrmEditInputs frmInputs = new FrmEditInputs(); frmInputs.Text = "修改客户信息"; frmInputs.ShowDialog(); @@ -188,7 +193,7 @@ namespace EOM.TSHotelManagement.FormUI { if (!cm_CustoNo.IsNullOrEmpty()) { - Clipboard.SetText(cm_CustoNo); + ClipboardHelper.SetTextToClipboard(cm_CustoNo); AntdUI.Message.success(this, "复制完成!"); } } @@ -197,6 +202,7 @@ namespace EOM.TSHotelManagement.FormUI { if (e.Record is IList data) { + cm_CustoId = Convert.ToInt32(helper.GetValue(data, nameof(ReadCustomerOutputDto.Id))); cm_CustoNo = helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerNumber)); cm_CustoName = helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerName)); cm_CustoSex = Convert.ToInt32(helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerGender))); @@ -204,7 +210,7 @@ namespace EOM.TSHotelManagement.FormUI cm_CustoBirth = Convert.ToDateTime(helper.GetValue(data, nameof(ReadCustomerOutputDto.DateOfBirth))); cm_CustoType = Convert.ToInt32(helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerType))); cm_PassportType = Convert.ToInt32(helper.GetValue(data, nameof(ReadCustomerOutputDto.PassportId))); - cm_CustoID = helper.GetValue(data, nameof(ReadCustomerOutputDto.IdCardNumber)); + cm_CustoIdCardNumber = helper.GetValue(data, nameof(ReadCustomerOutputDto.IdCardNumber)); cm_CustoAddress = helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerAddress)); btnUpdCustomer.Enabled = true; } @@ -232,6 +238,7 @@ namespace EOM.TSHotelManagement.FormUI { if (e.Record is IList data) { + cm_CustoId = Convert.ToInt32(helper.GetValue(data, nameof(ReadCustomerOutputDto.Id))); cm_CustoNo = helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerNumber)); cm_CustoName = helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerName)); cm_CustoSex = Convert.ToInt32(helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerGender))); @@ -239,7 +246,7 @@ namespace EOM.TSHotelManagement.FormUI cm_CustoBirth = Convert.ToDateTime(helper.GetValue(data, nameof(ReadCustomerOutputDto.DateOfBirth))); cm_CustoType = Convert.ToInt32(helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerType))); cm_PassportType = Convert.ToInt32(helper.GetValue(data, nameof(ReadCustomerOutputDto.PassportId))); - cm_CustoID = helper.GetValue(data, nameof(ReadCustomerOutputDto.IdCardNumber)); + cm_CustoIdCardNumber = helper.GetValue(data, nameof(ReadCustomerOutputDto.IdCardNumber)); cm_CustoAddress = helper.GetValue(data, nameof(ReadCustomerOutputDto.CustomerAddress)); FrmEditInputs frmInputs = new FrmEditInputs(_loadingProgress); diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmEditInputs.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmEditInputs.cs index 26fbfe1..7d104ad 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmEditInputs.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmEditInputs.cs @@ -106,7 +106,7 @@ namespace EOM.TSHotelManagement.FormUI cbSex.SelectedValue = FrmCustomerManager.cm_CustoSex; cbPassportType.SelectedValue = FrmCustomerManager.cm_PassportType; dtpBirthday.Value = FrmCustomerManager.cm_CustoBirth; - txtCardID.Text = FrmCustomerManager.cm_CustoID; + txtCardID.Text = FrmCustomerManager.cm_CustoIdCardNumber; txtCustoAdress.Text = FrmCustomerManager.cm_CustoAddress; txtTel.Text = FrmCustomerManager.cm_CustoTel; btnOK.Text = "修改"; @@ -128,6 +128,7 @@ namespace EOM.TSHotelManagement.FormUI { UpdateCustomerInputDto custo = new UpdateCustomerInputDto() { + Id = FrmCustomerManager.cm_CustoId, CustomerNumber = txtCustoNo.Text, CustomerName = txtCustoName.Text, CustomerGender = Convert.ToInt32(cbSex.SelectedValue.ToString()), diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmReserList.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmReserList.cs index 01f0097..5891c70 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmReserList.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmReserList.cs @@ -23,11 +23,8 @@ */ using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; -using EOM.TSHotelManagement.Common.Core; -using EOM.TSHotelManagement.Shared; using jvncorelib.CodeLib; using Sunny.UI; -using System.Transactions; namespace EOM.TSHotelManagement.FormUI { @@ -179,69 +176,38 @@ namespace EOM.TSHotelManagement.FormUI private void btnSelect_Click(object sender, EventArgs e) { - using (TransactionScope scope = new TransactionScope()) + var reser = new CheckinRoomByReservationDto { - var custo = new CreateCustomerInputDto() - { - CustomerNumber = txtCustoNo.Text.Trim(), - CustomerName = txtCustoName.Text.Trim(), - CustomerGender = Convert.ToInt32(cbSex.SelectedValue.ToString()), - CustomerPhoneNumber = txtTel.Text.Trim(), - PassportId = Convert.ToInt32(cbPassportType.SelectedValue.ToString()), - IdCardNumber = txtCardID.Text.Trim(), - CustomerAddress = txtCustoAdress.Text.Trim(), - DateOfBirth = dtpBirthday.Value, - CustomerType = Convert.ToInt32(cbCustoType.SelectedValue.ToString()), - IsDelete = 0, - DataInsUsr = LoginInfo.WorkerNo, - DataInsDate = DateTime.Now, - }; - result = HttpHelper.Request(ApiConstants.Customer_InsertCustomerInfo, HttpHelper.ModelToJson(custo)); - var response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Customer_InsertCustomerInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - - UpdateRoomInputDto r = new UpdateRoomInputDto() - { - LastCheckInTime = DateOnly.FromDateTime(DateTime.Now), - CustomerNumber = custo.CustomerNumber, - RoomStateId = new EnumHelper().GetEnumValue(RoomState.Occupied), - RoomNumber = RoomNumber, - DataChgDate = DateTime.Now, - DataChgUsr = LoginInfo.WorkerNo - }; - result = HttpHelper.Request(ApiConstants.Room_UpdateRoomInfo, HttpHelper.ModelToJson(r)); - response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Room_UpdateRoomInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - var reser = new DeleteReserInputDto - { - ReservationId = ReservationId, - IsDelete = 1, - DataChgUsr = LoginInfo.WorkerNo, - DataChgDate = DateTime.Now - }; - result = HttpHelper.Request(ApiConstants.Reser_DeleteReserInfo, HttpHelper.ModelToJson(reser)); - response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Reser_DeleteReserInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - - UIMessageBox.ShowSuccess("操作成功"); - LoadReserData(); - FrmRoomManager.Reload(""); - FrmRoomManager._RefreshRoomCount(); - scope.Complete(); - this.Close(); + ReservationId = ReservationId, + RoomNumber = RoomNumber, + CustomerNumber = txtCustoNo.Text.Trim(), + CustomerName = txtCustoName.Text.Trim(), + CustomerType = Convert.ToInt32(cbCustoType.SelectedValue), + CustomerPhoneNumber = txtTel.Text.Trim(), + CustomerAddress = txtCustoAdress.Text.Trim(), + IdCardNumber = txtCardID.Text.Trim(), + PassportId = Convert.ToInt32(cbPassportType.SelectedValue), + CustomerGender = Convert.ToInt32(cbSex.SelectedValue), + DateOfBirth = DateOnly.FromDateTime(dtpBirthday.Value), + IsDelete = 0, + DataInsUsr = LoginInfo.WorkerNo, + DataChgUsr = LoginInfo.WorkerNo, + DataInsDate = DateTime.Now, + DataChgDate = DateTime.Now + }; + result = HttpHelper.Request(ApiConstants.Room_CheckinRoomByReservation, HttpHelper.ModelToJson(reser)); + var response = HttpHelper.JsonToModel(result.message); + if (response.StatusCode != StatusCodeConstants.Success) + { + UIMessageBox.ShowError($"{ApiConstants.Room_CheckinRoomByReservation}+接口服务异常,请提交Issue或尝试更新版本!"); + return; } + + UIMessageBox.ShowSuccess("操作成功"); + LoadReserData(); + FrmRoomManager.Reload(""); + FrmRoomManager._RefreshRoomCount(); + this.Close(); } private void txtCardID_Validated(object sender, EventArgs e) diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmRoomManagement.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmRoomManagement.cs index a1a1627..242e610 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmRoomManagement.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmRoomManagement.cs @@ -281,7 +281,8 @@ namespace EOM.TSHotelManagement.FormUI lblRoomNo.Text = ucRoom.co_RoomNo; lblCustoName.Text = ucRoom.co_CustoName; lblRoomPosition.Text = ucRoom.co_RoomPosition; - lblCheckTime.Text = ucRoom.co_CheckTime == null ? "" : Convert.ToDateTime(ucRoom.co_CheckTime).ToString("yyyy-MM-dd"); + lblCheckTime.Text = ucRoom.co_CheckTime == null || ucRoom.co_CheckTime == new DateTime(1900, 1, 1) ? "" + : Convert.ToDateTime(ucRoom.co_CheckTime).ToString("yyyy-MM-dd"); lblRoomState.Text = ucRoom.co_RoomState; } diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmSellThing.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmSellThing.cs index 9ffd387..707520a 100644 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmSellThing.cs +++ b/EOM.TSHotelManagement.FormUI/AppFunction/FrmSellThing.cs @@ -26,7 +26,6 @@ using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using EOM.TSHotelManagement.Shared; -using jvncorelib.CodeLib; using jvncorelib.EntityLib; using Sunny.UI; using System.Transactions; @@ -226,188 +225,37 @@ namespace EOM.TSHotelManagement.FormUI UIMessageBox.Show("请输入消费数量!", "提示信息", UIStyle.Red); return; } - if (lblState.Text == "该房间可消费")//判断房间编号是否可消费 + if (lblState.Text == "该房间可消费") { - if (CheckInput()) + if (!CheckInput()) return; + + try { - dic = new Dictionary() + var result = HttpHelper.Request(ApiConstants.Spend_AddCustomerSpend, HttpHelper.ModelToJson(new AddCustomerSpendInputDto { - { nameof(ReadSellThingInputDto.ProductNumber) , txtSellNo.Text.Trim()} - }; - result = HttpHelper.Request(ApiConstants.Sellthing_SelectSellThingAll, dic); - var sellthings = HttpHelper.JsonToModel>(result.message); - if (sellthings.StatusCode != StatusCodeConstants.Success) + 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 response = HttpHelper.JsonToModel(result.message!); + if (response.StatusCode != StatusCodeConstants.Success) { - UIMessageBox.ShowError($"{ApiConstants.Sellthing_SelectSellThingAll}+接口服务异常,请提交Issue或尝试更新版本!"); + UIMessageBox.ShowError(response.Message ?? "添加消费记录失败"); return; } - List st = sellthings.listSource; - dic = new Dictionary() - { - { nameof(ReadRoomInputDto.RoomNumber) , txtRoomNo.Text.Trim()} - }; - result = HttpHelper.Request(ApiConstants.Room_SelectRoomByRoomNo, dic); - var room = HttpHelper.JsonToModel>(result.message); - if (room.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Room_SelectRoomByRoomNo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - r = room.Source; - dic = new Dictionary() - { - { nameof(ReadSpendInputDto.RoomNumber) , txtRoomNo.Text.Trim() }, - { nameof(ReadSpendInputDto.IsDelete) , "0" }, - { nameof(ReadSpendInputDto.IgnorePaging) , "true" } - }; - result = HttpHelper.Request(ApiConstants.Spend_SelectSpendByRoomNo, dic); - var spends = HttpHelper.JsonToModel>(result.message); - if (spends.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Spend_SelectSpendByRoomNo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - var listSource = spends.listSource; - if (!listSource.IsNullOrEmpty()) - { - var sellthing = listSource.SingleOrDefault(a => a.ProductNumber.Equals(txtSellNo.Text)); - if (!sellthing.IsNullOrEmpty()) - { - using (TransactionScope scope = new TransactionScope()) - { - var updateSpend = new UpdateSpendInputDto() - { - SpendNumber = sellthing.SpendNumber, - RoomNumber = txtRoomNo.Text, - ProductName = txtSellName.Text, - ConsumptionQuantity = (int)nudNum.Value + sellthing.ConsumptionQuantity, - CustomerNumber = r.CustomerNumber, - ProductPrice = Convert.ToDecimal(txtPrice.Text), - ConsumptionAmount = Convert.ToDecimal(Convert.ToDouble(txtPrice.Text) * nudNum.Value) + sellthing.ConsumptionAmount, - ConsumptionTime = Convert.ToDateTime(Convert.ToDateTime(DateTime.Now).ToString("yyyy-MM-dd HH:mm:ss")), - SettlementStatus = SpendConsts.UnSettle, - IsDelete = 0, - DataChgUsr = LoginInfo.WorkerNo - }; - result = HttpHelper.Request(ApiConstants.Spend_UpdSpenInfo, HttpHelper.ModelToJson(updateSpend)); - var response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Spend_UpdSpenInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - var stock = (st.First().Stock - (decimal)nudNum.Value); - var sellThing = new UpdateSellThingInputDto { ProductName = st.First().ProductName, ProductPrice = st.First().ProductPrice, Stock = stock, ProductNumber = st.First().ProductNumber, Specification = st.First().Specification }; - result = HttpHelper.Request(ApiConstants.Sellthing_UpdateSellthingInfo, HttpHelper.ModelToJson(sellThing)); - response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Sellthing_UpdateSellthingInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - UIMessageBox.Show("添加成功", "系统提示", UIStyle.Green, UIMessageBoxButtons.OK, true); - LoadSpendInfoByRoomNo(r.RoomNumber); - LoadSellThingInfo(); - #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "帮助" + updateSpend.CustomerNumber + "进行了消费商品:" + txtSellName.Text + "操作!", Common.Core.LogLevel.Warning); - #endregion - - scope.Complete(); - } - } - else - { - using (TransactionScope scope = new TransactionScope()) - { - var insertSpend = new CreateSpendInputDto() - { - SpendNumber = new UniqueCode().GetNewId("SP-"), - RoomNumber = txtRoomNo.Text, - ProductName = txtSellName.Text, - ConsumptionQuantity = (int)nudNum.Value, - CustomerNumber = r.CustomerNumber, - ProductPrice = Convert.ToDecimal(txtPrice.Text), - ConsumptionAmount = Convert.ToDecimal(Convert.ToDouble(txtPrice.Text) * nudNum.Value), - ConsumptionTime = Convert.ToDateTime(Convert.ToDateTime(DateTime.Now).ToString("yyyy-MM-dd HH:mm:ss")), - SettlementStatus = SpendConsts.UnSettle, - DataInsUsr = LoginInfo.WorkerNo, - DataInsDate = DateTime.Now, - }; - result = HttpHelper.Request(ApiConstants.Spend_InsertSpendInfo, HttpHelper.ModelToJson(insertSpend)); - var response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Spend_InsertSpendInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - var stock = (st.First().Stock - (decimal)nudNum.Value); - var sellThing = new UpdateSellThingInputDto { ProductName = st.First().ProductName, ProductPrice = st.First().ProductPrice, Stock = stock, ProductNumber = st.First().ProductNumber, Specification = st.First().Specification }; - result = HttpHelper.Request(ApiConstants.Sellthing_UpdateSellthingInfo, HttpHelper.ModelToJson(sellThing)); - response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Sellthing_UpdateSellthingInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - UIMessageBox.Show("添加成功", "系统提示", UIStyle.Green, UIMessageBoxButtons.OK, true); - LoadSpendInfoByRoomNo(r.RoomNumber); - LoadSellThingInfo(); - #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "帮助" + insertSpend.CustomerNumber + "进行了消费商品:" + txtSellName.Text + "操作!", Common.Core.LogLevel.Warning); - #endregion - nudNum.Value = 0; - - scope.Complete(); - } - } - } - else - { - using (TransactionScope scope = new TransactionScope()) - { - var spend = new CreateSpendInputDto() - { - ProductNumber = txtSellNo.Text.Trim(), - SpendNumber = new UniqueCode().GetNewId("SP-"), - DataInsDate = DateTime.Now, - DataInsUsr = LoginInfo.WorkerNo, - RoomNumber = txtRoomNo.Text, - ProductName = txtSellName.Text, - ConsumptionQuantity = (int)nudNum.Value, - CustomerNumber = r.CustomerNumber, - ProductPrice = Convert.ToDecimal(txtPrice.Text), - ConsumptionAmount = Convert.ToDecimal(Convert.ToDouble(txtPrice.Text) * nudNum.Value), - ConsumptionTime = Convert.ToDateTime(Convert.ToDateTime(DateTime.Now).ToString("yyyy-MM-dd HH:mm:ss")), - SettlementStatus = SpendConsts.UnSettle, - }; - result = HttpHelper.Request(ApiConstants.Spend_InsertSpendInfo, HttpHelper.ModelToJson(spend)); - var response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Spend_InsertSpendInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - var stock = (st.First().Stock - (decimal)nudNum.Value); - var sellThing = new UpdateSellThingInputDto { ProductName = st.First().ProductName, ProductPrice = st.First().ProductPrice, Stock = stock, ProductNumber = st.First().ProductNumber, Specification = st.First().Specification }; - result = HttpHelper.Request(ApiConstants.Sellthing_UpdateSellthingInfo, HttpHelper.ModelToJson(sellThing)); - response = HttpHelper.JsonToModel(result.message); - if (response.StatusCode != StatusCodeConstants.Success) - { - UIMessageBox.ShowError($"{ApiConstants.Sellthing_UpdateSellthingInfo}+接口服务异常,请提交Issue或尝试更新版本!"); - return; - } - UIMessageBox.Show("添加成功", "系统提示", UIStyle.Green, UIMessageBoxButtons.OK, true); - LoadSpendInfoByRoomNo(r.RoomNumber); - LoadSellThingInfo(); - #region 获取添加操作日志所需的信息 - RecordHelper.Record(LoginInfo.WorkerNo + "-" + LoginInfo.WorkerName + "在" + Convert.ToDateTime(DateTime.Now) + "位于" + LoginInfo.SoftwareVersion + "执行:" + "帮助" + spend.CustomerNumber + "进行了消费商品:" + txtSellName.Text + "操作!", Common.Core.LogLevel.Warning); - #endregion - nudNum.Value = 0; - - scope.Complete(); - return; - } - } + UIMessageBox.Show("添加成功", "系统提示", UIStyle.Green); + + LoadSpendInfoByRoomNo(txtRoomNo.Text.Trim()); + LoadSellThingInfo(); + } + catch (Exception ex) + { + UIMessageBox.ShowError($"接口调用异常: {ex.Message}"); + return; } } } @@ -426,9 +274,9 @@ namespace EOM.TSHotelManagement.FormUI } if (!spend.IsNullOrEmpty()) { - if (spend.ProductName.Contains("居住")) + if (spend.ConsumptionType == SpendType.Room.Code || spend.ConsumptionType == SpendType.Other.Code) { - UIMessageBox.Show("此条消费记录为住房记录,无法删除!", "提示信息", UIStyle.Red); + UIMessageBox.Show($"此条消费记录非{SpendType.Product.Description}记录,无法删除!", "提示信息", UIStyle.Red); return; } if (UIMessageDialog.ShowMessageDialog("你确定要撤回该消费记录吗?", UILocalize.WarningTitle, true, Style)) @@ -494,7 +342,7 @@ namespace EOM.TSHotelManagement.FormUI UIMessageBox.Show("请选择要删除的消费记录!", "提示信息", UIStyle.Red); } } - + private void nudNum_ValueChanged(object sender, double value) { if (nudNum.Value < 0) diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.Designer.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.Designer.cs deleted file mode 100644 index 285b969..0000000 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.Designer.cs +++ /dev/null @@ -1,123 +0,0 @@ -namespace EOM.TSHotelManagement.FormUI -{ - partial class FrmUnLockSystem - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.label1 = new System.Windows.Forms.Label(); - this.txtUnLockPwd = new System.Windows.Forms.TextBox(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.btnUnLock = new Sunny.UI.UIButton(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("阿里巴巴普惠体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label1.ForeColor = System.Drawing.Color.Red; - this.label1.Location = new System.Drawing.Point(33, 22); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(432, 27); - this.label1.TabIndex = 0; - this.label1.Text = "当前系统已锁定,请输入超管密码进行解锁!"; - // - // txtUnLockPwd - // - this.txtUnLockPwd.Font = new System.Drawing.Font("阿里巴巴普惠体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtUnLockPwd.Location = new System.Drawing.Point(120, 65); - this.txtUnLockPwd.Name = "txtUnLockPwd"; - this.txtUnLockPwd.PasswordChar = '*'; - this.txtUnLockPwd.Size = new System.Drawing.Size(259, 35); - this.txtUnLockPwd.TabIndex = 1; - this.txtUnLockPwd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtUnLockPwd_KeyDown); - // - // timer1 - // - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // btnUnLock - // - this.btnUnLock.BackColor = System.Drawing.Color.Transparent; - this.btnUnLock.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnUnLock.FillColor = System.Drawing.Color.Red; - this.btnUnLock.Font = new System.Drawing.Font("微软雅黑", 12F); - this.btnUnLock.Location = new System.Drawing.Point(205, 116); - this.btnUnLock.MinimumSize = new System.Drawing.Size(1, 1); - this.btnUnLock.Name = "btnUnLock"; - this.btnUnLock.Radius = 20; - this.btnUnLock.RectColor = System.Drawing.Color.Transparent; - this.btnUnLock.RectPressColor = System.Drawing.Color.Transparent; - this.btnUnLock.RectSelectedColor = System.Drawing.Color.Transparent; - this.btnUnLock.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None; - this.btnUnLock.Size = new System.Drawing.Size(101, 40); - this.btnUnLock.Style = Sunny.UI.UIStyle.Custom; - this.btnUnLock.TabIndex = 113; - this.btnUnLock.Text = "解 锁"; - this.btnUnLock.Click += new System.EventHandler(this.btnUnLock_Click); - // - // FrmUnLockSystem - // - this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackgroundImage = global::EOM.TSHotelManagement.FormUI.Properties.Resources.jpg_auto_04N58PICPw2s58PICaP4M8cef_PIC2018_jpg_w1024_new_small; - this.ClientSize = new System.Drawing.Size(498, 179); - this.Controls.Add(this.btnUnLock); - this.Controls.Add(this.txtUnLockPwd); - this.Controls.Add(this.label1); - this.EscClose = false; - this.IsForbidAltF4 = true; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FrmUnLockSystem"; - this.Padding = new System.Windows.Forms.Padding(0); - this.RectColor = System.Drawing.Color.Transparent; - this.ShowInTaskbar = false; - this.ShowTitle = false; - this.Style = Sunny.UI.UIStyle.Custom; - this.Text = "系统已锁定!"; - this.TitleColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); - this.TopMost = true; - this.Deactivate += new System.EventHandler(this.FrmUnLockSystem_Deactivate); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmUnLockSystem_FormClosing); - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmUnLockSystem_FormClosed); - this.Load += new System.EventHandler(this.FrmUnLockSystem_Load); - this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmUnLockSystem_KeyDown); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox txtUnLockPwd; - private System.Windows.Forms.Timer timer1; - private Sunny.UI.UIButton btnUnLock; - } -} \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.cs b/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.cs deleted file mode 100644 index c7c2142..0000000 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* - * MIT License - *Copyright (c) 2021 易开元(EOM) - - *Permission is hereby granted, free of charge, to any person obtaining a copy - *of this software and associated documentation files (the "Software"), to deal - *in the Software without restriction, including without limitation the rights - *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - *copies of the Software, and to permit persons to whom the Software is - *furnished to do so, subject to the following conditions: - - *The above copyright notice and this permission notice shall be included in all - *copies or substantial portions of the Software. - - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - *SOFTWARE. - * - */ - -using EOM.TSHotelManagement.Common; -using Sunny.UI; -using System.Diagnostics; -using System.Runtime.InteropServices; - -namespace EOM.TSHotelManagement.FormUI -{ - public partial class FrmUnLockSystem : UIForm - { - - public FrmUnLockSystem() - { - InitializeComponent(); - } - - private const int SC_CLOSE = 0xF060; - - private const int MF_ENABLED = 0x00000000; - - private const int MF_GRAYED = 0x00000001; - - private const int MF_DISABLED = 0x00000002; - - - - [DllImport("user32.dll", EntryPoint = "GetSystemMenu")] - - private static extern IntPtr GetSystemMenu(IntPtr hWnd, int bRevert); - - [DllImport("User32.dll")] - - public static extern bool EnableMenuItem(IntPtr hMenu, int uIDEnableItem, int uEnable); - - private void FrmUnLockSystem_FormClosing(object sender, FormClosingEventArgs e) - { - //HookStop(); - } - - private void FrmUnLockSystem_Deactivate(object sender, EventArgs e) - { - - } - - Dictionary dic = null; - ResponseMsg result = null; - - private void btnUnLock_Click(object sender, EventArgs e) - { - - } - - - private void FrmUnLockSystem_FormClosed(object sender, FormClosedEventArgs e) - { - - } - - private void txtUnLockPwd_KeyDown(object sender, KeyEventArgs e) - { - - } - - private void FrmUnLockSystem_Load(object sender, EventArgs e) - { - //string regPath = System.Windows.Forms.Application.StartupPath + @"\禁用任务管理器.reg"; - //ExecuteReg(regPath); - //Process[] ps = Process.GetProcessesByName("TS酒店管理系统"); - //if (ps.Length < 0) - //{ - // foreach (Process p in ps) - // p.Kill(); - // FrmMain.Start(); - //} - //IntPtr hMenu = GetSystemMenu(this.Handle, 0); - //EnableMenuItem(hMenu, SC_CLOSE, MF_DISABLED | MF_GRAYED); - //FrmBackgroundSystem.hideform(); - } - - protected override CreateParams CreateParams - { - get - { - const int CS_NOCLOSE = 0x200; - CreateParams cp = base.CreateParams; - cp.ClassStyle = cp.ClassStyle | CS_NOCLOSE; - return cp; - } - - } - - protected override void WndProc(ref Message m) - { - base.WndProc(ref m); - if (m.Msg == 0x84 && m.Result == (IntPtr)2) // 不让拖动标题栏 - { - m.Result = (IntPtr)1; - } - if (m.Msg == 0xA3) // 双击标题栏无反应 - { - m.WParam = System.IntPtr.Zero; - } - } - - /// - /// 执行注册表导入 - /// - /// 注册表文件路径 - public void ExecuteReg(string regPath) - { - if (File.Exists(regPath)) - { - regPath = @"""" + regPath + @""""; - Process.Start("regedit", string.Format(" /s {0}", regPath)); - } - } - - private void FrmUnLockSystem_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.F4 && e.Modifiers == Keys.Alt) - { - UIMessageBox.Show("请输入解锁密码!", "错误", UIStyle.Red, UIMessageBoxButtons.OK); - e.Handled = true; - } - } - - private void timer1_Tick(object sender, EventArgs e) - { - - } - - private void btnUnLock_Click_1(object sender, EventArgs e) - { - - } - } -} diff --git a/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.resx b/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.resx deleted file mode 100644 index 1f666f2..0000000 --- a/EOM.TSHotelManagement.FormUI/AppFunction/FrmUnLockSystem.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.cs b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.cs index 124c1c1..5c05a95 100644 --- a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.cs +++ b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.cs @@ -125,7 +125,7 @@ namespace EOM.TSHotelManagement.FormUI downloadUrl = executableAsset.BrowserDownloadUrl; } - + DownloadAndInstallUpdate(downloadUrl, "TS酒店管理系统.exe", new Progress(ReportProgress)); lblTips.Text = "安装包正在下载中,请稍等..."; diff --git a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLogin.cs b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLogin.cs index b1efe2c..44c1ec9 100644 --- a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLogin.cs +++ b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLogin.cs @@ -125,7 +125,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 = txtWorkerPwd.Text.Trim() }; result = HttpHelper.Request(ApiConstants.Employee_SelectEmployeeInfoByEmployeeIdAndEmployeePwd, HttpHelper.ModelToJson(worker)); @@ -174,7 +174,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.Core.LogLevel.Critical); AntdUI.Modal.open(this, LocalizationHelper.GetLocalizedString("System prompt", "系统提示"), LocalizationHelper.GetLocalizedString("The server is under maintenance, please try again later", "服务器维护中,请稍后再试!"), TType.Error); } } diff --git a/EOM.TSHotelManagement.FormUI/AppMain/FrmMain.cs b/EOM.TSHotelManagement.FormUI/AppMain/FrmMain.cs index 41af63a..86e1a9d 100644 --- a/EOM.TSHotelManagement.FormUI/AppMain/FrmMain.cs +++ b/EOM.TSHotelManagement.FormUI/AppMain/FrmMain.cs @@ -29,9 +29,7 @@ using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.FormUI.Properties; using jvncorelib.CodeLib; using Sunny.UI; -using System.Diagnostics; using System.Runtime.InteropServices; -using System.Text.RegularExpressions; namespace EOM.TSHotelManagement.FormUI { diff --git a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj index 16eb163..bd1925e 100644 --- a/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj +++ b/EOM.TSHotelManagement.FormUI/EOM.TSHotelManagement.FormUI.csproj @@ -11,7 +11,7 @@ true enable true - 2.8.5.1 + 2.8.5.2 EOM.TSHotelManagement.FormUI.Program x64 TS酒店管理系统 @@ -70,9 +70,6 @@ Form - - Form - Form diff --git a/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs b/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs index 1edd0a1..8ed3030 100644 --- a/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs +++ b/EOM.TSHotelManagement.FormUI/InitConfig/Initialize.cs @@ -1,4 +1,4 @@ -using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Shared; using System.Reflection; namespace EOM.TSHotelManagement.FormUI diff --git a/README.en.md b/README.en.md index 5e7d0d9..55ad7ac 100644 --- a/README.en.md +++ b/README.en.md @@ -16,6 +16,8 @@ **Effective immediately, version numbers will follow the format x.x.x.x. First digit: program version, second: framework version, third: major updates, fourth: bug fixes. For example, version 2.0 on .NET 8 is 2.8.0.0. On .NET 9, it will be 2.9.0.0, and so on.** +**Effective immediately, this project officially enters the maintenance phase and will no longer incorporate any new features. Simultaneously, we are pleased to announce the commencement of mobile development for the TopSkyHotelManagementSystem. The repository address is: [TopSkyHotelManagementSystem-MAUI](https://gitee.com/java-and-net/topsky-hotel-management-system-maui). This project is being developed using .NET 8's MAUI framework, with initial development focused exclusively on the Android platform. Expansion to other platforms is not currently feasible.** + # :pray: Open Source Projects Referenced: 1. ##### Fody—Packs all dlls into an exe application. [Fody, MIT License](https://github.com/Fody/Fody) diff --git a/README.md b/README.md index 367541a..e89c7a0 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ **即日起,程序版本号规范将固定为x.x.x.x,第一位为当前程序版本,第二位为当前程序框架版本,第三位为功能大变更版本,第四位为日常修复版本,例如:基于.NET 8框架的2.0版本,对应的版本号是2.8.0.0,往后的.NET 9将会是2.9.0.0,并以此类推** +**即日起,该项目正式进入维护阶段,不再新增任何功能。同时,我们很高兴地宣布,TopSkyHotelManagementSystem的移动端开发工作正式启动,具体仓库地址为:[TopSkyHotelManagementSystem-MAUI](https://gitee.com/java-and-net/topsky-hotel-management-system-maui),该项目基于.NET 8的MAUI进行开发,目前仅考虑安卓端,其他暂不具备条件。** + # :pray: 引用的开源项目: 1. ##### Fody——将所有dll打包成exe应用程序。[Fody,MIT开源协议](https://github.com/Fody/Fody) diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api index 608cd09..20e08de 160000 --- a/topsky-hotel-management-system-web-api +++ b/topsky-hotel-management-system-web-api @@ -1 +1 @@ -Subproject commit 608cd097595d1ed1a8f2bade89d19dad8294b001 +Subproject commit 20e08de2a26934c32f12d062536c08b891c06e7f -- Gitee From 66ebcb5dc8efd381bdddc2aeac323a41256d2408 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sat, 14 Jun 2025 03:37:37 +0800 Subject: [PATCH 5/9] add submodule. --- topsky-hotel-management-system-web-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api index 20e08de..0970e9f 160000 --- a/topsky-hotel-management-system-web-api +++ b/topsky-hotel-management-system-web-api @@ -1 +1 @@ -Subproject commit 20e08de2a26934c32f12d062536c08b891c06e7f +Subproject commit 0970e9f42194186d92d370e62f328d244fb84dc1 -- Gitee From 9fa7b27ed74ba7d9bfb14201ea33f2c1149a1cd5 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sun, 6 Jul 2025 06:12:55 +0000 Subject: [PATCH 6/9] add muiltple platform code Repository collection Table add muiltple platform code Repository collection Table Signed-off-by: ck_yeun9 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 705d56d..fb8ce6c 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,14 @@ EOM.Client.TopskyHotelManagementSystem | (前台)用户管理 | 用户信息展示 | 搜索用户信息 | 添加客户 | | | | | (前台)商品消费 | 商品列表 | 搜索商品信息 | 商品消费 | 消费信息 | | | +# :books: 多平台代码仓库汇总: + +| 平台 | 仓库地址 | 仓库简介 | 开源协议 | 依赖项目 | +|-----|--------------------------------------------------------------------|------------------------------------------|-------------|-------------| +| PC端 | https://gitee.com/java-and-net/TopskyHotelManagementSystem | 基于Net8 WinForm平台开发(无业务逻辑),针对中小型酒店设计的管理系统 | [MIT License](https://gitee.com/java-and-net/TopskyHotelManagementSystem/blob/master/LICENSE) | [WebApi](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api)| +| 网页端 | https://gitee.com/java-and-net/topsky-hotel-management-system-vue3 | 基于Vue3开发的针对中小型酒店设计的管理系统 | [MIT License](https://gitee.com/java-and-net/topsky-hotel-management-system-vue3/blob/Main/LICENSE) | [WebApi](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api) | +| 安卓端 | https://gitee.com/java-and-net/topsky-hotel-management-system-maui | 基于Net8 MAUI平台开发的移动端项目 | [MIT License](https://gitee.com/java-and-net/topsky-hotel-management-system-maui/blob/Main/LICENSE) | [WebApi](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api) | +| 服务端 | https://gitee.com/java-and-net/topsky-hotel-management-system-web-api | 基于.Net8搭配SQLSugar框架构建的TS酒店管理系统后端API项目,主要服务于Client、Web、Android端 | [MIT License](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api/blob/master/LICENSE) | # :family: 项目作者: -- Gitee From c0e8f05663b2c309de663ca84de2eb1401e0586e Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sun, 6 Jul 2025 06:21:14 +0000 Subject: [PATCH 7/9] add muiltple platform code Repository collection Table add muiltple platform code Repository collection Table Signed-off-by: ck_yeun9 --- README.en.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.en.md b/README.en.md index 55ad7ac..8bc326e 100644 --- a/README.en.md +++ b/README.en.md @@ -114,6 +114,14 @@ EOM.Client.TopSkyHotelManagerSystem | (Front Desk) Customer Management | Display Customer Info | Search Customer Info | Add Customer | | | | | (Front Desk) Product Consumption | Product List | Search Product Info | Product Consumption | Consumption Info | | | +# :books: Summary of Multi-Platform Code Repositories: +| Platform | Repository URL | Repository Description | License | Dependency | +|----------|-----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|-------------|------------| +| PC | https://gitee.com/java-and-net/TopskyHotelManagementSystem | .NET 8 WinForm-based solution (UI layer without business logic) designed for small/medium-sized hotel management systems | [MIT License](https://gitee.com/java-and-net/TopskyHotelManagementSystem/blob/master/LICENSE) | [WebApi](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api) | +| Web | https://gitee.com/java-and-net/topsky-hotel-management-system-vue3 | Vue 3-based frontend designed for small/medium-sized hotel management systems | [MIT License](https://gitee.com/java-and-net/topsky-hotel-management-system-vue3/blob/Main/LICENSE) | [WebApi](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api) | +| Android | https://gitee.com/java-and-net/topsky-hotel-management-system-maui | .NET 8 MAUI-based mobile application project | [MIT License](https://gitee.com/java-and-net/topsky-hotel-management-system-maui/blob/Main/LICENSE) | [WebApi](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api) | +| Backend | https://gitee.com/java-and-net/topsky-hotel-management-system-web-api | .NET 8 backend API project for TS Hotel Management System built with SQLSugar ORM, serving PC/Web/Android clients | [MIT License](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api/blob/master/LICENSE) | | + # :family: Project Authors: **Original Team: Jackson, Benjamin, Bin, Jonathan** -- Gitee From 45f20a519d0094eec7a98862e416b0cde5d7e228 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sun, 13 Jul 2025 15:36:13 +0800 Subject: [PATCH 8/9] remove no use controllers. add customer account controllers. update JWTHelper. Rename Folder Name. update dataprotectionhelper. update checkupdate function. --- .../BackendApi/ApiConstants.cs | 4 +- .../AppInterface/FrmLoading.Designer.cs | 2 + .../AppInterface/FrmLoading.cs | 53 +++++++++++++------ .../AppInterface/FrmLoading.resx | 3 ++ README.en.md | 2 +- README.md | 2 +- 6 files changed, 45 insertions(+), 21 deletions(-) diff --git a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs b/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs index 8f93a08..03ae1bf 100644 --- a/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs +++ b/EOM.TSHotelManagement.Common/BackendApi/ApiConstants.cs @@ -3,7 +3,6 @@ public static class ApiConstants { // Base URLs - public const string Base_GetBase = "Base/GetBase"; public const string Base_SelectNationAll = "Base/SelectNationAll"; public const string Base_SelectGenderTypeAll = "Base/SelectGenderTypeAll"; public const string Base_SelectDeptAllCanUse = "Base/SelectDeptAllCanUse"; @@ -73,11 +72,10 @@ public const string Spend_SumConsumptionAmount = "Spend/SumConsumptionAmount"; public const string Spend_UpdateMoneyState = "Spend/UpdateMoneyState"; public const string Spend_UpdateSpendInfoByRoomNo = "Spend​/UpdateSpendInfoByRoomNo"; - public const string Spend_InsertSpendInfo = "Spend​/InsertSpendInfo"; + public const string Spend_AddCustomerSpend = "Spend​/AddCustomerSpend"; public const string Spend_SeletHistorySpendInfoAll = "Spend/SeletHistorySpendInfoAll"; public const string Spend_UpdSpenInfo = "Spend/UpdSpenInfo"; public const string Spend_UndoCustomerSpend = "Spend/UndoCustomerSpend"; - public const string Spend_AddCustomerSpend = "Spend/AddCustomerSpend"; // EnergyManagement URLs public const string EnergyManagement_SelectEnergyManagementInfo = "EnergyManagement/SelectEnergyManagementInfo"; diff --git a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.Designer.cs b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.Designer.cs index 456035f..6c377c0 100644 --- a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.Designer.cs +++ b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.Designer.cs @@ -35,6 +35,7 @@ label1 = new AntdUI.Label(); label3 = new AntdUI.Label(); lblReleaseLog = new AntdUI.Input(); + fbdSavePath = new FolderBrowserDialog(); SuspendLayout(); // // lblTips @@ -136,5 +137,6 @@ private AntdUI.Label label1; private AntdUI.Label label3; private AntdUI.Input lblReleaseLog; + private FolderBrowserDialog fbdSavePath; } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.cs b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.cs index 5c05a95..2152b22 100644 --- a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.cs +++ b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.cs @@ -32,12 +32,11 @@ namespace EOM.TSHotelManagement.FormUI public partial class FrmLoading : Window { private string CurrentVersion => ApplicationUtil.GetApplicationVersion().ToString(); - 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 FileName { get; set; } - private string CurrentExecutablePath => Application.ExecutablePath; - private string CurrentExecutableName => Path.GetFileName(CurrentExecutablePath); - 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 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 ProgressBar progressBar; @@ -122,12 +121,12 @@ namespace EOM.TSHotelManagement.FormUI if (executableAsset == null) return; - downloadUrl = executableAsset.BrowserDownloadUrl; + downloadUrl = $"{GithubProxyUrl}/{executableAsset.BrowserDownloadUrl}"; } - DownloadAndInstallUpdate(downloadUrl, "TS酒店管理系统.exe", new Progress(ReportProgress)); + DownloadAndInstallUpdate(downloadUrl, "TS酒店管理系统.exe", new Progress(ReportProgress), version); lblTips.Text = "安装包正在下载中,请稍等..."; } @@ -146,13 +145,34 @@ namespace EOM.TSHotelManagement.FormUI return userAgent ?? string.Empty; } - private async Task DownloadAndInstallUpdate(string downloadUrl, string fileName, IProgress progress) + private async Task DownloadAndInstallUpdate(string downloadUrl, string fileName, IProgress progress, string tagName) { try { - using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(10) }; - var tempFilePath = Path.Combine(Path.GetTempPath(), fileName); + lblTips.Text = "正在选择保存路径..."; + fbdSavePath.UseDescriptionForTitle = true; + fbdSavePath.Description = "请选择保存安装包的位置"; + fbdSavePath.RootFolder = Environment.SpecialFolder.Desktop; + fbdSavePath.ShowNewFolderButton = true; + + if (fbdSavePath.ShowDialog() != DialogResult.OK) + { + lblTips.Text = "下载已取消,将自动退出程序"; + Thread.Sleep(2000); + ExitApplication(); + return false; + } + + string selectedPath = fbdSavePath.SelectedPath; + + string targetDirectory = Path.Combine(selectedPath, FolderName, tagName); + if(!Path.Exists(targetDirectory)) + Directory.CreateDirectory(targetDirectory); + + var tempFilePath = Path.Combine(targetDirectory, fileName); + + using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(10) }; var response = await client.GetAsync(downloadUrl, HttpCompletionOption.ResponseHeadersRead); var contentLength = response.Content.Headers.ContentLength; @@ -163,9 +183,8 @@ namespace EOM.TSHotelManagement.FormUI var buffer = new byte[8192]; int bytesRead; - AntdUI.Modal.open(this, "下载提示", - $"已开始下载,请稍等。\n文件名称: {fileName}", - TType.Info); + lblTips.Text = "正在下载..."; + this.Refresh(); while ((bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length)) > 0) { @@ -176,6 +195,9 @@ namespace EOM.TSHotelManagement.FormUI { var progressPercentage = (double)totalBytesRead / contentLength.Value * 100; progress.Report(progressPercentage); + + lblTips.Text = $"下载中... {progressPercentage:F1}%"; + this.Refresh(); } } @@ -188,7 +210,6 @@ namespace EOM.TSHotelManagement.FormUI }); ExitApplication(); - return true; } catch (OperationCanceledException) @@ -234,7 +255,7 @@ namespace EOM.TSHotelManagement.FormUI private void FrmLoading_Load(object sender, EventArgs e) { - lblLocalSoftwareVersion.Text = ApplicationUtil.GetApplicationVersion().ToString(); + lblLocalSoftwareVersion.Text = CurrentVersion; CheckForUpdate(); } diff --git a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.resx b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.resx index 8b2ff64..14fe195 100644 --- a/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.resx +++ b/EOM.TSHotelManagement.FormUI/AppInterface/FrmLoading.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/README.en.md b/README.en.md index 55ad7ac..45278fb 100644 --- a/README.en.md +++ b/README.en.md @@ -26,7 +26,7 @@ 3. ##### SunnyUI—SunnyUI.Net, based on C# .Net WinForm open-source control library, tool library, extension library, and multi-page development framework. [SunnyUI.Net, GPL3.0 License](https://gitee.com/yhuse/SunnyUI) -4. ##### RestSharp——Simple REST and HTTP API Client for .NET。[RestSharp,Apache-2.0 License](https://github.com/restsharp/RestSharp) +4. ##### **RestSharp——Simple REST and HTTP API Client for .NET。[RestSharp,Apache-2.0 License](https://github.com/restsharp/RestSharp)** 5. ##### AntdUI——基于 Ant Design 设计语言的 Winform 界面库. AntdUI。[AntdUI,Apache-2.0 License](https://gitee.com/antdui/AntdUI) diff --git a/README.md b/README.md index 705d56d..9bdb3dc 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ 3. ##### SunnyUI——SunnyUI.Net, 基于 C# .Net WinForm 开源控件库、工具类库、扩展类库、多页面开发框架。[SunnyUI.Net,GPL3.0开源协议](https://gitee.com/yhuse/SunnyUI) -4. ##### RestSharp——Simple REST and HTTP API Client for .NET。[RestSharp,Apache-2.0开源协议](https://github.com/restsharp/RestSharp) +4. ##### **RestSharp——Simple REST and HTTP API Client for .NET。[RestSharp,Apache-2.0开源协议](https://github.com/restsharp/RestSharp)** 5. ##### AntdUI——👚 基于 Ant Design 设计语言的 Winform 界面库。[AntdUI,Apache-2.0开源协议](https://gitee.com/antdui/AntdUI) -- Gitee From 3288b545ee768378512c9f941212f1b4d11eb9c9 Mon Sep 17 00:00:00 2001 From: ck_yeun9 Date: Sun, 13 Jul 2025 15:36:27 +0800 Subject: [PATCH 9/9] remove no use controllers. add customer account controllers. update JWTHelper. Rename Folder Name. update dataprotectionhelper. update checkupdate function. --- topsky-hotel-management-system-web-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topsky-hotel-management-system-web-api b/topsky-hotel-management-system-web-api index 0970e9f..0cb2d1a 160000 --- a/topsky-hotel-management-system-web-api +++ b/topsky-hotel-management-system-web-api @@ -1 +1 @@ -Subproject commit 0970e9f42194186d92d370e62f328d244fb84dc1 +Subproject commit 0cb2d1a9f09d594f2829f73bd05c92c2c9eff075 -- Gitee