private void VG_combo_SelectedIndexChanged(object sender, EventArgs e) { if (CanDo) { Marks_Grid.Invalidate(); } }
private void Year_Box_TextChanged(object sender, EventArgs e) { if (CanDo) { CanDo = false; DataBase.NoABC_Int_Dinamic(Year_Box); uint PodrID, OID; if (Podr_combo.SelectedIndex < 1) { PodrID = 0; this.Text = "Средние показатели за " + Year_Box.Text + " г."; } else { PodrID = PodrIDs[Podr_combo.SelectedIndex - 1]; this.Text = "Средние показатели за " + Year_Box.Text + " г. подразделение: " + T.Podr.Rows.Get <string>(PodrID, C.Podr.ShrName); } if (Obj_combo.SelectedIndex < 1) { OID = 0; } else { OID = this.ObjectIDs[Obj_combo.SelectedIndex - 1]; this.Text += ", вода: " + T.Object.Rows.Get <string>(OID, C.Object.Name); } Marks = new Misc.MiddleMarks_class(Convert.ToInt16(Year_Box.Text), PodrID, OID); Marks_Grid.RowCount = Marks.MarkCount + 1; for (int i = 0; i < Marks.MarkCount; i++) { switch ((data.VarType)T.Mark.Rows.Get_UnShow <uint>(Marks.MarkID(i), C.Mark.VarType)) { case data.VarType.Bool: Marks_Grid.Rows[i].DefaultCellStyle.Format = ""; break; case data.VarType.dbl: case data.VarType.i32: if (T.Mark.Rows.Get_UnShow <bool>(Marks.MarkID(i), C.Mark.Exp)) { if (T.Mark.Rows.Get <int>(Marks.MarkID(i), C.Mark.Round) > 0) { Marks_Grid.Rows[i].DefaultCellStyle.Format = 'E' + T.Mark.Rows.Get <string>(Marks.MarkID(i), C.Mark.Round); } else { Marks_Grid.Rows[i].DefaultCellStyle.Format = "E"; } } else { if (T.Mark.Rows.Get <int>(Marks.MarkID(i), C.Mark.Round) > 0) { Marks_Grid.Rows[i].DefaultCellStyle.Format = 'F' + T.Mark.Rows.Get <string>(Marks.MarkID(i), C.Mark.Round); } else { Marks_Grid.Rows[i].DefaultCellStyle.Format = "F"; } } break; } } Marks_Grid.Invalidate(); CanDo = true; } }