Exemple #1
0
        private void ShowVibroForm(long id, bool bAdd)
        {
            //this.ShowInTaskbar = false;
            InspectionDataForm form = new InspectionDataForm(id, Inspection.InspectionType.Vibro, 0, -1);

            form.m_bShowContinueMsg = true;
            //if (!bAdd) form.m_dateForFind = DateTime.Now;
            DialogResult dr = form.ShowDialog(this);

            //this.ShowInTaskbar = true;

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                if (form.m_bContinueNext)
                {
                    List <ReportInfo.Equipment> m_listEquipments = new List <ReportInfo.Equipment>();
                    Dictionary <Inspection.InspectionType, List <ReportInfo.InspectionSubType_> > m_list_sub_types = new Dictionary <Inspection.InspectionType, List <ReportInfo.InspectionSubType_> >();
                    Dictionary <Inspection.InspectionType, List <long?> > m_dictCommonSubTypes        = new Dictionary <Inspection.InspectionType, List <long?> >();
                    Dictionary <Inspection.InspectionType, double>        m_InspectionTypeFillability = new Dictionary <Inspection.InspectionType, double>();
                    double fCommonFillability = 0;

                    m_listEquipments.Add(new ReportInfo.Equipment(id, form.m_EquipmentKindID));

                    if (!ReportInfo.GetData(-1, m_listEquipments, m_dictCommonSubTypes, m_list_sub_types, 0))
                    {
                        return;
                    }

                    fCommonFillability = ReportInfo.GetFillability(form.m_EquipmentKindID, m_listEquipments, m_dictCommonSubTypes, 0, m_InspectionTypeFillability);

                    if (Math.Abs(1.0 - fCommonFillability) > 0.0009)
                    {
                        //PrintFillabilityMessageForm f = new PrintFillabilityMessageForm();
                        //f.m_fProcent = fCommonFillability;

                        fCommonFillability = 1.0 - fCommonFillability;
                        //if (fCommonFillability < 0.01) fCommonFillability = 0.01;
                        DialogResult res = MyLocalizer.XtraMessageBoxShow("Не заполнено " + fCommonFillability.ToString("0.#%") + " данных", "Предупреждение", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, "Заполнить данные", "Сформировать протокол");

                        if (/*f.ShowDialog() == System.Windows.Forms.DialogResult.Cancel*/ res == System.Windows.Forms.DialogResult.No)
                        {
                            PrintProtocol(id, form.m_EquipmentKindID);
                        }
                        else
                        {
                            // ищем
                            foreach (Inspection.InspectionType type in Enum.GetValues(typeof(Inspection.InspectionType)))
                            {
                                if (Math.Abs(1.0 - m_InspectionTypeFillability[type]) > 0.0009)
                                {
                                    switch (type)
                                    {
                                    case Inspection.InspectionType.Vibro:
                                        ShowVibroForm(id, false);
                                        break;

                                    case Inspection.InspectionType.FHA:
                                        ShowFHAForm(id, false);
                                        break;

                                    case Inspection.InspectionType.HARG:
                                        ShowHARGForm(id, false);
                                        break;

                                    case Inspection.InspectionType.Visual:
                                        ShowVisualForm(id, false);
                                        break;

                                    case Inspection.InspectionType.Warm:
                                        ShowWarmForm(id, false);
                                        break;
                                    }
                                    return;
                                }
                            }
                        }
                    }
                    else
                    {
                        PrintProtocol(id, form.m_EquipmentKindID);
                    }
                }
                else
                {
                    if (form.m_bContinuePrev)
                    {
                        ShowWarmForm(id, false);
                    }
                }
            }
        }