/// <summary> /// 分 页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bdnInfo_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Name == "tslSelectAll")//全选 { tslSelectAll_Click(); return; } if (e.ClickedItem.Name == "tslNotSelect")//取消全选 { tslNotSelect_Click(); return; } //查看详情 if (e.ClickedItem.Name == "tslDetails") { //int Id = this.dgvCarStatisticsQC.SelectedRows[0].Cells["QCInfo_ID"].RowIndex; //iQcInfoID = Id; //if (iQcInfoID > 0) //{ // UpdateQCDetailsForm frm = new UpdateQCDetailsForm(); // frm.Owner = this; // frm.iqcinfoid = iQcInfoID; // frm.Show(); //} //else //{ // MessageBox.Show("选中行的质检编号不能为空", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} if (this.dgvCarStatisticsQC.SelectedRows.Count > 0) // 判断是否选中 { if (dgvCarStatisticsQC.SelectedRows.Count > 1) // 判断收选中多行 { MessageBox.Show("查看详细只能选中一行!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { int Id = Convert.ToInt32(this.dgvCarStatisticsQC.SelectedRows[0].Cells["QCInfo_ID"].Value); iQcInfoID = Id; if (iQcInfoID > 0) { UpdateQCDetailsForm frm = new UpdateQCDetailsForm(); frm.Owner = this; frm.iqcinfoid = iQcInfoID; frm.Show(); } else { MessageBox.Show("选中行的质检编号不能为空", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } else { MessageBox.Show("请选择要查看详细的行!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } this.dgvCarStatisticsQC.DataSource = page.BindBoundControl <View_QCInfo>(e.ClickedItem.Name, txtCurrentPage2, lblPageCount2, expr, orderbywhere); }
/// <summary> /// 分 页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bdnInfo_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Name == "tslSelectAll")//全选 { tslSelectAll_Click(); return; } if (e.ClickedItem.Name == "tslNotSelect")//取消全选 { tslNotSelect_Click(); return; } //查看详情 if (e.ClickedItem.Name == "tslDetails") { //int Id = this.dgvCarStatisticsQC.SelectedRows[0].Cells["QCInfo_ID"].RowIndex; //iQcInfoID = Id; //if (iQcInfoID > 0) //{ // UpdateQCDetailsForm frm = new UpdateQCDetailsForm(); // frm.Owner = this; // frm.iqcinfoid = iQcInfoID; // frm.Show(); //} //else //{ // MessageBox.Show("选中行的质检编号不能为空", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} if (this.dgvCarStatisticsQC.SelectedRows.Count > 0) // 判断是否选中 { if (dgvCarStatisticsQC.SelectedRows.Count > 1) // 判断收选中多行 { MessageBox.Show("查看详细只能选中一行!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { iQcInfoID = 0; if (this.dgvCarStatisticsQC.SelectedRows[0].Cells["QCInfo_ID"].Value != null) { int.TryParse(this.dgvCarStatisticsQC.SelectedRows[0].Cells["QCInfo_ID"].Value.ToString(), out iQcInfoID); } if (iQcInfoID > 0) { UpdateQCDetailsForm frm = new UpdateQCDetailsForm(); frm.Owner = this; frm.iqcinfoid = iQcInfoID; frm.Show(); } else { MessageBox.Show("选中行的质检编号不能为空", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } else { MessageBox.Show("请选择要查看详细的行!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } LoadData(e.ClickedItem.Name); }