Exemplo n.º 1
0
        private void UpdateDataGridFromCollection(int rowNumber)
        {
            try
            {
                if (rowNumber >= 0 && rowNumber <= sverPDataGrid.Rows.Count - 1)
                {
                    if (checkGroup.SelectedIndex > -1)
                    {
                        int ind = FunctionUse.FindIndById(sveraGr.NogroupList, sveraGr.Detalized[checkGroup.SelectedIndex].GridGroupId[rowNumber].Id);

                        if (ind > -1)
                        {
                            sverPDataGrid.Rows[rowNumber].Cells[SveraGr.EdIzm].Value = sveraGr.NogroupList[ind].EdIzm;
                            sverPDataGrid.Rows[rowNumber].Cells[SveraGr.Enum].Value  = sveraGr.Detalized[checkGroup.SelectedIndex].GridGroupId[rowNumber].Kolic;
                            sverPDataGrid.Rows[rowNumber].Cells[SveraGr.Naim].Value  = sveraGr.NogroupList[ind].GetNaim(false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                MessageBox.Show(ex.StackTrace);
                if (ex.InnerException != null)
                {
                    MessageBox.Show(ex.InnerException.ToString());
                }
            }
        }
Exemplo n.º 2
0
 private void sverPDataGrid_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
 {
     try
     {
         FunctionUse.sverPDataGrid_CellValidating(sverPDataGrid, e, load);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         MessageBox.Show(ex.StackTrace);
     }
 }
Exemplo n.º 3
0
 private void sverPDataGrid_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
 {
     try
     {
         FunctionUse.sverPDataGrid_EditingControlShowing(sverPDataGrid, e, objectEditDataGrid);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         MessageBox.Show(ex.StackTrace);
     }
 }
Exemplo n.º 4
0
        private void updateCom()
        {
            load = false;
            string[] otdelar  = null;
            string[] postavar = null;
            string[] vzrivar  = null;
            string[] klimatar = null;
            string[] ipar     = null;

            FunctionUse.ChangeComboInBase(SveraB.DataBaseList, FilterTipPostav, FilterTipOborud, FilterEdIzm, FilterPostav, FilterVzriv, FilterKlimat, FilterOtdel, FilterIp, ref otdelar, ref postavar, ref vzrivar, ref klimatar, ref ipar);


            for (int i = 0; i <= SveraB.RowNamesShort.Count - 1; i++)
            {
                if (sverPDataGrid.Rows[i].Tag.ToString() == SveraParam.RowsDatagridNames.otdel ||
                    sverPDataGrid.Rows[i].Tag.ToString() == SveraParam.RowsDatagridNames.klimat ||
                    sverPDataGrid.Rows[i].Tag.ToString() == SveraParam.RowsDatagridNames.vzriv ||
                    sverPDataGrid.Rows[i].Tag.ToString() == SveraParam.RowsDatagridNames.postav)
                {
                    DataGridViewComboBoxCell cc = new DataGridViewComboBoxCell();
                    cc.FlatStyle = FlatStyle.Flat;

                    if (SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.otdel && otdelar != null)
                    {
                        cc.Items.AddRange(otdelar);
                    }
                    else if (SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.postav && postavar != null)
                    {
                        cc.Items.AddRange(postavar);
                    }
                    else if (SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.klimat && klimatar != null)
                    {
                        cc.Items.AddRange(klimatar);
                    }
                    else if (SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.vzriv && vzrivar != null)
                    {
                        cc.Items.AddRange(vzrivar);
                    }

                    cc.Value = sverPDataGrid.Rows[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index].Value;
                    sverPDataGrid.Rows[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index] = cc;
                }
            }

            load = true;
        }
Exemplo n.º 5
0
        public static bool UpdateMode()
        {
            bool   updateMode = false;
            string putDoVers  = Path.GetDirectoryName(Path.GetDirectoryName(FunctionUse.GetDataBasePath())) + "\\version.txt";;
            string vers       = "";

            if (File.Exists(putDoVers) == true)
            {
                string[] lines = System.IO.File.ReadAllLines(putDoVers);
                if (lines != null)
                {
                    vers = lines[0];
                }
            }

            if (vers != null && vers != "" && vers != System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString())
            {
                updateMode = true;
                MessageBox.Show("Текущая версия устарела " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + ". Будет произведено обновление до версии " + vers, "Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(updateMode);
        }
Exemplo n.º 6
0
        public BaseChoose(SveraParam SveraP)
        {
            InitializeComponent();

            try
            {
                //   SetDoubleBuffered(CableData, True);


                this.SveraP = SveraP;

                if (Svera.Properties.Settings.Default.BaseSize != new Size(0, 0))
                {
                    this.Size = Svera.Properties.Settings.Default.BaseSize;
                }
                if (Svera.Properties.Settings.Default.BaseLocation != new Point(0, 0))
                {
                    this.Location = Svera.Properties.Settings.Default.BaseLocation;
                }



                dataBaseList = FunctionUse.LoadFromDataBase();
                // if (dataBaseList.Count > 0)
                // {
                // string[] BaseArray = dataBaseList.ConvertAll<string>(x => x.ToString()).ToArray();

                // ComboDate.Items.(BaseArray);
                //ComboDate.DataSource = dataBaseList;
                //ComboDate.SelectedIndex = 0;
                //  }

                if (SveraP.ColList.Count > 0)
                {
                    DataGridViewColumn[] dataGridColSver = new DataGridViewColumn[SveraP.ColList.Count - 1];
                    ColumnNames          colName;

                    for (int i = 0; i <= SveraP.ColList.Count - 1; i++)
                    {
                        colName = SveraP.ColList[i];
                        if (colName.nameColumn != SveraParam.ColDatagridNames.Redact)
                        {
                            dataGridColSver[i]            = new DataGridViewTextBoxColumn();
                            dataGridColSver[i].Name       = colName.nameColumn;
                            dataGridColSver[i].HeaderText = colName.textColumn;
                            dataGridColSver[i].SortMode   = DataGridViewColumnSortMode.NotSortable;
                            if (i == 0)
                            {
                                dataGridColSver[i].ReadOnly = true;
                            }
                        }
                    }

                    sverPDataGrid.Columns.AddRange(dataGridColSver);

                    sverPDataGrid.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
                    sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
                }

                if (SveraP.RowList.Count > 0)
                {
                    DataGridViewRow[] dataGridRowSver = new DataGridViewRow[SveraP.RowNamesShort.Count];
                    RowsNames         rowName;

                    for (int i = 0; i <= SveraP.RowNamesShort.Count - 1; i++)
                    {
                        rowName = SveraP.RowNamesShort[i];
                        if (rowName.extended == false)
                        {
                            dataGridRowSver[i] = new DataGridViewRow();
                            dataGridRowSver[i].CreateCells(sverPDataGrid);

                            //if (SveraP.RowList[i].dataCellType == typeof(DataGridViewComboBoxCell))
                            //{
                            //    DataGridViewComboBoxCell cc = new DataGridViewComboBoxCell();
                            //    cc.FlatStyle = FlatStyle.Flat;
                            //    cc.Items.AddRange(SveraP.RowList[i].ArrayValue);
                            //    dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index] = cc;
                            //}
                            dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Parametr].Index].Value = SveraP.RowNamesShort[i].textRow;
                            // dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index].Value = SveraP.RowList[i].NullValue;
                            dataGridRowSver[i].Tag = SveraP.RowNamesShort[i].nameRow;

                            if (i == 0)
                            {
                                dataGridRowSver[i].ReadOnly = true;
                            }
                        }
                    }
                    string[] mas = null;
                    FunctionUse.ChangeComboInBase(dataBaseList, FilterTipPostav, FilterTipOborud, FilterEdIzm, FilterPostav, FilterVzriv, FilterKlimat, FilterOtdel, FilterIp, ref mas, ref mas, ref mas, ref mas, ref mas);


                    sverPDataGrid.Rows.AddRange(dataGridRowSver);
                }
                ChangeFilter();
                if (SveraP.FromDataBaseWideForSvera.IdBase != 0)
                {
                    int ind = dataBaseList.FindIndex(d => (d.IdBase == SveraP.FromDataBaseWideForSvera.IdBase));
                    if (ind > -1)
                    {
                        ComboDate.SelectedIndex = ind;
                    }
                }
                ChangeSpec();
                SizeChange();

                load = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                MessageBox.Show(ex.StackTrace);
                if (ex.InnerException != null)
                {
                    MessageBox.Show(ex.InnerException.ToString());
                }
            }
        }
Exemplo n.º 7
0
        public WordSpecExport(CopyToClipboard cpc, BackgroundWorker ExportWorker, string filename)
        {
            Microsoft.Office.Interop.Word.Application  oWord  = null;
            Microsoft.Office.Interop.Excel.Application oExcel = null;


            try
            {
                List <SveraClass.FromDataBaseWide> rowgrid = SveraCl.PereformSpec(cpc, TypeOfExport.WordSpec);

                // return;

                int maxofprog = rowgrid.Count + 2 * 8;
                maxofprog += rowgrid.Count;
                int counter = 0;
                ExportWorker.ReportProgress(maxofprog, Operation.init);

                string exportPath = FunctionUse.GetExportPath(filename);
                try
                {
                    exportPath += "\\";
                    exportPath += (filename != null && filename != "") ? Path.GetFileNameWithoutExtension(filename) : "specification";
                    exportPath += ".docx";
                    if (cpc.ExportP.TipSpec == SveraExportParam.RowsDatagridExportNames.TipSpecAndVed.standart)
                    {
                        File.WriteAllBytes(exportPath, SveraExport.Properties.Resources.Specification);
                    }
                    else if (cpc.ExportP.TipSpec == SveraExportParam.RowsDatagridExportNames.TipSpecAndVed.rev)
                    {
                        File.WriteAllBytes(exportPath, SveraExport.Properties.Resources.specification_del);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Файл открыт и используется. Закройте файл и повторите попытку", "Svera Export Word", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                Microsoft.Office.Interop.Word.Document   oDoc;
                Microsoft.Office.Interop.Excel.Workbook  oBook;
                Microsoft.Office.Interop.Excel.Worksheet oSheet;
                //Microsoft.Office.Interop.Word.Table oTable;
                //Microsoft.Office.Interop.Word.Paragraph oPara1;


                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    ExitWord(oWord, oExcel, true);
                    return;
                }



                try
                {
                    oWord  = new Microsoft.Office.Interop.Word.Application();
                    oDoc   = oWord.Documents.Open(exportPath);
                    oExcel = new Microsoft.Office.Interop.Excel.Application();
                    oBook  = oExcel.Workbooks.Add();
                    oSheet = oExcel.Worksheets[1];

                    podgotovWord(oWord, oExcel, false, false);

                    oDoc.SaveAs(exportPath);
                    oBook.SaveAs(Path.GetDirectoryName(exportPath) + "\\" + Path.GetFileNameWithoutExtension(exportPath) + ".xlsx");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Файл " + Path.GetDirectoryName(exportPath) + "\\" + Path.GetFileNameWithoutExtension(exportPath) + " уже открыт. Закройте файл. Повторите попытку", "Svera Export Word", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ExitWord(oWord, oExcel, true);
                    return;
                }


                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    ExitWord(oWord, oExcel, true);
                    return;
                }



                oSheet.PageSetup.Orientation = Microsoft.Office.Interop.Excel.XlPageOrientation.xlLandscape;
                oDoc.PageSetup.Orientation   = Microsoft.Office.Interop.Word.WdOrientation.wdOrientLandscape;
                oDoc.AutoHyphenation         = true;

                oDoc.Content.Font.Name = "Times New Roman";
                oDoc.Content.Font.Size = 10;

                int numberCOl = 9;
                if (cpc.ExportP.TipSpec == SveraExportParam.RowsDatagridExportNames.TipSpecAndVed.standart)
                {
                    numberCOl = 9;
                }
                else if (cpc.ExportP.TipSpec == SveraExportParam.RowsDatagridExportNames.TipSpecAndVed.rev)
                {
                    numberCOl = 11;
                }

                string[,] OtableStr = new string[rowgrid.Count, numberCOl];

                if (cpc.ExportP.TipSpec == SveraExportParam.RowsDatagridExportNames.TipSpecAndVed.standart)
                {
                    oSheet.Columns[1].ColumnWidth = 5;
                    oSheet.Columns[2].ColumnWidth = 30;
                    oSheet.Columns[3].ColumnWidth = 20;
                    oSheet.Columns[4].ColumnWidth = 12;
                    oSheet.Columns[5].ColumnWidth = 15;
                    oSheet.Columns[6].ColumnWidth = 5;
                    oSheet.Columns[7].ColumnWidth = 7;
                    oSheet.Columns[8].ColumnWidth = 8;
                    oSheet.Columns[9].ColumnWidth = 15;
                }
                else if (cpc.ExportP.TipSpec == SveraExportParam.RowsDatagridExportNames.TipSpecAndVed.rev)
                {
                    oSheet.Columns[1].ColumnWidth  = 5;
                    oSheet.Columns[2].ColumnWidth  = 30;
                    oSheet.Columns[3].ColumnWidth  = 20;
                    oSheet.Columns[4].ColumnWidth  = 8;
                    oSheet.Columns[5].ColumnWidth  = 8;
                    oSheet.Columns[6].ColumnWidth  = 10;
                    oSheet.Columns[7].ColumnWidth  = 8;
                    oSheet.Columns[8].ColumnWidth  = 8;
                    oSheet.Columns[9].ColumnWidth  = 8;
                    oSheet.Columns[10].ColumnWidth = 8;
                    oSheet.Columns[11].ColumnWidth = 12;
                }


                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    ExitWord(oWord, oExcel, true);
                    return;
                }

                int numberRow = 0;
                for (int i = 0; i <= rowgrid.Count - 1; i++)
                {
                    addrowInSpec(cpc, rowgrid[i], OtableStr, oSheet, ref numberRow);
                }

                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    ExitWord(oWord, oExcel, true);
                    return;
                }

                if (rowgrid.Count > 0)
                {
                    Microsoft.Office.Interop.Excel.Range rangeEx = oSheet.Range[oSheet.Cells[1, 1], oSheet.Cells[OtableStr.GetUpperBound(0) + 1, OtableStr.GetUpperBound(1) + 1]];
                    rangeEx.Value     = OtableStr;
                    rangeEx.Font.Name = "Times New Roman";
                    rangeEx.Font.Size = 10;
                    rangeEx.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeLeft].LineStyle         = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    rangeEx.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeTop].LineStyle          = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    rangeEx.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeBottom].LineStyle       = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    rangeEx.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeRight].LineStyle        = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    rangeEx.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlInsideVertical].LineStyle   = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    rangeEx.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlInsideHorizontal].LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
                    rangeEx.WrapText = true;
                }



                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    ExitWord(oWord, oExcel, true);
                    return;
                }


                if (rowgrid.Count > 0)
                {
                    for (int i = 1; i <= OtableStr.GetUpperBound(1) + 1; i++)
                    {
                        if (i != 2 && i != 3)
                        {
                            oSheet.Columns[i].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                            oSheet.Columns[i].VerticalAlignment   = Microsoft.Office.Interop.Excel.XlVAlign.xlVAlignCenter;
                        }
                        else
                        {
                            oSheet.Columns[i].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignLeft;
                            oSheet.Columns[i].VerticalAlignment   = Microsoft.Office.Interop.Excel.XlVAlign.xlVAlignCenter;
                        }
                    }

                    counter += 2;
                    ExportWorker.ReportProgress(counter, Operation.change);
                    if (ExportWorker.CancellationPending)
                    {
                        ExitWord(oWord, oExcel, true);
                        return;
                    }
                }


                for (int i = 0; i <= rowgrid.Count - 1; i++)
                {
                    if (rowgrid[i].RowTypes == RowsType.TipOborud)
                    {
                        oSheet.Cells[i + 1, 2].Font.Bold           = true;
                        oSheet.Cells[i + 1, 2].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                    }
                    else if (rowgrid[i].RowTypes == RowsType.TipPostav)
                    {
                        oSheet.Cells[i + 1, 2].Font.Bold           = true;
                        oSheet.Cells[i + 1, 2].Font.Underline      = Microsoft.Office.Interop.Excel.XlUnderlineStyle.xlUnderlineStyleSingle;
                        oSheet.Cells[i + 1, 2].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                    }
                    else if (rowgrid[i].RowTypes == RowsType.Etap)
                    {
                        oSheet.Cells[i + 1, 2].Font.Bold           = true;
                        oSheet.Cells[i + 1, 2].Font.Underline      = Microsoft.Office.Interop.Excel.XlUnderlineStyle.xlUnderlineStyleSingle;
                        oSheet.Cells[i + 1, 2].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
                    }
                }

                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    ExitWord(oWord, oExcel, true);
                    return;
                }


                oSheet.Rows.AutoFit();

                oExcel.ActiveWindow.SplitColumn = 0;
                oExcel.ActiveWindow.SplitRow    = 2;
                oExcel.ActiveWindow.FreezePanes = true;
                oExcel.ActiveWindow.Zoom        = 82;


                Microsoft.Office.Interop.Word.Style Stylus = oWord.Selection.get_Style();
                Stylus.Font.Name = "Times New Roman";
                Stylus.Font.Size = 10;
                Stylus.ParagraphFormat.SpaceBefore = 0;
                Stylus.ParagraphFormat.SpaceAfter  = 0;

                if (rowgrid.Count > 0)
                {
                    oSheet.Range[oSheet.Cells[1, 1], oSheet.Cells[OtableStr.GetUpperBound(0) + 1, OtableStr.GetUpperBound(1) + 1]].Copy();
                }
                oWord.Selection.Paste();
                oExcel.CutCopyMode = XlCutCopyMode.xlCopy;

                if (oDoc.Tables.Count > 1)
                {
                    oDoc.Tables[1].Rows.HeightRule = WdRowHeightRule.wdRowHeightAtLeast;
                    oDoc.Tables[1].Rows.Height     = oWord.CentimetersToPoints(0.58F);

                    oDoc.Tables[1].AllowAutoFit = false;
                    oDoc.Tables[1].LeftPadding  = oDoc.Tables[2].LeftPadding;
                    oDoc.Tables[1].RightPadding = oDoc.Tables[2].RightPadding;

                    if (oDoc.Tables[2].Columns.Count >= numberCOl && oDoc.Tables[1].Columns.Count >= numberCOl)
                    {
                        for (int i = 1; i <= numberCOl; i++)
                        {
                            oDoc.Tables[1].Columns[i].Width = oDoc.Tables[2].Columns[i].Width;
                        }
                    }
                    oDoc.Tables[2].Delete();

                    oDoc.Tables[1].Rows.SetLeftIndent(oWord.CentimetersToPoints(0.03F), Microsoft.Office.Interop.Word.WdRulerStyle.wdAdjustNone);
                }

                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    ExitWord(oWord, oExcel, true);
                    return;
                }


                oDoc.Save();
                oBook.Save();
                ExitWord(oWord, oExcel, false);
                oWord  = null;
                oExcel = null;
            }
            catch (Exception ex)
            {
                ExitWord(oWord, oExcel, false);

                throw new Exception("WordExport", ex);
            }
        }
Exemplo n.º 8
0
        public MicrostationExport(CopyToClipboard cpc, BackgroundWorker ExportWorker, string filename)
        {
            string exportPath = FunctionUse.GetExportPath(filename);

            List <SveraClass.FromDataBaseWide> rowgrid = SveraCl.PereformSpec(cpc, TypeOfExport.Microstation);

            int maxofprog = rowgrid.Count + 2 * 5;

            maxofprog += rowgrid.Count;
            int counter = 0;

            ExportWorker.ReportProgress(maxofprog, Operation.init);

            try
            {
                exportPath += "\\";
                exportPath += (filename != null && filename != "") ? Path.GetFileNameWithoutExtension(filename) + "Spec" : "specification";
                exportPath += ".dgn";
                File.WriteAllBytes(exportPath, MicroSvera.Properties.Resources.seed2d);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Файл открыт и используется. Закройте файл и повторите попытку", "Svera Export Microstation", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            counter += 2;
            ExportWorker.ReportProgress(counter, Operation.change);
            if (ExportWorker.CancellationPending)
            {
                return;
            }


            MS   = null;
            MSex = null;
            try
            {
                try
                {
                    MSex = new MicroStationDGN.ApplicationObjectConnector();
                    MS   = MSex.Application;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Невозможно запустить Microstation. Проверьте версию программы. Необходим Select Series 2", "Svera Export Microstation", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    MessageBox.Show(ex.Message);
                    return;
                }

                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    MS.Quit();
                    return;
                }

                currentDoc = MS.OpenDesignFile(exportPath);

                currentset = MS.ActiveSettings;
                currentset.TextStyle.Height = visfont;
                currentset.TextStyle.Width  = shirfont;

                currentset.TextStyle.Font            = currentDoc.Fonts["txt"];
                currentset.TextStyle.NodeLineSpacing = mezhstroch;
                currentset.Color = mainCOlor;

                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    MS.Quit();
                    return;
                }

                GetShapka();

                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    MS.Quit();
                    return;
                }



                double lowPOint = pos.Range.Low.Y;
                for (int i = 0; i <= rowgrid.Count - 1; i++)
                {
                    counter += 1;
                    ExportWorker.ReportProgress(counter, Operation.change);
                    if (ExportWorker.CancellationPending)
                    {
                        MS.Quit();
                        return;
                    }
                    //  if (rowgrid[i].KolicByDetalize > 0)
                    //  {
                    MicroStationDGN.ShapeElement posElem   = null;
                    MicroStationDGN.ShapeElement oboznElem = null;
                    MicroStationDGN.ShapeElement naimElem  = null;
                    MicroStationDGN.ShapeElement kolElem   = null;
                    MicroStationDGN.ShapeElement massaElem = null;
                    MicroStationDGN.ShapeElement primElem  = null;

                    MicroStationDGN.TextNodeElement posElemText   = null;
                    MicroStationDGN.TextNodeElement oboznElemText = null;
                    MicroStationDGN.TextNodeElement naimElemText  = null;
                    MicroStationDGN.TextNodeElement kolElemText   = null;
                    MicroStationDGN.TextNodeElement massaElemText = null;
                    MicroStationDGN.TextNodeElement primElemText  = null;


                    REcANdTExt(ref posElem, ref posElemText, new PointF((float)pos.Range.Low.X, (float)lowPOint), new SizeF((float)(pos.Range.High.X - pos.Range.Low.X), -4F), ((rowgrid[i].PosicToExp > 0) ? (rowgrid[i].PosicToExp).ToString() : "").ToString(), false, false, true, 1, true);
                    REcANdTExt(ref oboznElem, ref oboznElemText, new PointF((float)(obozn.Range.Low.X), (float)lowPOint), new SizeF((float)(obozn.Range.High.X - obozn.Range.Low.X), (float)(posElem.Range.Low.Y - posElem.Range.High.Y)), rowgrid[i].Markirov, false, false, true, 1, true);
                    REcANdTExt(ref naimElem, ref naimElemText, new PointF((float)(naim.Range.Low.X), (float)lowPOint), new SizeF((float)(naim.Range.High.X - naim.Range.Low.X), (float)(oboznElem.Range.Low.Y - oboznElem.Range.High.Y)), rowgrid[i].GetNaim(false), false, false, true, 3, true);
                    REcANdTExt(ref kolElem, ref kolElemText, new PointF((float)(kol.Range.Low.X), (float)lowPOint), new SizeF((float)(kol.Range.High.X - kol.Range.Low.X), (float)(naimElem.Range.Low.Y - naimElem.Range.High.Y)), ((rowgrid[i].KolicByDetalizeR != 0) ? (rowgrid[i].KolicByDetalizeR).ToString() : "").ToString(), false, false, true, 1, true);
                    REcANdTExt(ref massaElem, ref massaElemText, new PointF((float)(massa.Range.Low.X), (float)lowPOint), new SizeF((float)(massa.Range.High.X - massa.Range.Low.X), (float)(kolElem.Range.Low.Y - kolElem.Range.High.Y)), rowgrid[i].MassaStr, false, false, true, 1, true);
                    REcANdTExt(ref primElem, ref primElemText, new PointF((float)(prim.Range.Low.X), (float)lowPOint), new SizeF((float)(prim.Range.High.X - prim.Range.Low.X), (float)(massaElem.Range.Low.Y - massaElem.Range.High.Y)), rowgrid[i].PrimMicro, false, false, true, 1, true);



                    List <MicroStationDGN.ShapeElement> elStolb = new List <MicroStationDGN.ShapeElement>
                    {
                        posElem,
                        oboznElem,
                        naimElem,
                        kolElem,
                        massaElem,
                        primElem
                    };

                    List <MicroStationDGN.TextNodeElement> elStolbText = new List <MicroStationDGN.TextNodeElement>
                    {
                        posElemText,
                        oboznElemText,
                        naimElemText,
                        kolElemText,
                        massaElemText,
                        primElemText
                    };

                    lowPOint = elStolb.Min <MicroStationDGN.ShapeElement, double>(el => el.Range.Low.Y);
                    for (int j = 0; j < elStolb.Count; j++)
                    {
                        if (lowPOint < elStolb[j].Range.Low.Y)
                        {
                            elStolb[j].ModifyVertex(2, MS.Point3dFromXY(elStolb[j].get_Vertex(3).X, lowPOint));
                            elStolb[j].ModifyVertex(3, MS.Point3dFromXY(elStolb[j].get_Vertex(4).X, lowPOint));

                            elStolb[j].Rewrite();
                            elStolb[j].Redraw();

                            int position = 0;
                            if (elStolbText[j] != null)
                            {
                                if (elStolbText[j].Justification == MicroStationDGN.MsdTextJustification.msdTextJustificationCenterCenter)
                                {
                                    position = 1;
                                }
                                else if (elStolbText[j].Justification == MicroStationDGN.MsdTextJustification.msdTextJustificationLeftTop)
                                {
                                    position = 3;
                                }
                                MicroStationDGN.Point3d POintIns = POintIns = GetPOintText(position, new PointF((float)elStolb[j].Range.Low.X, (float)elStolb[j].Range.High.Y), new SizeF((float)(elStolb[j].Range.High.X - elStolb[j].Range.Low.X), (float)(elStolb[j].Range.High.Y - elStolb[j].Range.Low.Y)));
                                elStolbText[j].Move(MS.Point3dFromXY(POintIns.X - elStolbText[j].Origin.X, POintIns.Y - elStolbText[j].Origin.Y));

                                elStolbText[j].Rewrite();
                                elStolbText[j].Redraw();
                            }
                        }
                    }



                    // }
                }



                currentDoc.Save();

                int statusSaveCHanges  = (int)MS.GetCExpressionValue("userPrefsP->extFlags.immediatelySaveChanges");
                int statusDesignOnExit = (int)MS.GetCExpressionValue("userPrefsP->extFlags.fileDesignOnExit");
                MS.SetCExpressionValue("userPrefsP->extFlags.immediatelySaveChanges", 1);
                MS.SetCExpressionValue("userPrefsP->extFlags.fileDesignOnExit", 0);

                currentDoc.Close();

                MS.SetCExpressionValue("userPrefsP->extFlags.immediatelySaveChanges", statusSaveCHanges);
                MS.SetCExpressionValue("userPrefsP->extFlags.fileDesignOnExit", statusDesignOnExit);

                MS.Visible = true;
                currentDoc = MS.OpenDesignFile(exportPath);
                currentDoc.Views[1].DisplaysFill = true;
                try
                {
                    currentDoc.Views[1].Fit(false);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Svera Export Microstation", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                currentDoc.Views[1].Redraw();


                counter += 2;
                ExportWorker.ReportProgress(counter, Operation.change);
                if (ExportWorker.CancellationPending)
                {
                    MS.Quit();
                    return;
                }
            }
            catch (Exception ex)
            {
                if (MS != null)
                {
                    MS.Quit();
                    MS = null;
                }
                if (MSex != null)
                {
                    MSex = null;
                }

                //MessageBox.Show(ex.Message);
                //MessageBox.Show(ex.StackTrace);
                //if (ex.InnerException != null)
                //{
                //    MessageBox.Show(ex.InnerException.ToString());
                //}
                throw new Exception("MicrostationExport", ex);
            }
        }
