private void dvDetail_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0 && dsDetail.Tables[0].Rows.Count > 0) { bsDetail.Position = e.RowIndex; VacTubeUseInfoShowFrm FrmDetail = new VacTubeUseInfoShowFrm(); FrmDetail.ShowDialogEx(Adapter.Session, bsDetail.Position, strSortDetail, ref dsDetail); GC.Collect(); } }
private void btnAddDetail_Click(object sender, EventArgs e) { try { if (strInstallID == "") { return; } Adapter.Session.Get(CommDataMag.CommonData.CCURRENT_SHIFT_INFO_OBJ, "ShiftID", ref objShiftID); Adapter.Session.Get(CommDataMag.CommonData.CCURRENT_SHIFT_INFO_OBJ, "TeamID", ref objTeamID); //添加一行数据,对相应数据进行填充 DataRow newrow = dsDetail.Tables[0].NewRow(); newrow["Input_Time"] = DateTime.Now; newrow["Install_ID"] = strInstallID; newrow["Position"] = strPosition; newrow["VacTube_Code"] = strVacTubeCode; newrow["Up_Slot_ID"] = strUpID; newrow["Bel_Slot_ID"] = strDownID; if (objShiftID != null && objTeamID != null) { newrow["TeamID"] = objTeamID.ToString(); newrow["ShiftID"] = objShiftID.ToString(); } dsDetail.Tables[0].Rows.Add(newrow); bsDetail.MoveFirst(); while ((bsDetail.Current as System.Data.DataRowView).Row != newrow || bsDetail.Position < dsDetail.Tables[0].Rows.Count - 1) { bsDetail.MoveNext(); } VacTubeUseInfoShowFrm FrmDetail = new VacTubeUseInfoShowFrm(); FrmDetail.ShowDialogEx(Adapter.Session, bsDetail.Position, strSortDetail, ref dsDetail); GC.Collect(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }