//修改信息 private void dvM_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= 0 && dsFire.Tables[0].Rows.Count > 0) { bsFire.Position = e.RowIndex; LadleFireShowFrm Frm = new LadleFireShowFrm(); Frm.ShowDialogEx(Adapter.Session, strSort, bsFire.Position, ref dsFire); GC.Collect(); } }
//新增信息 private void btnAdd_Click(object sender, EventArgs e) { try { 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 = dsFire.Tables[0].NewRow(); newrow["Input_Time"] = DateTime.Now; newrow["Fire_Type"] = ""; newrow["Roaster_ID"] = ""; newrow["LadleID"] = ""; newrow["Start_Time"] = DateTime.Now; newrow["Start_Operator"] = ""; // newrow["Set_One_Time"] = DateTime.Now; newrow["Set_One_Operator"] = ""; // newrow["Set_Two_Time"] = DateTime.Now; newrow["Set_Two_Operator"] = ""; // newrow["Set_Three_Time"] = DateTime.Now; newrow["Set_Three_Operator"] = ""; // newrow["Set_Four_Time"] = DateTime.Now; newrow["Set_Four_Operator"] = ""; // newrow["End_Time"] = DateTime.Now; newrow["End_Operator"] = ""; // newrow["Suspend_Time"] = DateTime.Now; newrow["Suspend_Operator"] = ""; if (objShiftID != null && objTeamID != null) { newrow["TeamID"] = objTeamID.ToString(); newrow["ShiftID"] = objShiftID.ToString(); } newrow["Operator"] = Adapter.Session.User; newrow["Note"] = ""; dsFire.Tables[0].Rows.Add(newrow); bsFire.MoveFirst(); while (((System.Data.DataRowView)(bsFire.Current)).Row != newrow && bsFire.Position != dsFire.Tables[0].Rows.Count - 1) { bsFire.MoveNext(); } LadleFireShowFrm Frm = new LadleFireShowFrm(); Frm.ShowDialogEx(Adapter.Session, strSort, bsFire.Position, ref dsFire); GC.Collect(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "异常", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }