提交代码
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.TestRun.Produce
|
||||
{
|
||||
public partial class TailTermHandleList : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
//绑定数据
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
#region 绑定数据
|
||||
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
string strSql = @"select a.TailTermId,a.ProjectId,d.ProjectCode,d.ProjectName,a.TailTermCode,a.ConstructionUnit,b.UnitName,a.SubInspectId,a.TermItemId,c.WorkInspectName,a.QuestionDesc,a.RectifyTime,a.RectifyOpinion,a.InspectUser,e.UserName as InspectUserName,a.ApproveUser,f.UserName as ApproveUserName,a.HandleUser,g.UserName as HandleUserName,a.ApproveState,(case a.ApproveState when 0 then '待提交处理' when 1 then '待处理' when 2 then '处理退回' when 3 then '审核退回' when 4 then '待审核' when 5 then '审核通过' else '' end) as ApproveStateName,a.AddTime,a.AdjustCompleteTime,DATEDIFF(DAY, GETDATE(),a.AdjustCompleteTime) as AdjustDiffDay from ProduceRun_InspectTailTerm as a inner join Base_Unit as b on a.ConstructionUnit=b.UnitId inner join ProduceRun_SubInspectTermItem as c on c.TermItemId=a.TermItemId inner join Base_Project as d on d.ProjectId=a.ProjectId inner join Sys_User as e on e.UserId=a.InspectUser inner join Sys_User as f on f.UserId=a.ApproveUser inner join Sys_User as g on g.UserId=a.HandleUser where 1=1 and a.ProjectId=@projectid and a.HandleUser=@HandleUser and a.ApproveState>=1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectid", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@HandleUser", this.CurrUser.UserId));
|
||||
//审核状态
|
||||
if (!string.IsNullOrWhiteSpace(ddlApproveState.SelectedValue))
|
||||
{
|
||||
strSql += " and a.ApproveState=@ApproveState";
|
||||
listStr.Add(new SqlParameter("@ApproveState", ddlApproveState.SelectedValue));
|
||||
}
|
||||
strSql += " order by a.AddTime asc";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 双击事件
|
||||
/// </summary>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
btnMenuApprove_Click(null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页下拉框
|
||||
/// </summary>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 按钮
|
||||
|
||||
/// <summary>
|
||||
/// 关闭弹框
|
||||
/// </summary>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理
|
||||
/// </summary>
|
||||
protected void btnReview_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnMenuApprove_Click(null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理
|
||||
/// </summary>
|
||||
protected void btnMenuApprove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var passLs = new List<int>() { 1, 3 };
|
||||
var model = Funs.DB.ProduceRun_InspectTailTerm.FirstOrDefault(x => x.TailTermId == Grid1.SelectedRowID);
|
||||
if (model != null)
|
||||
{
|
||||
if (!passLs.Contains(model.ApproveState.Value))
|
||||
{
|
||||
Alert.ShowInTop("只可处理“待处理”和“审核退回”的记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TailTermHandle.aspx?TailTermId={0}", Grid1.SelectedRowID, "审核 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
protected void btnQuery_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user