Exemple #1
0
        /// <summary>
        /// метод нахождения названия компании в Excel-файле генподрядчика
        /// </summary>
        /// <returns></returns>
        public CASTitle FindTitle(Excel.Application TempImportExcel, int index)
        {
            if (CountingColumn == 0 || CountingLine == 0)
            {
                if (this.TempImportExcel == null)
                {
                    this.TempImportExcel = TempImportExcel;
                }

                Excel.Range leftTopCell = findLeftTopCell();
                CountingLine   = leftTopCell.Row + 1;
                CountingColumn = leftTopCell.Column + 2;

                for (int i = 1;
                     TempImportExcel.Cells[leftTopCell.Row + i, leftTopCell.Column].Text.Trim() != "1"; i++)
                {
                    CountingLine++;
                }
            }

            CASTitle result = new CASTitle();

            result.Title = TempImportExcel.Cells[findIndexLine(index), CountingColumn].Text;
            result.Point = false;
            return(result);
        }
Exemple #2
0
        /// <summary>
        /// метод нахождения названия компании в Excel-файле генподрядчика
        /// </summary>
        /// <returns></returns>
        public CASTitle FindTitle(Excel.Application TempImportExcel, int index)
        {
            if (this.TempImportExcel == null)
            {
                this.TempImportExcel = TempImportExcel;
            }
            if (CountingLine == 0 || CountingColumn == 0)
            {
                Excel.Range leftTopCell = findLeftTopCell();
                CountingLine   = leftTopCell.Row;
                CountingColumn = leftTopCell.Column + 1;

                for (int i = 1; TempImportExcel.Cells[CountingLine + 1, leftTopCell.Column].Text.Trim() != "1"; i++)
                {
                    CountingLine++;
                }
            }

            CASTitle result = new CASTitle();

            result.Title = TempImportExcel.Cells[CountingLine + index, CountingColumn].Text;
            if (TempImportExcel.Cells[CountingLine + index, CountingColumn - 1].Value == null)
            {
                result.Point = false;
            }
            return(result);
        }
Exemple #3
0
        /// <summary>
        /// метод нахождения названия компании в Excel-файле генподрядчика
        /// </summary>
        /// <returns></returns>
        public CASTitle FindTitle(object[,] array, int index)
        {
            if (CountingColumn == 0 || CountingLine == 0)
            {
                if (this.array == null)
                {
                    this.array = array;
                }

                Cell leftTopCell = findLeftTopCell();
                CountingLine   = leftTopCell.Row + 1;
                CountingColumn = leftTopCell.Column + 2;

                for (int i = 1;
                     array[leftTopCell.Row + i, leftTopCell.Column]?.ToString().Trim() != "1"; i++)
                {
                    CountingLine++;
                }
            }

            CASTitle result = new CASTitle();

            result.Title = (string)array[findIndexLine(index), CountingColumn];
            result.Point = false;
            return(result);
        }
        /// <summary>
        /// метод нахождения названия компании в Excel-файле генподрядчика
        /// </summary>
        /// <returns></returns>
        public CASTitle FindTitle(object[,] array, int index)
        {
            if (this.array == null)
            {
                this.array = array;
            }
            if (CountingLine == 0 || CountingColumn == 0)
            {
                Cell leftTopCell = findLeftTopCell();
                CountingLine   = leftTopCell.Row;
                CountingColumn = leftTopCell.Column + 1;

                for (;; CountingLine++)
                {
                    if (array[CountingLine + 1, leftTopCell.Column] != null &&
                        array[CountingLine + 1, leftTopCell.Column].ToString().Trim() == "1")
                    {
                        break;
                    }
                }
            }

            CASTitle result = new CASTitle();

            if (array[CountingLine + index, CountingColumn] != null)
            {
                result.Title = array[CountingLine + index, CountingColumn].ToString();
            }
            else
            {
                result.Title = "";
            }
            if (array[CountingLine + index, CountingColumn - 1] == null)
            {
                result.Point = false;
            }
            else
            {
                result.Point = true;
            }
            return(result);
        }