//编辑选中行 protected void ButtonUpdate_Click(object sender, EventArgs e) { try { if (pm.GridCount(Grid_Files, CBoxSelect).Count() != 0) { if (pm.GridCount(Grid_Files, CBoxSelect).Count() == 1) { int rowID = Convert.ToInt32(Grid_Files.DataKeys[pm.GridCount(Grid_Files, CBoxSelect)[0]][0]); Session["FileID"] = rowID; Alert.Show("你确定要修改该行数据吗!", "确认消息", MessageBoxIcon.Information, Window_Update.GetShowReference("Update_File.aspx", "编辑文件信息"), Target.Top); } else { Alert.Show("一次仅可以对一行进行编辑!"); } } else { Alert.Show("请选择一行!"); } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
//编辑选中行 protected void btnUpdate_Click(object sender, EventArgs e) { try { List <int> selections = new List <int>(); for (int i = 0; i < Grid_NAReporting.RecordCount; i++) { if (CBoxSelect.GetCheckedState(i)) { selections.Add(i); } } if (selections.Count() != 0) { if (selections.Count() == 1) { int rowID = Convert.ToInt32(Grid_NAReporting.DataKeys[selections[0]][0]); Session["NewAcademicReportingID"] = rowID; Alert.Show("你确定要修改该行数据吗!", "确认消息", MessageBoxIcon.Information, Window_Update.GetShowReference("UpdateNAReporting.aspx", "编辑报告信息"), Target.Top); } else { Alert.Show("一次仅可以对一行进行编辑!"); } } else { Alert.Show("请选择一行!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//编辑选中行 protected void btnUpdate_Click(object sender, EventArgs e) { try { int m; //取整数(不是四舍五入,全舍) int Pages = (int)Math.Floor(Convert.ToDouble(Grid_LibraryRecord_Pact.RecordCount / this.Grid_LibraryRecord_Pact.PageSize)); List <int> selections = new List <int>(); if (Grid_LibraryRecord_Pact.PageIndex == Pages) { m = (Grid_LibraryRecord_Pact.RecordCount - this.Grid_LibraryRecord_Pact.PageSize * Grid_LibraryRecord_Pact.PageIndex); } else { m = this.Grid_LibraryRecord_Pact.PageSize; } for (int i = 0; i < m; i++) { if (BoxSelect_PactRecord.GetCheckedState(i)) { selections.Add(i); } } if (selections.Count() != 0) { if (selections.Count() == 1) { int rowID = Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[selections[0]][0]); Session["LibraryRecordID"] = rowID; Alert.Show("你确定要修改该行数据吗!", "确认消息", MessageBoxIcon.Information, Window_Update.GetShowReference("Update_PactRecord.aspx", "编辑借阅记录信息"), Target.Top); } else { Alert.Show("一次仅可以对一行进行编辑!"); } } else { Alert.Show("请选择一行!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }
//编辑选中行 protected void ButtonUpdate_Click(object sender, EventArgs e) { try { List <int> selections = publicmethod.GridCount(Grid_Platform, CBoxSelect); if (selections.Count() != 0) { if (selections.Count() == 1) { int rowID = Convert.ToInt32(Grid_Platform.DataKeys[selections[0]][0]); Session["PlatformID"] = rowID; Alert.Show("你确定要修改该行数据吗!", "确认消息", MessageBoxIcon.Information, Window_Update.GetShowReference("UpdatePlatform.aspx", "编辑平台信息"), Target.Top); } else { Alert.Show("一次仅可以对一行进行编辑!"); } } else { Alert.Show("请选择一行!"); } } catch (Exception ex) { BLCommon.PublicMethod pm = new BLCommon.PublicMethod(); pm.SaveError(ex, this.Request); } }