Merge remote-tracking branch 'origin/0.1' into dapper
# Conflicts: # web/App_Code/Model/Model.Designer.cs # web/App_Code/Model/Model.cs # web/App_Code/Model/Model.edmx # web/web.config
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
using System;
|
||||
using DocumentFormat.OpenXml.Drawing.Charts;
|
||||
using Model;
|
||||
using MyWeb;
|
||||
using Newtonsoft.Json;
|
||||
using PagedList;
|
||||
using System;
|
||||
using System.Activities.Expressions;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IdentityModel.Metadata;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using PagedList;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using static TreeView;
|
||||
using Model;
|
||||
using System.IdentityModel.Metadata;
|
||||
using MyWeb;
|
||||
using DocumentFormat.OpenXml.Drawing.Charts;
|
||||
|
||||
|
||||
// api/order
|
||||
@@ -206,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);//品項
|
||||
|
||||
|
||||
@@ -221,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))
|
||||
@@ -291,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);
|
||||
|
||||
@@ -307,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
|
||||
};
|
||||
@@ -684,7 +697,7 @@ public class orderController : ApiController
|
||||
.Where(q => q.num == item.num)
|
||||
.FirstOrDefault();//修改
|
||||
if (order != null)
|
||||
{
|
||||
{
|
||||
order.actItem_num = (item.actItem_num.HasValue && item.actItem_num.Value > 0)
|
||||
? item.actItem_num : null;
|
||||
order.f_num = (item.f_num.HasValue && item.f_num.Value > 0)
|
||||
|
||||
Reference in New Issue
Block a user