98 lines
3.0 KiB
C#
98 lines
3.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using BLL;
|
|
|
|
namespace FineUIPro.Web.WeldingProcess.TrustManage
|
|
{
|
|
public partial class ShowPointClose : PageBase
|
|
{
|
|
#region 定义项
|
|
/// <summary>
|
|
/// 批主键
|
|
/// </summary>
|
|
public string PointBatchId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["PointBatchId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["PointBatchId"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载页面
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.PointBatchId = Request.Params["PointBatchId"];
|
|
this.BindGrid();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 数据绑定
|
|
/// <summary>
|
|
/// 数据绑定
|
|
/// </summary>
|
|
private void BindGrid()
|
|
{
|
|
List<Model.View_Batch_PointBatchItem> toDoMatterList = BLL.Batch_PointBatchItemService.GetViewPointBatchItemByPointBatchId(this.PointBatchId);
|
|
DataTable tb = this.LINQToDataTable(toDoMatterList);
|
|
// 2.获取当前分页数据
|
|
//var table = this.GetPagedDataTable(GridNewDynamic, tb1);
|
|
Grid1.RecordCount = tb.Rows.Count;
|
|
var table = this.GetPagedDataTable(Grid1, tb);
|
|
|
|
Grid1.DataSource = table;
|
|
Grid1.DataBind();
|
|
}
|
|
#endregion
|
|
|
|
#region 排序
|
|
/// <summary>
|
|
/// 排序
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
{
|
|
this.BindGrid();
|
|
}
|
|
#endregion
|
|
|
|
#region 确定按钮
|
|
/// <summary>
|
|
/// 确定按钮
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnAccept_Click(object sender, EventArgs e)
|
|
{
|
|
string[] selectRowId = Grid1.SelectedRowIDArray;
|
|
if (selectRowId.Count() > 0)
|
|
{
|
|
foreach (var item in selectRowId)
|
|
{
|
|
BLL.Batch_PointBatchItemService.UpdatePointBatchItem(item, "1", DateTime.Now.Date, null);
|
|
}
|
|
|
|
BLL.Batch_PointBatchService.UpdatePointBatch(this.PointBatchId, DateTime.Now.Date);
|
|
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnPointClose, this.PointBatchId);
|
|
}
|
|
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
}
|
|
#endregion
|
|
}
|
|
} |