1. 優化報名頁面:彈出查詢頁面、顯示剛新增資料
2. 新增報名頁面加上取消鍵 3. 優化登入頁面:按下 enter 自動換格/送出 4. 修復新增報名頁面中,不同 search_dialog 中的 page 參數相互連動之異常 5. 修改報名頁面列印格式 6. 修復報名頁面匯出功能 7. 優化報到功能 8. 報名頁面中,無查詢資料時不可點選匯出/列印按鈕 9. 匯出/列印報名管理報表時,若無資料則顯示提示 10. 修復列印管理報表後父視窗 UI 不能點擊的問題 11. 新增報名管理表單匯出 excel 功能 12. 於新增信眾、新增活動頁面加上取消鍵 13. 優化報名管理匯出功能:若篩選條件包含特定活動,自動於「匯出條件」欄位標註活動名稱 14. 優化報名查詢匯出功能:匯出之文件中加上「匯出條件」欄位 15. 修復信眾資料頁面中,使用「生日」作為篩選基準時,後續執行「列印查詢資料」與「匯出查詢資料」會報錯 16. 修復「列印信眾查詢」功能中,電話搜尋欄位未正確帶入查詢條件之異常 17. 解決中文輸入法輸入電話號碼的跳字問題 18. 新增品項管理介面排序功能
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 這個程式碼是由範本產生。
|
||||
// 這個程式碼是由範本產生。
|
||||
//
|
||||
// 對這個檔案進行手動變更可能導致您的應用程式產生未預期的行為。
|
||||
// 如果重新產生程式碼,將會覆寫對這個檔案的手動變更。
|
||||
// 對這個檔案進行手動變更可能導致您的應用程式產生未預期的行為。
|
||||
// 如果重新產生程式碼,將會覆寫對這個檔案的手動變更。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -14,19 +14,19 @@ namespace Model
|
||||
using System.Data.Entity.Infrastructure;
|
||||
using System.Data.Entity.Core.Objects;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
public partial class ezEntities : DbContext
|
||||
{
|
||||
public ezEntities()
|
||||
: base("name=ezEntities")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
throw new UnintentionalCodeFirstException();
|
||||
}
|
||||
|
||||
|
||||
public virtual DbSet<accounting> accountings { get; set; }
|
||||
public virtual DbSet<accounting_files> accounting_files { get; set; }
|
||||
public virtual DbSet<accounting_kind> accounting_kind { get; set; }
|
||||
@@ -94,134 +94,134 @@ namespace Model
|
||||
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)
|
||||
{
|
||||
var startRowIndexParameter = startRowIndex.HasValue ?
|
||||
new ObjectParameter("StartRowIndex", startRowIndex) :
|
||||
new ObjectParameter("StartRowIndex", typeof(int));
|
||||
|
||||
|
||||
var pageSizeParameter = pageSize.HasValue ?
|
||||
new ObjectParameter("PageSize", pageSize) :
|
||||
new ObjectParameter("PageSize", typeof(int));
|
||||
|
||||
|
||||
var tableNameParameter = tableName != null ?
|
||||
new ObjectParameter("tableName", tableName) :
|
||||
new ObjectParameter("tableName", typeof(string));
|
||||
|
||||
|
||||
var columnNameParameter = columnName != null ?
|
||||
new ObjectParameter("columnName", columnName) :
|
||||
new ObjectParameter("columnName", typeof(string));
|
||||
|
||||
|
||||
var sqlWhereParameter = sqlWhere != null ?
|
||||
new ObjectParameter("sqlWhere", sqlWhere) :
|
||||
new ObjectParameter("sqlWhere", typeof(string));
|
||||
|
||||
|
||||
var orderByParameter = orderBy != null ?
|
||||
new ObjectParameter("orderBy", orderBy) :
|
||||
new ObjectParameter("orderBy", typeof(string));
|
||||
|
||||
|
||||
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("pager_eztrust", startRowIndexParameter, pageSizeParameter, tableNameParameter, columnNameParameter, sqlWhereParameter, orderByParameter, rowCount);
|
||||
}
|
||||
|
||||
|
||||
public virtual int sp_alterdiagram(string diagramname, Nullable<int> owner_id, Nullable<int> version, byte[] definition)
|
||||
{
|
||||
var diagramnameParameter = diagramname != null ?
|
||||
new ObjectParameter("diagramname", diagramname) :
|
||||
new ObjectParameter("diagramname", typeof(string));
|
||||
|
||||
|
||||
var owner_idParameter = owner_id.HasValue ?
|
||||
new ObjectParameter("owner_id", owner_id) :
|
||||
new ObjectParameter("owner_id", typeof(int));
|
||||
|
||||
|
||||
var versionParameter = version.HasValue ?
|
||||
new ObjectParameter("version", version) :
|
||||
new ObjectParameter("version", typeof(int));
|
||||
|
||||
|
||||
var definitionParameter = definition != null ?
|
||||
new ObjectParameter("definition", definition) :
|
||||
new ObjectParameter("definition", typeof(byte[]));
|
||||
|
||||
|
||||
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("sp_alterdiagram", diagramnameParameter, owner_idParameter, versionParameter, definitionParameter);
|
||||
}
|
||||
|
||||
|
||||
public virtual int sp_creatediagram(string diagramname, Nullable<int> owner_id, Nullable<int> version, byte[] definition)
|
||||
{
|
||||
var diagramnameParameter = diagramname != null ?
|
||||
new ObjectParameter("diagramname", diagramname) :
|
||||
new ObjectParameter("diagramname", typeof(string));
|
||||
|
||||
|
||||
var owner_idParameter = owner_id.HasValue ?
|
||||
new ObjectParameter("owner_id", owner_id) :
|
||||
new ObjectParameter("owner_id", typeof(int));
|
||||
|
||||
|
||||
var versionParameter = version.HasValue ?
|
||||
new ObjectParameter("version", version) :
|
||||
new ObjectParameter("version", typeof(int));
|
||||
|
||||
|
||||
var definitionParameter = definition != null ?
|
||||
new ObjectParameter("definition", definition) :
|
||||
new ObjectParameter("definition", typeof(byte[]));
|
||||
|
||||
|
||||
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("sp_creatediagram", diagramnameParameter, owner_idParameter, versionParameter, definitionParameter);
|
||||
}
|
||||
|
||||
|
||||
public virtual int sp_dropdiagram(string diagramname, Nullable<int> owner_id)
|
||||
{
|
||||
var diagramnameParameter = diagramname != null ?
|
||||
new ObjectParameter("diagramname", diagramname) :
|
||||
new ObjectParameter("diagramname", typeof(string));
|
||||
|
||||
|
||||
var owner_idParameter = owner_id.HasValue ?
|
||||
new ObjectParameter("owner_id", owner_id) :
|
||||
new ObjectParameter("owner_id", typeof(int));
|
||||
|
||||
|
||||
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("sp_dropdiagram", diagramnameParameter, owner_idParameter);
|
||||
}
|
||||
|
||||
|
||||
public virtual ObjectResult<sp_helpdiagramdefinition_Result> sp_helpdiagramdefinition(string diagramname, Nullable<int> owner_id)
|
||||
{
|
||||
var diagramnameParameter = diagramname != null ?
|
||||
new ObjectParameter("diagramname", diagramname) :
|
||||
new ObjectParameter("diagramname", typeof(string));
|
||||
|
||||
|
||||
var owner_idParameter = owner_id.HasValue ?
|
||||
new ObjectParameter("owner_id", owner_id) :
|
||||
new ObjectParameter("owner_id", typeof(int));
|
||||
|
||||
|
||||
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<sp_helpdiagramdefinition_Result>("sp_helpdiagramdefinition", diagramnameParameter, owner_idParameter);
|
||||
}
|
||||
|
||||
|
||||
public virtual ObjectResult<sp_helpdiagrams_Result> sp_helpdiagrams(string diagramname, Nullable<int> owner_id)
|
||||
{
|
||||
var diagramnameParameter = diagramname != null ?
|
||||
new ObjectParameter("diagramname", diagramname) :
|
||||
new ObjectParameter("diagramname", typeof(string));
|
||||
|
||||
|
||||
var owner_idParameter = owner_id.HasValue ?
|
||||
new ObjectParameter("owner_id", owner_id) :
|
||||
new ObjectParameter("owner_id", typeof(int));
|
||||
|
||||
|
||||
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<sp_helpdiagrams_Result>("sp_helpdiagrams", diagramnameParameter, owner_idParameter);
|
||||
}
|
||||
|
||||
|
||||
public virtual int sp_renamediagram(string diagramname, Nullable<int> owner_id, string new_diagramname)
|
||||
{
|
||||
var diagramnameParameter = diagramname != null ?
|
||||
new ObjectParameter("diagramname", diagramname) :
|
||||
new ObjectParameter("diagramname", typeof(string));
|
||||
|
||||
|
||||
var owner_idParameter = owner_id.HasValue ?
|
||||
new ObjectParameter("owner_id", owner_id) :
|
||||
new ObjectParameter("owner_id", typeof(int));
|
||||
|
||||
|
||||
var new_diagramnameParameter = new_diagramname != null ?
|
||||
new ObjectParameter("new_diagramname", new_diagramname) :
|
||||
new ObjectParameter("new_diagramname", typeof(string));
|
||||
|
||||
|
||||
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("sp_renamediagram", diagramnameParameter, owner_idParameter, new_diagramnameParameter);
|
||||
}
|
||||
|
||||
|
||||
public virtual int sp_upgraddiagrams()
|
||||
{
|
||||
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("sp_upgraddiagrams");
|
||||
|
||||
+178
-177
File diff suppressed because it is too large
Load Diff
@@ -91,6 +91,7 @@
|
||||
<Property Name="customize_data" Type="nvarchar(max)" />
|
||||
<Property Name="reg_time" Type="datetime" />
|
||||
<Property Name="is_reconcile" Type="nvarchar" MaxLength="1" />
|
||||
<Property Name="sort_order" Type="int" />
|
||||
</EntityType>
|
||||
<EntityType Name="actItem_files">
|
||||
<Key>
|
||||
@@ -480,7 +481,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)" />
|
||||
<Property Name="search_keywords" Type="varchar(max)" />
|
||||
</EntityType>
|
||||
<EntityType Name="followers_tablet">
|
||||
<Key>
|
||||
@@ -604,8 +605,8 @@
|
||||
</Key>
|
||||
<Property Name="num" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="kind" Type="nvarchar" MaxLength="100" />
|
||||
<Property Name="starttime" Type="time" Precision="0" />
|
||||
<Property Name="offtime" Type="time" Precision="0" />
|
||||
<Property Name="starttime" Type="time" Precision="7" />
|
||||
<Property Name="offtime" Type="time" Precision="7" />
|
||||
<Property Name="resttime" Type="int" />
|
||||
<Property Name="root" Type="int" />
|
||||
<Property Name="range" Type="int" />
|
||||
@@ -980,7 +981,7 @@
|
||||
<Property Name="balance_act_item" Type="int" />
|
||||
<Property Name="balance_pro_order_detail" Type="int" />
|
||||
</EntityType>
|
||||
<Association Name="FK__Ancestral__Regis__4DF47A4E">
|
||||
<Association Name="FK__Ancestral__Regis__1A9EF37A">
|
||||
<End Role="AncestralTabletRegistrant" Type="Self.AncestralTabletRegistrant" Multiplicity="1" />
|
||||
<End Role="AncestralTabletPositionRecord" Type="Self.AncestralTabletPositionRecord" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
@@ -1079,7 +1080,9 @@
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_act_bom_actItem1">
|
||||
<End Role="actItem" Type="Self.actItem" Multiplicity="0..1" />
|
||||
<End Role="actItem" Type="Self.actItem" Multiplicity="0..1">
|
||||
<OnDelete Action="Cascade" />
|
||||
</End>
|
||||
<End Role="act_bom" Type="Self.act_bom" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
<Principal Role="actItem">
|
||||
@@ -1128,18 +1131,6 @@
|
||||
</Dependent>
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_activity_activity_kind">
|
||||
<End Role="activity_kind" Type="Self.activity_kind" Multiplicity="0..1" />
|
||||
<End Role="activity" Type="Self.activity" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
<Principal Role="activity_kind">
|
||||
<PropertyRef Name="num" />
|
||||
</Principal>
|
||||
<Dependent Role="activity">
|
||||
<PropertyRef Name="kind" />
|
||||
</Dependent>
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_activity_check_activity">
|
||||
<End Role="activity" Type="Self.activity" Multiplicity="0..1">
|
||||
<OnDelete Action="Cascade" />
|
||||
@@ -1211,7 +1202,9 @@
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_activity_relating_activity">
|
||||
<End Role="activity" Type="Self.activity" Multiplicity="1" />
|
||||
<End Role="activity" Type="Self.activity" Multiplicity="1">
|
||||
<OnDelete Action="Cascade" />
|
||||
</End>
|
||||
<End Role="activity_relating" Type="Self.activity_relating" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
<Principal Role="activity">
|
||||
@@ -1637,7 +1630,9 @@
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_pro_order_activity">
|
||||
<End Role="activity" Type="Self.activity" Multiplicity="0..1" />
|
||||
<End Role="activity" Type="Self.activity" Multiplicity="0..1">
|
||||
<OnDelete Action="Cascade" />
|
||||
</End>
|
||||
<End Role="pro_order" Type="Self.pro_order" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
<Principal Role="activity">
|
||||
@@ -1687,7 +1682,9 @@
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_pro_order_detail_pro_order">
|
||||
<End Role="pro_order" Type="Self.pro_order" Multiplicity="1" />
|
||||
<End Role="pro_order" Type="Self.pro_order" Multiplicity="1">
|
||||
<OnDelete Action="Cascade" />
|
||||
</End>
|
||||
<End Role="pro_order_detail" Type="Self.pro_order_detail" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
<Principal Role="pro_order">
|
||||
@@ -1699,7 +1696,9 @@
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_pro_order_followers">
|
||||
<End Role="followers" Type="Self.followers" Multiplicity="0..1" />
|
||||
<End Role="followers" Type="Self.followers" Multiplicity="0..1">
|
||||
<OnDelete Action="Cascade" />
|
||||
</End>
|
||||
<End Role="pro_order" Type="Self.pro_order" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
<Principal Role="followers">
|
||||
@@ -2157,7 +2156,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__4DF47A4E" Association="Self.FK__Ancestral__Regis__4DF47A4E">
|
||||
<AssociationSet Name="FK__Ancestral__Regis__1A9EF37A" Association="Self.FK__Ancestral__Regis__1A9EF37A">
|
||||
<End Role="AncestralTabletRegistrant" EntitySet="AncestralTabletRegistrant" />
|
||||
<End Role="AncestralTabletPositionRecord" EntitySet="AncestralTabletPositionRecord" />
|
||||
</AssociationSet>
|
||||
@@ -2205,10 +2204,6 @@
|
||||
<End Role="activity_category_kind" EntitySet="activity_category_kind" />
|
||||
<End Role="activity" EntitySet="activity" />
|
||||
</AssociationSet>
|
||||
<AssociationSet Name="FK_activity_activity_kind" Association="Self.FK_activity_activity_kind">
|
||||
<End Role="activity_kind" EntitySet="activity_kind" />
|
||||
<End Role="activity" EntitySet="activity" />
|
||||
</AssociationSet>
|
||||
<AssociationSet Name="FK_activity_check_activity" Association="Self.FK_activity_check_activity">
|
||||
<End Role="activity" EntitySet="activity" />
|
||||
<End Role="activity_check" EntitySet="activity_check" />
|
||||
@@ -2613,6 +2608,7 @@
|
||||
<Property Name="print_init" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
|
||||
<NavigationProperty Name="transfer_register" Relationship="Model.FK_transfer_register_actItem" FromRole="actItem" ToRole="transfer_register" />
|
||||
<Property Name="is_reconcile" Type="String" MaxLength="1" FixedLength="false" Unicode="true" />
|
||||
<Property Name="sort_order" Type="Int32" />
|
||||
</EntityType>
|
||||
<EntityType Name="actItem_files">
|
||||
<Key>
|
||||
@@ -2972,7 +2968,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" />
|
||||
<Property Name="search_keywords" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
|
||||
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_FOLLOWERS" FromRole="follower" ToRole="GuaDanOrderGuest" />
|
||||
</EntityType>
|
||||
<EntityType Name="followers_tablet">
|
||||
@@ -3062,8 +3058,8 @@
|
||||
</Key>
|
||||
<Property Name="num" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="kind" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
|
||||
<Property Name="starttime" Type="Time" Precision="0" />
|
||||
<Property Name="offtime" Type="Time" Precision="0" />
|
||||
<Property Name="starttime" Type="Time" Precision="7" />
|
||||
<Property Name="offtime" Type="Time" Precision="7" />
|
||||
<Property Name="resttime" Type="Int32" />
|
||||
<Property Name="root" Type="Int32" />
|
||||
<Property Name="range" Type="Int32" />
|
||||
@@ -5334,6 +5330,7 @@
|
||||
<EntitySetMapping Name="actItems">
|
||||
<EntityTypeMapping TypeName="Model.actItem">
|
||||
<MappingFragment StoreEntitySet="actItem">
|
||||
<ScalarProperty Name="sort_order" ColumnName="sort_order" />
|
||||
<ScalarProperty Name="is_reconcile" ColumnName="is_reconcile" />
|
||||
<ScalarProperty Name="print_init" ColumnName="print_init" />
|
||||
<ScalarProperty Name="partno" ColumnName="partno" />
|
||||
|
||||
@@ -151,8 +151,10 @@ public class FollowerController : ApiController
|
||||
qry = qry.Where(o => o.u_name.Contains(q.u_name.Trim()));
|
||||
if (q.birthday.HasValue)
|
||||
qry = qry.Where(o => o.birthday >= q.birthday.Value);
|
||||
if (q.birthday2.HasValue)
|
||||
qry = qry.Where(o => o.birthday < Convert.ToDateTime(q.birthday2.Value).AddDays(1));
|
||||
if (q.birthday2.HasValue) {
|
||||
var tmpBirthday2 = Convert.ToDateTime(q.birthday2.Value).AddDays(1);
|
||||
qry = qry.Where(o => o.birthday < tmpBirthday2);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(q.address))
|
||||
qry = qry.Where(o => o.address !=null && o.address.Contains(q.address.Trim()));
|
||||
//if (q.num.HasValue && q.num.Value>0)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using PagedList;
|
||||
@@ -10,6 +11,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Web.Services;
|
||||
using static TreeView;
|
||||
|
||||
// api/activity
|
||||
@@ -326,6 +328,36 @@ public class activityController : ApiController
|
||||
return Ok(ret);
|
||||
}
|
||||
|
||||
public class SortOrderRequest
|
||||
{
|
||||
public List<int> ids { get; set; }
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/activity/SaveItemList")]
|
||||
public IHttpActionResult UpdateSortOrder([FromBody] SortOrderRequest request)
|
||||
{
|
||||
if (request == null || request.ids == null) return BadRequest();
|
||||
|
||||
using (Model.ezEntities _db = new Model.ezEntities())
|
||||
{
|
||||
int totalCount = request.ids.Count;
|
||||
|
||||
for (int i = 0; i < totalCount; i++)
|
||||
{
|
||||
int id = request.ids[i];
|
||||
var item = _db.actItems.FirstOrDefault(x => x.num == id);
|
||||
if (item != null)
|
||||
{
|
||||
// 改成總數減去索引,這樣第一筆 (i=0) 會拿到最大的數字
|
||||
item.sort_order = totalCount - i;
|
||||
}
|
||||
}
|
||||
_db.SaveChanges();
|
||||
}
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/activity/GetItemList")]
|
||||
public IHttpActionResult GetItemList([FromBody] Model.ViewModel.actItem q, int page, int pageSize = 10,
|
||||
@@ -430,8 +462,14 @@ public class activityController : ApiController
|
||||
else
|
||||
qry = qry.OrderBy(o => o.status);
|
||||
}
|
||||
else
|
||||
else if (sortBy.Equals("num"))
|
||||
{
|
||||
qry = qry.OrderByDescending(o => o.num);
|
||||
}
|
||||
else
|
||||
{
|
||||
qry = qry.OrderByDescending(o => o.sort_order);
|
||||
}
|
||||
|
||||
var tdesc = publicFun.enum_desc<Model.activity.category>();
|
||||
var count = qry.Count(); //pageSize = count;//一次取回??
|
||||
@@ -1315,7 +1353,7 @@ public class activityController : ApiController
|
||||
[Route("api/activity/OrderCheckIn")]
|
||||
public IHttpActionResult OrderCheckIn([FromBody] Model.activity_check item)
|
||||
{
|
||||
if (item.f_num.HasValue && item.activity_num.HasValue && item.qty.HasValue && item.status.HasValue)
|
||||
if (item.f_num.HasValue && item.activity_num.HasValue && item.status.HasValue)
|
||||
{
|
||||
//同一天不能簽到兩次以上
|
||||
Model.activity_check check = _db.activity_check
|
||||
|
||||
@@ -4,6 +4,7 @@ using MyWeb;
|
||||
using Newtonsoft.Json;
|
||||
using PagedList;
|
||||
using System;
|
||||
using System.Activities.Expressions;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -207,7 +208,7 @@ public class orderController : ApiController
|
||||
string sortBy = "", bool sortDesc = false)
|
||||
{
|
||||
|
||||
var qry = _db.pro_order.AsQueryable();
|
||||
var qry = _db.pro_order.Include("activity").Include("activity.activity_check").AsQueryable();
|
||||
//var aIDt = _db.actItems.AsEnumerable().Where(f => f.subject.Contains(q.actItemTxt.Trim())).Select(f => f.num);//品項
|
||||
|
||||
|
||||
@@ -222,7 +223,10 @@ public class orderController : ApiController
|
||||
if (q.up_time1.HasValue)
|
||||
qry = qry.Where(o => o.up_time >= q.up_time1.Value);
|
||||
if (q.up_time2.HasValue)
|
||||
qry = qry.Where(o => o.up_time < Convert.ToDateTime(q.up_time2.Value).AddDays(1));
|
||||
{
|
||||
var tmp_up_time2 = Convert.ToDateTime(q.up_time2.Value).AddDays(1);
|
||||
qry = qry.Where(o => o.up_time < tmp_up_time2);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(q.address))
|
||||
qry = qry.Where(o => o.address.Contains(q.address.Trim()));
|
||||
if (!string.IsNullOrEmpty(q.subject))
|
||||
@@ -292,6 +296,13 @@ public class orderController : ApiController
|
||||
else
|
||||
qry = qry.OrderBy(o => o.activity != null ? o.activity.subject : "");
|
||||
}
|
||||
else if(sortBy.Equals("status"))
|
||||
{
|
||||
if (sortDesc)
|
||||
qry = qry.OrderByDescending(o => o.activity.activity_check.FirstOrDefault(a => o.activity_num == a.activity_num && o.f_num == a.f_num).status ?? 0);
|
||||
else
|
||||
qry = qry.OrderBy(o => o.activity.activity_check.FirstOrDefault(a => o.activity_num == a.activity_num && o.f_num == a.f_num).status ?? 0);
|
||||
}
|
||||
else
|
||||
qry = qry.OrderByDescending(o => o.reg_time);
|
||||
|
||||
@@ -308,6 +319,7 @@ public class orderController : ApiController
|
||||
keyin1 = x.keyin1,
|
||||
up_time = x.up_time,
|
||||
keyin1_txt = Model.pro_order.keyin1_value_to_text(x.keyin1),
|
||||
status = x.activity.activity_check.FirstOrDefault(a => x.activity_num == a.activity_num && x.f_num == a.f_num)?.status ?? 0,
|
||||
}),
|
||||
count = count
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user