Exemplo n.º 9
0
        public BaseChange()
        {
            InitializeComponent();

            try
            {
                //   SetDoubleBuffered(CableData, True);


                SveraB = new SveraBaseChange();

                if (Svera.Properties.Settings.Default.BaseChangeSize != new Size(0, 0))
                {
                    this.Size = Svera.Properties.Settings.Default.BaseChangeSize;
                }
                if (Svera.Properties.Settings.Default.BaseChangeLocation != new Point(0, 0))
                {
                    this.Location = Svera.Properties.Settings.Default.BaseChangeLocation;
                }



                if (SveraB.DataBaseList.Count > 0)
                {
                    ComboDate.DataSource    = SveraB.DataBaseList;
                    ComboDate.SelectedIndex = 0;
                }

                if (SveraB.ColList.Count > 0)
                {
                    DataGridViewColumn[] dataGridColSver = new DataGridViewColumn[SveraB.ColList.Count];
                    ColumnNames          colName;

                    for (int i = 0; i <= SveraB.ColList.Count - 1; i++)
                    {
                        colName = SveraB.ColList[i];
                        // if (colName.nameColumn != SveraParam.ColDatagridNames.Redact)
                        // {
                        dataGridColSver[i]            = new DataGridViewTextBoxColumn();
                        dataGridColSver[i].Name       = colName.nameColumn;
                        dataGridColSver[i].HeaderText = colName.textColumn;
                        dataGridColSver[i].SortMode   = DataGridViewColumnSortMode.NotSortable;
                        dataGridColSver[i].ReadOnly   = colName.readOnly;
                        if (i == 0)
                        {
                            dataGridColSver[i].ReadOnly = true;
                        }
                        //}
                    }

                    sverPDataGrid.Columns.AddRange(dataGridColSver);

                    sverPDataGrid.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
                    sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
                }

                if (SveraB.RowNamesShort.Count > 0)
                {
                    DataGridViewRow[] dataGridRowSver = new DataGridViewRow[SveraB.RowNamesShort.Count];
                    RowsNames         rowName;

                    string[] otdelar  = null;
                    string[] postavar = null;
                    string[] vzrivar  = null;
                    string[] klimatar = null;
                    string[] ipar     = null;

                    FunctionUse.ChangeComboInBase(SveraB.DataBaseList, FilterTipPostav, FilterTipOborud, FilterEdIzm, FilterPostav, FilterVzriv, FilterKlimat, FilterOtdel, FilterIp, ref otdelar, ref postavar, ref vzrivar, ref klimatar, ref ipar);

                    for (int i = 0; i <= SveraB.RowNamesShort.Count - 1; i++)
                    {
                        rowName = SveraB.RowNamesShort[i];
                        if (rowName.extended == false)
                        {
                            //dataGridRowSver[i] = new DataGridViewRow();
                            //dataGridRowSver[i].CreateCells(sverPDataGrid);

                            //if (SveraB.RowNamesShort[i].dataCellType == typeof(DataGridViewComboBoxCell) ||
                            //    SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.otdel ||
                            //    SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.klimat ||
                            //    SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.vzriv ||
                            //    SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.postav)
                            //{
                            //    DataGridViewComboBoxCell cc = new DataGridViewComboBoxCell();
                            //    cc.FlatStyle = FlatStyle.Flat;
                            //    if (SveraB.RowNamesShort[i].ArrayValue != null)
                            //    {
                            //        cc.Items.AddRange(SveraB.RowNamesShort[i].ArrayValue);
                            //    }
                            //    else
                            //    {
                            //        if (SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.otdel && otdelar != null)
                            //        {
                            //            cc.Items.AddRange(otdelar);
                            //        }
                            //        else if (SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.postav && postavar != null)
                            //        {
                            //            cc.Items.AddRange(postavar);
                            //        }
                            //        else if (SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.klimat && klimatar != null)
                            //        {
                            //            cc.Items.AddRange(klimatar);
                            //        }
                            //        else if (SveraB.RowNamesShort[i].nameRow == SveraParam.RowsDatagridNames.vzriv && vzrivar != null)
                            //        {
                            //            cc.Items.AddRange(vzrivar);
                            //        }
                            //    }
                            //    dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index] = cc;
                            //}
                            //dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Parametr].Index].Value = SveraB.RowNamesShort[i].textRow;
                            //dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index].Value = SveraB.RowNamesShort[i].NullValue;
                            //dataGridRowSver[i].Tag = SveraB.RowNamesShort[i].nameRow;

                            //if (SveraB.RowNamesShort[i].readonlyT == true)
                            //{
                            //    dataGridRowSver[i].ReadOnly = true;
                            //}

                            //if (SveraB.RowNamesShort[i].redact == true)
                            //{
                            //    DataGridViewButtonCell bb = new DataGridViewButtonCell();
                            //    bb.FlatStyle = FlatStyle.Flat;
                            //    bb.Value = "Ред.";
                            //    bb.Style.BackColor = Color.LightGray;
                            //    dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Redact].Index] = bb;
                            //}

                            rowName            = SveraB.RowNamesShort[i];
                            dataGridRowSver[i] = new DataGridViewRow();
                            dataGridRowSver[i].CreateCells(sverPDataGrid);

                            if (SveraB.RowNamesShort[i].dataCellType == typeof(DataGridViewComboBoxCell))
                            {
                                DataGridViewComboBoxCell cc = new DataGridViewComboBoxCell();
                                cc.FlatStyle = FlatStyle.Flat;
                                if (SveraB.RowNamesShort[i].ArrayValue != null)
                                {
                                    cc.Items.AddRange(SveraB.RowNamesShort[i].ArrayValue);
                                }
                                dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Value].Index] = cc;
                            }
                            dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Parametr].Index].Value = SveraB.RowNamesShort[i].textRow;
                            dataGridRowSver[i].Tag = SveraB.RowNamesShort[i].nameRow;

                            if (SveraB.RowNamesShort[i].readonlyT == true)
                            {
                                dataGridRowSver[i].ReadOnly = true;
                            }

                            if (SveraB.RowNamesShort[i].redact == true)
                            {
                                DataGridViewButtonCell bb = new DataGridViewButtonCell();
                                bb.FlatStyle       = FlatStyle.Flat;
                                bb.Value           = "Ред.";
                                bb.Style.BackColor = Color.LightGray;
                                dataGridRowSver[i].Cells[sverPDataGrid.Columns[SveraParam.ColDatagridNames.Redact].Index] = bb;
                            }
                        }
                    }


                    sverPDataGrid.Rows.AddRange(dataGridRowSver);
                }

                ChangeSpec();
                SizeChange();

                load = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                MessageBox.Show(ex.StackTrace);
                if (ex.InnerException != null)
                {
                    MessageBox.Show(ex.InnerException.ToString());
                }
            }
        }
