搜尋身份證號, 電話功能選項

This commit is contained in:
2025-12-26 01:46:07 +08:00
parent 2d3fb23c7b
commit c2a3c0e5bf
16 changed files with 528 additions and 154 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
@@ -9,4 +10,19 @@ using System.Web;
public static class GlobalVariables
{
// FNumberLock 已移除,因為改用資料庫直接取號,不再需要 Application 狀態鎖定
/// <summary>
/// 是否啟用 search_keywords 搜尋功能
/// </summary>
public static bool UseSearchKeywords
{
get
{
string configValue = ConfigurationManager.AppSettings["UseSearchKeywords"];
if (string.IsNullOrEmpty(configValue))
return false;
return configValue.Equals("true", StringComparison.OrdinalIgnoreCase);
}
}
}

View File

@@ -81,7 +81,6 @@ namespace Model
public virtual DbSet<ShuWen> ShuWen { get; set; }
public virtual DbSet<transfer_register> transfer_register { get; set; }
public virtual DbSet<GuaDanOrder> GuaDanOrder { get; set; }
public virtual DbSet<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
public virtual DbSet<GuadanTimeSetting> GuadanTimeSetting { get; set; }
public virtual DbSet<Region> Region { get; set; }
public virtual DbSet<RegionAndRoomAndBedSchedule> RegionAndRoomAndBedSchedule { get; set; }
@@ -94,6 +93,7 @@ namespace Model
public virtual DbSet<AncestralTabletPositionRecord> AncestralTabletPositionRecord { get; set; }
public virtual DbSet<AncestralTabletRegistrant> AncestralTabletRegistrant { get; set; }
public virtual DbSet<AncestralTabletStatus> AncestralTabletStatus { get; set; }
public virtual DbSet<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
public virtual int pager_eztrust(Nullable<int> startRowIndex, Nullable<int> pageSize, string tableName, string columnName, string sqlWhere, string orderBy, ObjectParameter rowCount)
{

View File

@@ -1,4 +1,4 @@
// 已啟用模型 'D:\17168erp_new_git\17168ERP\web\App_Code\Model\Model.edmx' 的 T4 程式碼產生。
// 已啟用模型 'D:\dev\ez\17168erp\git_17888\web\App_Code\Model\Model.edmx' 的 T4 程式碼產生。
// 若要啟用舊版程式碼產生,請將 [程式碼產生策略] 設計工具屬性的值
//變更為 [舊版 ObjectContext]。當模型在設計工具中開啟時,這個屬性便可
//以在 [屬性] 視窗中使用。

View File

@@ -936,6 +936,7 @@ namespace Model
public string country { get; set; }
public Nullable<int> appellation_id { get; set; }
public string follower_hash { get; set; }
public string search_keywords { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<activity_check> activity_check { get; set; }
@@ -1042,12 +1043,12 @@ namespace Model
public Nullable<System.Guid> OrderUuid { get; set; }
public virtual follower followers { get; set; }
public virtual GuaDanOrder GuaDanOrder { get; set; }
public virtual RegionRoomBed RegionRoomBed { get; set; }
public virtual Room Room { get; set; }
public virtual RegionRoomBedStatus RegionRoomBedStatus { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<RegionAndRoomAndBedSchedule> RegionAndRoomAndBedSchedule { get; set; }
public virtual GuaDanOrder GuaDanOrder { get; set; }
}
}
namespace Model
@@ -1573,10 +1574,10 @@ namespace Model
public System.Guid RoomUuid { get; set; }
public string StatusCode { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
public virtual Room Room { get; set; }
public virtual RegionRoomBedStatus RegionRoomBedStatus { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
}
}
namespace Model
@@ -1589,8 +1590,8 @@ namespace Model
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public RegionRoomBedStatus()
{
this.GuaDanOrderGuest = new HashSet<GuaDanOrderGuest>();
this.RegionRoomBed = new HashSet<RegionRoomBed>();
this.GuaDanOrderGuest = new HashSet<GuaDanOrderGuest>();
}
public string Code { get; set; }
@@ -1599,10 +1600,10 @@ namespace Model
public Nullable<int> Category { get; set; }
public bool IsDeleted { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<RegionRoomBed> RegionRoomBed { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
}
}
namespace Model
@@ -1639,8 +1640,8 @@ namespace Model
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Room()
{
this.GuaDanOrderGuest = new HashSet<GuaDanOrderGuest>();
this.RegionRoomBed = new HashSet<RegionRoomBed>();
this.GuaDanOrderGuest = new HashSet<GuaDanOrderGuest>();
}
public string Name { get; set; }
@@ -1653,11 +1654,11 @@ namespace Model
public System.Guid Uuid { get; set; }
public System.Guid RegionUuid { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
public virtual Region Region { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<RegionRoomBed> RegionRoomBed { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
}
}
namespace Model

View File

@@ -480,6 +480,7 @@
<Property Name="country" Type="nvarchar" MaxLength="5" />
<Property Name="appellation_id" Type="int" />
<Property Name="follower_hash" Type="nvarchar" MaxLength="100" />
<Property Name="search_keywords" Type="nvarchar(max)" />
</EntityType>
<EntityType Name="followers_tablet">
<Key>
@@ -979,7 +980,7 @@
<Property Name="balance_act_item" Type="int" />
<Property Name="balance_pro_order_detail" Type="int" />
</EntityType>
<Association Name="FK__Ancestral__Regis__5A1A5A11">
<Association Name="FK__Ancestral__Regis__4DF47A4E">
<End Role="AncestralTabletRegistrant" Type="Self.AncestralTabletRegistrant" Multiplicity="1" />
<End Role="AncestralTabletPositionRecord" Type="Self.AncestralTabletPositionRecord" Multiplicity="*" />
<ReferentialConstraint>
@@ -2156,7 +2157,7 @@
<EntitySet Name="supplier" EntityType="Self.supplier" Schema="dbo" store:Type="Tables" />
<EntitySet Name="supplier_kind" EntityType="Self.supplier_kind" Schema="dbo" store:Type="Tables" />
<EntitySet Name="transfer_register" EntityType="Self.transfer_register" Schema="dbo" store:Type="Tables" />
<AssociationSet Name="FK__Ancestral__Regis__5A1A5A11" Association="Self.FK__Ancestral__Regis__5A1A5A11">
<AssociationSet Name="FK__Ancestral__Regis__4DF47A4E" Association="Self.FK__Ancestral__Regis__4DF47A4E">
<End Role="AncestralTabletRegistrant" EntitySet="AncestralTabletRegistrant" />
<End Role="AncestralTabletPositionRecord" EntitySet="AncestralTabletPositionRecord" />
</AssociationSet>
@@ -2971,6 +2972,7 @@
<NavigationProperty Name="transfer_register" Relationship="Model.FK_transfer_register_followers" FromRole="follower" ToRole="transfer_register" />
<NavigationProperty Name="transfer_register1" Relationship="Model.FK_transfer_register_followers_match" FromRole="follower" ToRole="transfer_register" />
<NavigationProperty Name="GuaDanOrder" Relationship="Model.FK_GuaDanOrder_Followers" FromRole="follower" ToRole="GuaDanOrder" />
<Property Name="search_keywords" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_FOLLOWERS" FromRole="follower" ToRole="GuaDanOrderGuest" />
</EntityType>
<EntityType Name="followers_tablet">
@@ -4462,7 +4464,6 @@
<End Role="pro_order_record" EntitySet="pro_order_record" />
</AssociationSet>
<EntitySet Name="GuaDanOrder" EntityType="Model.GuaDanOrder" />
<EntitySet Name="GuaDanOrderGuest" EntityType="Model.GuaDanOrderGuest" />
<EntitySet Name="GuadanTimeSetting" EntityType="Model.GuadanTimeSetting" />
<EntitySet Name="Region" EntityType="Model.Region" />
<EntitySet Name="RegionAndRoomAndBedSchedule" EntityType="Model.RegionAndRoomAndBedSchedule" />
@@ -4478,26 +4479,6 @@
<End Role="follower" EntitySet="followers" />
<End Role="GuaDanOrder" EntitySet="GuaDanOrder" />
</AssociationSet>
<AssociationSet Name="FK_GuaDanOrderGuest_FOLLOWERS" Association="Model.FK_GuaDanOrderGuest_FOLLOWERS">
<End Role="follower" EntitySet="followers" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_GuaDanOrderGuest_BedUuid" Association="Model.FK_GuaDanOrderGuest_BedUuid">
<End Role="RegionRoomBed" EntitySet="RegionRoomBed" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_GuaDanOrderGuest_RoomUuid" Association="Model.FK_GuaDanOrderGuest_RoomUuid">
<End Role="Room" EntitySet="Room" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_GuaDanOrderGuest_StatusCode" Association="Model.FK_GuaDanOrderGuest_StatusCode">
<End Role="RegionRoomBedStatus" EntitySet="RegionRoomBedStatus" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_Schedule_GuaDanOrderGuest" Association="Model.FK_Schedule_GuaDanOrderGuest">
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
<End Role="RegionAndRoomAndBedSchedule" EntitySet="RegionAndRoomAndBedSchedule" />
</AssociationSet>
<AssociationSet Name="FK_Region_ParentUuid" Association="Model.FK_Region_ParentUuid">
<End Role="Region" EntitySet="Region" />
<End Role="Region1" EntitySet="Region" />
@@ -4539,14 +4520,35 @@
<End Role="AncestralTabletPosition" EntitySet="AncestralTabletPosition" />
<End Role="AncestralTabletRegistrant" EntitySet="AncestralTabletRegistrant" />
</AssociationSet>
<AssociationSet Name="FK__Ancestral__Regis__5A1A5A11" Association="Model.FK__Ancestral__Regis__5A1A5A11">
<AssociationSet Name="FK__Ancestral__Regis__4DF47A4E" Association="Model.FK__Ancestral__Regis__4DF47A4E">
<End Role="AncestralTabletRegistrant" EntitySet="AncestralTabletRegistrant" />
<End Role="AncestralTabletPositionRecord" EntitySet="AncestralTabletPositionRecord" />
</AssociationSet>
<EntitySet Name="GuaDanOrderGuest" EntityType="Model.GuaDanOrderGuest" />
<AssociationSet Name="FK_GuaDanOrderGuest_FOLLOWERS" Association="Model.FK_GuaDanOrderGuest_FOLLOWERS">
<End Role="follower" EntitySet="followers" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_GuaDanOrderGuest_Order" Association="Model.FK_GuaDanOrderGuest_Order">
<End Role="GuaDanOrder" EntitySet="GuaDanOrder" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_GuaDanOrderGuest_BedUuid" Association="Model.FK_GuaDanOrderGuest_BedUuid">
<End Role="RegionRoomBed" EntitySet="RegionRoomBed" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_GuaDanOrderGuest_RoomUuid" Association="Model.FK_GuaDanOrderGuest_RoomUuid">
<End Role="Room" EntitySet="Room" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_GuaDanOrderGuest_StatusCode" Association="Model.FK_GuaDanOrderGuest_StatusCode">
<End Role="RegionRoomBedStatus" EntitySet="RegionRoomBedStatus" />
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
</AssociationSet>
<AssociationSet Name="FK_Schedule_GuaDanOrderGuest" Association="Model.FK_Schedule_GuaDanOrderGuest">
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
<End Role="RegionAndRoomAndBedSchedule" EntitySet="RegionAndRoomAndBedSchedule" />
</AssociationSet>
</EntityContainer>
<ComplexType Name="sp_helpdiagramdefinition_Result">
<Property Type="Int32" Name="version" Nullable="true" />
@@ -4841,28 +4843,7 @@
<NavigationProperty Name="admin" Relationship="Model.FK_GuaDanOrder_Admin_CreateUser" FromRole="GuaDanOrder" ToRole="admin" />
<NavigationProperty Name="followers" Relationship="Model.FK_GuaDanOrder_Followers" FromRole="GuaDanOrder" ToRole="follower" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_Order" FromRole="GuaDanOrder" ToRole="GuaDanOrderGuest" />
</EntityType>
<EntityType Name="GuaDanOrderGuest">
<Key>
<PropertyRef Name="Uuid" />
</Key>
<Property Name="GuaDanOrderNo" Type="String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" />
<Property Name="FollowerNum" Type="Int32" />
<Property Name="IsDeleted" Type="Boolean" Nullable="false" />
<Property Name="Uuid" Type="Guid" Nullable="false" />
<Property Name="RoomUuid" Type="Guid" />
<Property Name="BedUuid" Type="Guid" />
<Property Name="CheckInAt" Type="DateTime" Precision="0" />
<Property Name="CheckOutAt" Type="DateTime" Precision="0" />
<Property Name="StatusCode" Type="String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" />
<NavigationProperty Name="followers" Relationship="Model.FK_GuaDanOrderGuest_FOLLOWERS" FromRole="GuaDanOrderGuest" ToRole="follower" />
<NavigationProperty Name="RegionRoomBed" Relationship="Model.FK_GuaDanOrderGuest_BedUuid" FromRole="GuaDanOrderGuest" ToRole="RegionRoomBed" />
<NavigationProperty Name="Room" Relationship="Model.FK_GuaDanOrderGuest_RoomUuid" FromRole="GuaDanOrderGuest" ToRole="Room" />
<NavigationProperty Name="RegionRoomBedStatus" Relationship="Model.FK_GuaDanOrderGuest_StatusCode" FromRole="GuaDanOrderGuest" ToRole="RegionRoomBedStatus" />
<NavigationProperty Name="RegionAndRoomAndBedSchedule" Relationship="Model.FK_Schedule_GuaDanOrderGuest" FromRole="GuaDanOrderGuest" ToRole="RegionAndRoomAndBedSchedule" />
<Property Name="OrderUuid" Type="Guid" />
<NavigationProperty Name="GuaDanOrder" Relationship="Model.FK_GuaDanOrderGuest_Order" FromRole="GuaDanOrderGuest" ToRole="GuaDanOrder" />
</EntityType>
</EntityType>
<EntityType Name="GuadanTimeSetting">
<Key>
<PropertyRef Name="Id" />
@@ -4925,9 +4906,9 @@
<Property Name="Uuid" Type="Guid" Nullable="false" />
<Property Name="RoomUuid" Type="Guid" Nullable="false" />
<Property Name="StatusCode" Type="String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_BedUuid" FromRole="RegionRoomBed" ToRole="GuaDanOrderGuest" />
<NavigationProperty Name="Room" Relationship="Model.FK_RegionRoomBed_RoomUuid" FromRole="RegionRoomBed" ToRole="Room" />
<NavigationProperty Name="RegionRoomBedStatus" Relationship="Model.FK_RegionRoomBed_StatusCode" FromRole="RegionRoomBed" ToRole="RegionRoomBedStatus" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_BedUuid" FromRole="RegionRoomBed" ToRole="GuaDanOrderGuest" />
</EntityType>
<EntityType Name="RegionRoomBedStatus">
<Key>
@@ -4938,8 +4919,8 @@
<Property Name="Description" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="Category" Type="Int32" />
<Property Name="IsDeleted" Type="Boolean" Nullable="false" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_StatusCode" FromRole="RegionRoomBedStatus" ToRole="GuaDanOrderGuest" />
<NavigationProperty Name="RegionRoomBed" Relationship="Model.FK_RegionRoomBed_StatusCode" FromRole="RegionRoomBedStatus" ToRole="RegionRoomBed" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_StatusCode" FromRole="RegionRoomBedStatus" ToRole="GuaDanOrderGuest" />
</EntityType>
<EntityType Name="RegionType">
<Key>
@@ -4966,9 +4947,9 @@
<Property Name="IsDeleted" Type="Boolean" Nullable="false" />
<Property Name="Uuid" Type="Guid" Nullable="false" />
<Property Name="RegionUuid" Type="Guid" Nullable="false" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_RoomUuid" FromRole="Room" ToRole="GuaDanOrderGuest" />
<NavigationProperty Name="Region" Relationship="Model.FK_Room_Region" FromRole="Room" ToRole="Region" />
<NavigationProperty Name="RegionRoomBed" Relationship="Model.FK_RegionRoomBed_RoomUuid" FromRole="Room" ToRole="RegionRoomBed" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_RoomUuid" FromRole="Room" ToRole="GuaDanOrderGuest" />
</EntityType>
<Association Name="FK_GuaDanOrder_Admin_CreateUser">
<End Type="Model.admin" Role="admin" Multiplicity="0..1" />
@@ -4994,66 +4975,6 @@
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_GuaDanOrderGuest_FOLLOWERS">
<End Type="Model.follower" Role="follower" Multiplicity="0..1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="follower">
<PropertyRef Name="num" />
</Principal>
<Dependent Role="GuaDanOrderGuest">
<PropertyRef Name="FollowerNum" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_GuaDanOrderGuest_BedUuid">
<End Type="Model.RegionRoomBed" Role="RegionRoomBed" Multiplicity="0..1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="RegionRoomBed">
<PropertyRef Name="Uuid" />
</Principal>
<Dependent Role="GuaDanOrderGuest">
<PropertyRef Name="BedUuid" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_GuaDanOrderGuest_RoomUuid">
<End Type="Model.Room" Role="Room" Multiplicity="0..1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Room">
<PropertyRef Name="Uuid" />
</Principal>
<Dependent Role="GuaDanOrderGuest">
<PropertyRef Name="RoomUuid" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_GuaDanOrderGuest_StatusCode">
<End Type="Model.RegionRoomBedStatus" Role="RegionRoomBedStatus" Multiplicity="1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="RegionRoomBedStatus">
<PropertyRef Name="Code" />
</Principal>
<Dependent Role="GuaDanOrderGuest">
<PropertyRef Name="StatusCode" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Schedule_GuaDanOrderGuest">
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="0..1" />
<End Type="Model.RegionAndRoomAndBedSchedule" Role="RegionAndRoomAndBedSchedule" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="GuaDanOrderGuest">
<PropertyRef Name="Uuid" />
</Principal>
<Dependent Role="RegionAndRoomAndBedSchedule">
<PropertyRef Name="GuaDanOrderGuestUuid" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Region_ParentUuid">
<End Type="Model.Region" Role="Region" Multiplicity="0..1" />
<End Type="Model.Region" Role="Region1" Multiplicity="*" />
@@ -5160,7 +5081,7 @@
<Property Name="WPContent" Type="String" MaxLength="1000" FixedLength="false" Unicode="true" />
<Property Name="CreatedAt" Type="DateTime" Nullable="false" Precision="3" />
<Property Name="UpdatedAt" Type="DateTime" Precision="3" />
<NavigationProperty Name="AncestralTabletRegistrant" Relationship="Model.FK__Ancestral__Regis__5A1A5A11" FromRole="AncestralTabletPositionRecord" ToRole="AncestralTabletRegistrant" />
<NavigationProperty Name="AncestralTabletRegistrant" Relationship="Model.FK__Ancestral__Regis__4DF47A4E" FromRole="AncestralTabletPositionRecord" ToRole="AncestralTabletRegistrant" />
</EntityType>
<EntityType Name="AncestralTabletRegistrant">
<Key>
@@ -5181,7 +5102,7 @@
<Property Name="UpdatedAt" Type="DateTime" Precision="3" />
<Property Name="IsEnd" Type="Boolean" Nullable="false" />
<NavigationProperty Name="AncestralTabletPosition" Relationship="Model.FK_Registrant_Position" FromRole="AncestralTabletRegistrant" ToRole="AncestralTabletPosition" />
<NavigationProperty Name="AncestralTabletPositionRecord" Relationship="Model.FK__Ancestral__Regis__5A1A5A11" FromRole="AncestralTabletRegistrant" ToRole="AncestralTabletPositionRecord" />
<NavigationProperty Name="AncestralTabletPositionRecord" Relationship="Model.FK__Ancestral__Regis__4DF47A4E" FromRole="AncestralTabletRegistrant" ToRole="AncestralTabletPositionRecord" />
</EntityType>
<EntityType Name="AncestralTabletStatus">
<Key>
@@ -5240,7 +5161,7 @@
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK__Ancestral__Regis__5A1A5A11">
<Association Name="FK__Ancestral__Regis__4DF47A4E">
<End Type="Model.AncestralTabletRegistrant" Role="AncestralTabletRegistrant" Multiplicity="1" />
<End Type="Model.AncestralTabletPositionRecord" Role="AncestralTabletPositionRecord" Multiplicity="*" />
<ReferentialConstraint>
@@ -5252,6 +5173,39 @@
</Dependent>
</ReferentialConstraint>
</Association>
<EntityType Name="GuaDanOrderGuest">
<Key>
<PropertyRef Name="Uuid" />
</Key>
<Property Name="GuaDanOrderNo" Type="String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" />
<Property Name="FollowerNum" Type="Int32" />
<Property Name="IsDeleted" Type="Boolean" Nullable="false" />
<Property Name="Uuid" Type="Guid" Nullable="false" />
<Property Name="RoomUuid" Type="Guid" />
<Property Name="BedUuid" Type="Guid" />
<Property Name="CheckInAt" Type="DateTime" Precision="0" />
<Property Name="CheckOutAt" Type="DateTime" Precision="0" />
<Property Name="StatusCode" Type="String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" />
<Property Name="OrderUuid" Type="Guid" />
<NavigationProperty Name="followers" Relationship="Model.FK_GuaDanOrderGuest_FOLLOWERS" FromRole="GuaDanOrderGuest" ToRole="follower" />
<NavigationProperty Name="GuaDanOrder" Relationship="Model.FK_GuaDanOrderGuest_Order" FromRole="GuaDanOrderGuest" ToRole="GuaDanOrder" />
<NavigationProperty Name="RegionRoomBed" Relationship="Model.FK_GuaDanOrderGuest_BedUuid" FromRole="GuaDanOrderGuest" ToRole="RegionRoomBed" />
<NavigationProperty Name="Room" Relationship="Model.FK_GuaDanOrderGuest_RoomUuid" FromRole="GuaDanOrderGuest" ToRole="Room" />
<NavigationProperty Name="RegionRoomBedStatus" Relationship="Model.FK_GuaDanOrderGuest_StatusCode" FromRole="GuaDanOrderGuest" ToRole="RegionRoomBedStatus" />
<NavigationProperty Name="RegionAndRoomAndBedSchedule" Relationship="Model.FK_Schedule_GuaDanOrderGuest" FromRole="GuaDanOrderGuest" ToRole="RegionAndRoomAndBedSchedule" />
</EntityType>
<Association Name="FK_GuaDanOrderGuest_FOLLOWERS">
<End Type="Model.follower" Role="follower" Multiplicity="0..1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="follower">
<PropertyRef Name="num" />
</Principal>
<Dependent Role="GuaDanOrderGuest">
<PropertyRef Name="FollowerNum" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_GuaDanOrderGuest_Order">
<End Type="Model.GuaDanOrder" Role="GuaDanOrder" Multiplicity="0..1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
@@ -5264,6 +5218,54 @@
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_GuaDanOrderGuest_BedUuid">
<End Type="Model.RegionRoomBed" Role="RegionRoomBed" Multiplicity="0..1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="RegionRoomBed">
<PropertyRef Name="Uuid" />
</Principal>
<Dependent Role="GuaDanOrderGuest">
<PropertyRef Name="BedUuid" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_GuaDanOrderGuest_RoomUuid">
<End Type="Model.Room" Role="Room" Multiplicity="0..1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Room">
<PropertyRef Name="Uuid" />
</Principal>
<Dependent Role="GuaDanOrderGuest">
<PropertyRef Name="RoomUuid" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_GuaDanOrderGuest_StatusCode">
<End Type="Model.RegionRoomBedStatus" Role="RegionRoomBedStatus" Multiplicity="1" />
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="RegionRoomBedStatus">
<PropertyRef Name="Code" />
</Principal>
<Dependent Role="GuaDanOrderGuest">
<PropertyRef Name="StatusCode" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Schedule_GuaDanOrderGuest">
<End Type="Model.GuaDanOrderGuest" Role="GuaDanOrderGuest" Multiplicity="0..1" />
<End Type="Model.RegionAndRoomAndBedSchedule" Role="RegionAndRoomAndBedSchedule" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="GuaDanOrderGuest">
<PropertyRef Name="Uuid" />
</Principal>
<Dependent Role="RegionAndRoomAndBedSchedule">
<PropertyRef Name="GuaDanOrderGuestUuid" />
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
@@ -5636,6 +5638,7 @@
<EntitySetMapping Name="followers">
<EntityTypeMapping TypeName="Model.follower">
<MappingFragment StoreEntitySet="followers">
<ScalarProperty Name="search_keywords" ColumnName="search_keywords" />
<ScalarProperty Name="follower_hash" ColumnName="follower_hash" />
<ScalarProperty Name="num" ColumnName="num" />
<ScalarProperty Name="f_number" ColumnName="f_number" />
@@ -6122,22 +6125,6 @@
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="GuaDanOrderGuest">
<EntityTypeMapping TypeName="Model.GuaDanOrderGuest">
<MappingFragment StoreEntitySet="GuaDanOrderGuest">
<ScalarProperty Name="OrderUuid" ColumnName="OrderUuid" />
<ScalarProperty Name="StatusCode" ColumnName="StatusCode" />
<ScalarProperty Name="CheckOutAt" ColumnName="CheckOutAt" />
<ScalarProperty Name="CheckInAt" ColumnName="CheckInAt" />
<ScalarProperty Name="BedUuid" ColumnName="BedUuid" />
<ScalarProperty Name="RoomUuid" ColumnName="RoomUuid" />
<ScalarProperty Name="Uuid" ColumnName="Uuid" />
<ScalarProperty Name="IsDeleted" ColumnName="IsDeleted" />
<ScalarProperty Name="FollowerNum" ColumnName="FollowerNum" />
<ScalarProperty Name="GuaDanOrderNo" ColumnName="GuaDanOrderNo" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="GuadanTimeSetting">
<EntityTypeMapping TypeName="Model.GuadanTimeSetting">
<MappingFragment StoreEntitySet="GuadanTimeSetting">
@@ -6311,7 +6298,23 @@
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
<EntitySetMapping Name="GuaDanOrderGuest">
<EntityTypeMapping TypeName="Model.GuaDanOrderGuest">
<MappingFragment StoreEntitySet="GuaDanOrderGuest">
<ScalarProperty Name="OrderUuid" ColumnName="OrderUuid" />
<ScalarProperty Name="StatusCode" ColumnName="StatusCode" />
<ScalarProperty Name="CheckOutAt" ColumnName="CheckOutAt" />
<ScalarProperty Name="CheckInAt" ColumnName="CheckInAt" />
<ScalarProperty Name="BedUuid" ColumnName="BedUuid" />
<ScalarProperty Name="RoomUuid" ColumnName="RoomUuid" />
<ScalarProperty Name="Uuid" ColumnName="Uuid" />
<ScalarProperty Name="IsDeleted" ColumnName="IsDeleted" />
<ScalarProperty Name="FollowerNum" ColumnName="FollowerNum" />
<ScalarProperty Name="GuaDanOrderNo" ColumnName="GuaDanOrderNo" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
</edmx:Runtime>

View File

@@ -4,7 +4,7 @@
<edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- Diagram content (shape and connector positions) -->
<edmx:Diagrams>
<Diagram DiagramId="b267a343dc0c4bf0ae194b775754b108" Name="Diagram1" ZoomLevel="100">
<Diagram DiagramId="b267a343dc0c4bf0ae194b775754b108" Name="Diagram1" ZoomLevel="78">
<EntityTypeShape EntityType="Model.accounting" Width="1.5" PointX="22.5" PointY="22.125" IsExpanded="true" />
<EntityTypeShape EntityType="Model.accounting_files" Width="1.5" PointX="15.75" PointY="27.75" IsExpanded="true" />
<EntityTypeShape EntityType="Model.accounting_kind" Width="1.5" PointX="11.25" PointY="27.625" IsExpanded="true" />
@@ -131,21 +131,15 @@
<AssociationConnector Association="Model.FK_transfer_register_pro_order_detail" />
<AssociationConnector Association="Model.FK_pro_order_record_transfer_register" />
<EntityTypeShape EntityType="Model.GuaDanOrder" Width="1.5" PointX="13.25" PointY="20.25" />
<EntityTypeShape EntityType="Model.GuaDanOrderGuest" Width="1.5" PointX="25.875" PointY="12.5" />
<EntityTypeShape EntityType="Model.GuadanTimeSetting" Width="1.5" PointX="21.375" PointY="7.75" />
<EntityTypeShape EntityType="Model.Region" Width="1.5" PointX="19.125" PointY="30.75" />
<EntityTypeShape EntityType="Model.RegionAndRoomAndBedSchedule" Width="1.5" PointX="28.125" PointY="12.625" />
<EntityTypeShape EntityType="Model.RegionAndRoomAndBedSchedule" Width="1.5" PointX="31.5" PointY="12.5" />
<EntityTypeShape EntityType="Model.RegionRoomBed" Width="1.5" PointX="23.625" PointY="3.375" />
<EntityTypeShape EntityType="Model.RegionRoomBedStatus" Width="1.5" PointX="21.375" PointY="3.625" />
<EntityTypeShape EntityType="Model.RegionType" Width="1.5" PointX="16.875" PointY="31.625" />
<EntityTypeShape EntityType="Model.Room" Width="1.5" PointX="21.375" PointY="31.125" />
<AssociationConnector Association="Model.FK_GuaDanOrder_Admin_CreateUser" />
<AssociationConnector Association="Model.FK_GuaDanOrder_Followers" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_FOLLOWERS" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_BedUuid" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_RoomUuid" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_StatusCode" />
<AssociationConnector Association="Model.FK_Schedule_GuaDanOrderGuest" />
<AssociationConnector Association="Model.FK_Region_ParentUuid" />
<AssociationConnector Association="Model.FK_Region_RegionTypeUuid" />
<AssociationConnector Association="Model.FK_Room_Region" />
@@ -160,8 +154,14 @@
<AssociationConnector Association="Model.FK_Position_Area" />
<AssociationConnector Association="Model.FK_Position_Status" />
<AssociationConnector Association="Model.FK_Registrant_Position" />
<AssociationConnector Association="Model.FK__Ancestral__Regis__5A1A5A11" />
<AssociationConnector Association="Model.FK__Ancestral__Regis__4DF47A4E" />
<EntityTypeShape EntityType="Model.GuaDanOrderGuest" Width="2.75" PointX="25.875" PointY="12.875" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_FOLLOWERS" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_Order" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_BedUuid" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_RoomUuid" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_StatusCode" />
<AssociationConnector Association="Model.FK_Schedule_GuaDanOrderGuest" />
</Diagram>
</edmx:Diagrams>
</edmx:Designer>

View File

@@ -298,6 +298,34 @@ namespace Model
var timestamp = DateTime.Now.ToString("HHmmss");
return prefix + datePart + timestamp;
}
/// <summary>
/// 更新指定 follower 的 search_keywords 欄位
/// </summary>
/// <param name="followerId">follower 的 ID</param>
/// <returns>是否成功更新</returns>
public static bool UpdateSearchKeywords(int followerId)
{
try
{
using (var db = new Model.ezEntities())
{
var follower = db.followers.Find(followerId);
if (follower == null)
return false;
MyWeb.encrypt enc = new MyWeb.encrypt();
follower.search_keywords = enc.GenerateSearchKeywords(follower);
db.SaveChanges();
return true;
}
}
catch
{
return false;
}
}
}
}

