private void PrintProtocol(long id, long EquipmentKindID) { WaitingForm wf = new WaitingForm(Inspection.ReportType.ProtocolTransformer); ReportInfo.Equipment eq = new ReportInfo.Equipment(id, EquipmentKindID); wf.m_listEquipments.Add(eq); wf.ShowDialog(this); }
private void bActivation_Click(object sender, EventArgs e) { bool bPrint = false; List <Word> listWord = new List <Word>(); for (int i = 0; i < listModules.Count; i++) { if (listModules[i].CHECK) { WaitingForm wf = new WaitingForm(); switch ((Equipment.EquipmentKind)listModules[i].ID) { case Equipment.EquipmentKind.Transformer: wf.m_reportType = Inspection.ReportType.ReportTransformer; break; case Equipment.EquipmentKind.AirSwitch: wf.m_reportType = Inspection.ReportType.ReportAirSwitch; break; case Equipment.EquipmentKind.OilLessSwitch: wf.m_reportType = Inspection.ReportType.ReportOilLessSwitch; break; case Equipment.EquipmentKind.OilTankSwitch: wf.m_reportType = Inspection.ReportType.ReportOilTankSwitch; break; default: MyLocalizer.XtraMessageBoxShow("Отчет для данного вида оборудования недоступен.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } wf.m_listEquipments = m_dictEquipments[listModules[i].ID]; wf.m_CheckID = m_CheckID; wf.ShowDialog(this); if (wf.m_Word != null) { listWord.Add(wf.m_Word); } bPrint = true; } } if (!bPrint) { MyLocalizer.XtraMessageBoxShow("Необходимо выбрать хотя бы один вид отчета.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } for (int i = 0; i < listWord.Count; i++) { listWord[i].SetVisible(true); listWord[i].DestroyWord(); } DialogResult = System.Windows.Forms.DialogResult.OK; Close(); }