Exemplo n.º 10
0
        private void OkiBut_Click(object sender, EventArgs e)
        {
            List <long> ids = new List <long>();

            if (SveraF.FromDataBaseWideSveraCl.Count > 0)
            {
                ids = SveraF.FromDataBaseWideSveraCl.FindAll(sv =>
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.id)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? SveraF.FromDataBaseWideForSvera.Id == sv.Id
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.detail)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? SveraF.FromDataBaseWideForSvera.Detail == sv.Detail
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.detailW)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? SveraF.FromDataBaseWideForSvera.DetailW == sv.DetailW
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.docObozn)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.DocObozn, sv.DocObozn, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.edIzm)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.EdIzm, sv.EdIzm, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.edIzmW)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.EdIzmW, sv.EdIzmW, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.elGroup)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? SveraF.FromDataBaseWideForSvera.ElGroup == sv.ElGroup
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.etap)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? SveraF.FromDataBaseWideForSvera.Etap == sv.Etap
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.ip)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Ip, sv.Ip, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.klimat)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Klimat, sv.Klimat, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.kod)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Kod, sv.Kod, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.koefToWord)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? SveraF.FromDataBaseWideForSvera.KoefToWord == sv.KoefToWord
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.kolic)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? SveraF.FromDataBaseWideForSvera.Kolic == sv.Kolic
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.markaOborud)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.MarkaOborud, sv.MarkaOborud, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.markirov)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Markirov, sv.Markirov, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.massa)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? SveraF.FromDataBaseWideForSvera.Massa == sv.Massa
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.naim)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Naim, sv.Naim, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.naimKrat)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.NaimKrat, sv.NaimKrat, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.otdel)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Otdel, sv.Otdel, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.postav)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Postav, sv.Postav, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.prim)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Prim, sv.Prim, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.primWord)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.PrimWord, sv.PrimWord, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.tipOborud)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.TipOborud, sv.TipOborud, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.tipPostav)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.TipPostav, sv.TipPostav, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.vedRabot)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.VedRabot, sv.VedRabot, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             &&
                                                             ((bool.Parse(sverPDataGrid.Rows[FunctionUse.sverPDataGrid_GetRowIndex(sverPDataGrid, SveraParam.RowsDatagridNames.vzriv)].Cells[FunctionUse.sverPDataGrid_GetColIndex(sverPDataGrid, FindAndChangeCl.ColDatagridNames.Check)].Value.ToString()) == true)
                                    ? FunctionUse.StringConsist(SveraF.FromDataBaseWideForSvera.Vzriv, sv.Vzriv, RegistrChek.Checked, FullWordChek.Checked)
                                    : 1 == 0)
                                                             ).Select(sv => sv.Id).ToList();
            }
            sveraCl.FindElements(sverDataGridCl, ids);
        }