View File

@@ -42,6 +42,7 @@ namespace Model.ViewModel
public string country { get; set; }
public string country2 { get; set; }
public string phone_idcode { get; set; } // 電話/證號搜尋欄位
}
public class followers_tablet
{

View File

@@ -173,6 +173,17 @@ public class FollowerController : ApiController
}
}
// 電話/證號搜尋 (使用 search_keywords HEX 編碼)
if (!string.IsNullOrEmpty(q.phone_idcode) && GlobalVariables.UseSearchKeywords)
{
MyWeb.encrypt enc = new MyWeb.encrypt();
string hexSearch = enc.ConvertToHex(q.phone_idcode.Trim());
if (!string.IsNullOrEmpty(hexSearch))
{
qry = qry.Where(o => o.search_keywords != null && o.search_keywords.Contains(hexSearch));
}
}
if (sortBy.Equals("f_number"))

View File

@@ -158,6 +158,17 @@ public class appFollowerController : ApiController
}
}
// 電話/證號搜尋 (使用 search_keywords HEX 編碼)
if (!string.IsNullOrEmpty(q.phone_idcode) && GlobalVariables.UseSearchKeywords)
{
MyWeb.encrypt enc = new MyWeb.encrypt();
string hexSearch = enc.ConvertToHex(q.phone_idcode.Trim());
if (!string.IsNullOrEmpty(hexSearch))
{
qry = qry.Where(o => o.search_keywords != null && o.search_keywords.Contains(hexSearch));
}
}
if (sortBy.Equals("f_number"))

