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 定义项 /// /// 批主键 /// public string PointBatchId { get { return (string)ViewState["PointBatchId"]; } set { ViewState["PointBatchId"] = value; } } #endregion #region 加载页面 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.PointBatchId = Request.Params["PointBatchId"]; this.BindGrid(); } } #endregion #region 数据绑定 /// /// 数据绑定 /// private void BindGrid() { List 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 排序 /// /// 排序 /// /// /// protected void Grid1_Sort(object sender, GridSortEventArgs e) { this.BindGrid(); } #endregion #region 确定按钮 /// /// 确定按钮 /// /// /// 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 } }