提交代码
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -36,13 +37,13 @@ namespace FineUIPro.Web.Personal
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT trip.BusinessTripId,trip.ProjectId,trip.UserId,trip.ArriveDate,trip.LeaveDate,Users.UserName,Project.ProjectName,case trip.Type when '1' then '项目出差' when '2' then '其他出差' else '' end AS TypeStr "
|
||||
string strSql = @"SELECT trip.BusinessTripId,trip.ProjectId,trip.UserId,trip.ArriveDate,trip.LeaveDate,Users.UserName,Project.ProjectName,case trip.Type when '1' then '项目出差' when '2' then '其他出差' else '' end AS TypeStr,case when trip.ArriveDate is not null and trip.LeaveDate is not null then cast(DATEDIFF(day,trip.ArriveDate,trip.LeaveDate)+1 as nvarchar(10)) else '' end AS Days "
|
||||
+ @" From dbo.Person_BusinessTrip AS trip"
|
||||
+ @" LEFT JOIN Sys_User AS Users ON Users.UserId=trip.UserId"
|
||||
+ @" LEFT JOIN Base_Project AS Project ON Project.ProjectId=trip.ProjectId"
|
||||
+ @" WHERE 1=1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (this.rblType.SelectedValue!="0")
|
||||
if (this.rblType.SelectedValue != "0")
|
||||
{
|
||||
strSql += " AND trip.Type = @Type";
|
||||
listStr.Add(new SqlParameter("@Type", this.rblType.SelectedValue));
|
||||
@@ -71,6 +72,16 @@ namespace FineUIPro.Web.Personal
|
||||
{
|
||||
this.Grid1.Columns[3].Hidden = true;
|
||||
}
|
||||
int days = 0;
|
||||
foreach (DataRow row in table.Rows)
|
||||
{
|
||||
days += Funs.GetNewIntOrZero(row["Days"].ToString());
|
||||
}
|
||||
|
||||
JObject summary = new JObject();
|
||||
summary.Add("LeaveDate", "合计:");
|
||||
summary.Add("Days", days);
|
||||
Grid1.SummaryData = summary;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user