View File

@@ -127,6 +127,67 @@ namespace MyWeb
char.IsLetterOrDigit(c)).ToArray()).ToUpper();
return SHA256(input);
}
/// <summary>
/// 生成 search_keywords 的 HEX 編碼字串
/// </summary>
/// <param name="follower">follower 物件</param>
/// <returns>HEX 編碼字串</returns>
public string GenerateSearchKeywords(Model.follower follower)
{
try
{
// 解密各欄位
string phone_decrypted = string.IsNullOrEmpty(follower.phone) ? "" : DecryptAutoKey(follower.phone);
string cellphone_decrypted = string.IsNullOrEmpty(follower.cellphone) ? "" : DecryptAutoKey(follower.cellphone);
string id_code_decrypted = string.IsNullOrEmpty(follower.id_code) ? "" : DecryptAutoKey(follower.id_code);
string passport_decrypted = string.IsNullOrEmpty(follower.passport) ? "" : DecryptAutoKey(follower.passport);
// 組合字串 (使用 | 分隔)
string joinedString = string.Join("|", new string[] {
phone_decrypted,
cellphone_decrypted,
id_code_decrypted,
passport_decrypted
});
// 轉換為 HEX 編碼
if (string.IsNullOrEmpty(joinedString.Replace("|", "")))
{
return ""; // 如果所有欄位都是空的,返回空字串
}
byte[] bytes = Encoding.UTF8.GetBytes(joinedString);
string hexString = BitConverter.ToString(bytes).Replace("-", "").ToLower();
return hexString;
}
catch
{
return ""; // 發生錯誤時返回空字串
}
}
/// <summary>
/// 將搜尋字串轉換為 HEX 編碼 (用於搜尋功能)
/// </summary>
/// <param name="searchText">要搜尋的文字</param>
/// <returns>HEX 編碼字串</returns>
public string ConvertToHex(string searchText)
{
try
{
if (string.IsNullOrEmpty(searchText))
return "";
byte[] bytes = Encoding.UTF8.GetBytes(searchText);
string hexString = BitConverter.ToString(bytes).Replace("-", "").ToLower();
return hexString;
}
catch
{
return "";
}
}
}
}

View File

@@ -65,6 +65,7 @@
address: '',
country: '',
country2: '',
phone_idcode: '', // 電話/證號搜尋
/*注意這邊的參數不能跟下方print_search重複*/
},
//列印管理報表
@@ -561,6 +562,10 @@
<label class="form-label">信眾姓名 </label>
<input type="text" v-model="search.u_name" class="form-control" placeholder="可輸入關鍵字查詢" id="s_u_name" runat="server">
</div>
<div class="mb-3">
<label class="form-label">電話/證號 </label>
<input type="text" v-model="search.phone_idcode" class="form-control" placeholder="可輸入電話、手機、身份證號或護照號碼" id="s_phone_idcode" runat="server">
</div>
<div class="mb-3">
<label class="form-label">地址 </label>
<input type="text" v-model="search.address" class="form-control" placeholder="可輸入關鍵字查詢" id="s_address" runat="server">

View File

@@ -245,6 +245,19 @@ public partial class admin_follower_index : MyWeb.config
qry = qry.Where(o => o.address.Contains(s_address.Value.Trim()));
_query += "地址:" + s_u_name.Value.Trim() + "\n";
}
// 電話/證號搜尋 (使用 search_keywords HEX 編碼)
if (!isStrNull(s_phone_idcode.Value) && GlobalVariables.UseSearchKeywords)
{
MyWeb.encrypt encrypt = new MyWeb.encrypt();
string hexSearch = encrypt.ConvertToHex(s_phone_idcode.Value.Trim());
if (!string.IsNullOrEmpty(hexSearch))
{
qry = qry.Where(o => o.search_keywords != null && o.search_keywords.Contains(hexSearch));
_query += "電話/證號:" + s_phone_idcode.Value.Trim() + "\n";
}
}
if (!isStrNull(s_birthday.Value) && isDate(s_birthday.Value))
{
qry = qry.Where(o => o.birthday >= ValDate(s_birthday.Value));

View File

@@ -230,6 +230,13 @@ public partial class admin_follower_reg : MyWeb.config
if (_id > 0)
{
// 如果啟用 search_keywords 功能,生成並更新 search_keywords
if (GlobalVariables.UseSearchKeywords)
{
followers.search_keywords = encrypt.GenerateSearchKeywords(followers);
_db.SaveChanges();
}
Model.admin_log admin_log = new Model.admin_log();
admin_log.writeLog(admin.info.u_id, (int)Model.admin_log.Systems.Follower, (int)Model.admin_log.Status.Insert, f_number.Text + u_name.Text);
@@ -305,6 +312,13 @@ public partial class admin_follower_reg : MyWeb.config
followers.tab = tab.Value.Trim(',');
followers.admin_log = admin.info.u_id + " " + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
followers.follower_hash = encrypt.followerHash(followers.phone, followers.id_code);
// 如果啟用 search_keywords 功能,生成並更新 search_keywords
if (GlobalVariables.UseSearchKeywords)
{
followers.search_keywords = encrypt.GenerateSearchKeywords(followers);
}
_db.SaveChanges();
Model.admin_log admin_log = new Model.admin_log();

View File

@@ -38,16 +38,17 @@
<add key="pwStrength" value="0" />
<!--考勤允許IP-->
<add key="attendancesIP" value="211.20.239.58,127.0.0.1,122.117.61.232" />
<!--是否啟用 search_keywords 搜尋功能 (true=啟用, false=停用)-->
<add key="UseSearchKeywords" value="true" />
<!--網站的簡稱用來區別session和cookie-->
<add key="SC" value="erp17168" />
</appSettings>
<connectionStrings>
<!--SQL用-->
<!-- -->
<add name="shopConn" providerName="System.Data.SqlClient"
connectionString="Data Source=localhost;Initial Catalog=17168erp_t;User ID=17168erp;Password=17168erp;Encrypt=False;TrustServerCertificate=True;Provider=SQLOLEDB;Connection Timeout=10;" />
<add name="ezEntities" providerName="System.Data.EntityClient"
connectionString="metadata=res://*/App_Code.Model.Model.csdl|res://*/App_Code.Model.Model.ssdl|res://*/App_Code.Model.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=17168erp_t;User ID=17168erp;Password=17168erp;Encrypt=False;TrustServerCertificate=True;Connection Timeout=10;&quot;"/>
<add name="shopConn" providerName="System.Data.SqlClient" connectionString="Data Source=localhost;Initial Catalog=17168erp_t;User ID=17168erp;Password=17168erp;Encrypt=False;TrustServerCertificate=True;Provider=SQLOLEDB;Connection Timeout=10;" />
<add name="ezEntities" providerName="System.Data.EntityClient" connectionString="metadata=res://*/App_Code.Model.Model.csdl|res://*/App_Code.Model.Model.ssdl|res://*/App_Code.Model.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=17168erp_t;User ID=17168erp;Password=17168erp;Encrypt=False;TrustServerCertificate=True;Connection Timeout=10;&quot;" />
<!--
-->
<!--SQL用-->
</connectionStrings>
<!--