Exemplo n.º 1
0
        /// <summary>Приложение</summary>
        private void Applications()
        {
            foreach (var one in selections)
            {
                Well well = one.Well;

                ISheet sheet = book.GetSheet("Приложение").CopySheet(well.PresentNumber != string.Empty ? well.PresentNumber : "без_номера");
                Substitute = new CellExchange_Class(sheet);
                //Substitute.AddExchange("{объект}", obj.Adres + ' ' + well.PresentNumber, 0);
                Substitute.AddExchange("{абонент}", client.Detail.FullName, 0);
                Substitute.AddExchange("{колодец}", $"{well.FullName} - {well.PresentNumber}", 0);
                Substitute.AddExchange("{адрес}", (client.Objects.Any() ? obj.Adres.CutAdres(false) : string.Empty), 0);
                Substitute.AddExchange("{номер отбора}", one.FormatNumber, 0);
                {
                    var works = AdditionnTable.GetSigner(data.ETypeTemplate.Extract, "Приложение");
                    Substitute.AddExchange("{должность}", works.Post, 0);
                    Substitute.AddExchange("{фио}", works.FIO, 0);
                }
                tableSelection = new TableSelection(obj, sample);
                tableSelection.CreateTable(SearchCellFromMark(sheet, "{таблица}", false), one);
                tableSelection.Signature(SearchCellFromMark(sheet, "{пример}", false), Substitute);
                Substitute.AddExchange("{полное наименование колодца}", well.FullName + ' ' + well.PresentNumber, 0);
                Substitute.Exchange();
            }
            book.RemoveSheetAt(book.GetSheetIndex("Приложение"));
        }
Exemplo n.º 2
0
        private void LoadTitle(SelectionWell selectionWell)
        {
            Substitute = new CellExchange_Class(sheet);
            Accredit accredit = AdditionnTable.GetAccredit();

            Substitute.AddExchange(mark.acred, $"{accredit.Text}\nВыдан {accredit.YMDFrom}", 0);
            Worker work = AdditionnTable.GetSigner(data.ETypeTemplate.Protocol, "Протокол");

            Substitute.AddExchange(mark.fio_nac, work.FIO, 0);
            Substitute.AddExchange(mark.number_prot, selectionWell.FormatNumber, 0);
            Substitute.AddExchange(mark.abon, selectionWell.Objecte.Client.Detail.FullName, 0);
            Substitute.AddExchange(mark.yr_adr, Helpers.LogicHelper.AdresLogic.FirstModel(selectionWell.Objecte.Client.Detail.AdresLegalID).Adr.CutAdres(false), 0);
            Substitute.AddExchange(mark.type_well, G.TypeWell.Rows.Get <string>(selectionWell.Well.TypeWellID, C.TypeWell.FullName), 0);
            Substitute.AddExchange(mark.select_adr, selectionWell.Objecte.Adres.CutAdres(false), 0);
            Substitute.AddExchange(mark.date_select, MyTools.StringDate_From_YMDHMS(selectionWell.YMDHM, MyTools.EInputDate.YMDHM, MyTools.EInputDate.YMD), 0);
            Substitute.AddExchange(mark.time_select, MyTools.StringDate_From_YMDHMS(selectionWell.YMDHM, MyTools.EInputDate.YMDHM, MyTools.EInputDate.YMDHM), 0);
            Substitute.AddExchange(mark.repres, new Representative(selectionWell.Sample.RepresentativeID).Post_FIO, 0);
            Substitute.AddExchange(mark.year, DateControl_Class.SelectYear, 0);
            MonthYear();
            NumberFolder(_selectionWells.Select(x => x.Objecte.NumberFolder).ToArray());
            work = AdditionnTable.GetSigner(data.ETypeTemplate.Protocol, "Протокол");
            Substitute.AddExchange(mark.fio, work.FIO, 0);
            Substitute.AddExchange(mark.job, work.Post, 0);
            int day, month;

            MyTools.Y_M_D_From_YMD(StaticDate.SelectDate, out month, out month, out day);
            Substitute.AddExchange(mark.day, day, 0);
            Substitute.AddExchange(mark.month, MyTools.Month_From_M_C_R(month, Reg: MyTools.ERegistor.ToLower), 0);
            Substitute.AddExchange(mark._month, month.ToString("00"), 0);
            Substitute.Exchange();
        }
Exemplo n.º 3
0
        private void LoadTitle()
        {
            sheet      = book.GetSheet("Титульник");
            Substitute = new CellExchange_Class(sheet);
            Worker worker = AdditionnTable.GetSigner(data.ETypeTemplate.Journal, "Титульник");

            Substitute.AddExchange(mark.fio, worker.FIO, 1);
            Substitute.AddExchange(mark.job, worker.Post, 1);

            Substitute.Exchange();
        }
Exemplo n.º 4
0
        /// <summary>Обработка письма</summary>
        private void Letter()
        {
            Substitute = new CellExchange_Class(book.GetSheet("Письмо"));
            ClientName(client);
            ObjectAdres(obj, true);
            MonthYearSelect();
            NumberFolder(obj.NumberFolder);
            Substitute.AddExchange("{год месячного объёма}", DateControl_Class.SelectYear - 1, 0);
            Substitute.AddExchange("{листов}", selections.Length, 0);
            NumberFolder(obj.NumberFolder);
            var works = AdditionnTable.GetSigner(data.ETypeTemplate.Extract, "Письмо");

            Substitute.AddExchange("{должность}", works.Post, 0);
            Substitute.AddExchange("{фио}", works.FIO, 0);
            Substitute.Exchange();
        }
Exemplo n.º 5
0
        private void Letter()
        {
            sheet = book.GetSheet("Письмо");
            if (!R621 && !R644)
            {
                book.RemoveSheetAt(book.GetSheetIndex("Письмо"));
                return;
            }
            Substitute = new CellExchange_Class(sheet);
            ClientName(obj.Client);
            ObjectAdres(obj, true);
            MonthYearSelect();

            NumberFolder(obj.NumberFolder);

            var worker = AdditionnTable.GetSigner(data.ETypeTemplate.CalculationFees, "Письмо");

            Substitute.AddExchange(mark.job, worker.Post, 1);
            Substitute.AddExchange(mark.fio, worker.FIO, 1);

            int Radder621 = SearchRowFromMark(sheet, mark.adder621).RowNum;

            Resolution resolution = PollutionBase_Class.AllResolution.First(x => x.CurtName.Contains("621"));

            ResolutionClarify(resolution, R621);
            if (R621)
            {
                Substitute.AddExchange(mark.adder621, GetNormDoc(resolution), 1);
            }
            else
            {
                Substitute.AddExchange(mark.adder621, e => { e.Row.ZeroHeight = true; }, 1);
            }

            resolution = PollutionBase_Class.AllResolution.First(x => x.CurtName.Contains("644"));
            ResolutionClarify(resolution, R644);
            if (R644)
            {
                Substitute.AddExchange(mark.adder644, GetNormDoc(resolution), 1);
            }
            else
            {
                Substitute.AddExchange(mark.adder644, e => { e.Row.ZeroHeight = true; }, 1);
            }
            Substitute.Exchange();
            ResizeHeight(sheet, Radder621, Radder621 + 3);
        }
Exemplo n.º 6
0
        private void LoadCap(string name)
        {
            Substitute = new CellExchange_Class(sheet);
            Substitute.AddExchange("{месяц}", MyTools.Month_From_M_C_R(MyTools.M_From_YM(DateControl_Class.SelectMonth), Reg: MyTools.ERegistor.ToLower), 0);
            Substitute.AddExchange("{год}", DateControl_Class.SelectYear, 0);
            MonthYear();

            Worker workers = AdditionnTable.GetSigner(data.ETypeTemplate.Registry, "директор");

            Substitute.AddExchange("{должность директора}", workers.Post, 0);
            Substitute.AddExchange("{фио директора}", workers.rFIO, 0);
            workers = AdditionnTable.GetSigner(data.ETypeTemplate.Registry, "подписывающий");
            Substitute.AddExchange("{должность}", workers.Post, 0);
            Substitute.AddExchange("{фио}", workers.FIO, 0);
            LoadTextTemplate(sheet, name, 1);
            Substitute.AddExchange("{итоговая сумма}", summa.ToMoney(), 0);
            Substitute.Exchange();
        }
Exemplo n.º 7
0
        private void LoadTable()
        {
            sheet      = book.GetSheet("Таблица");
            Substitute = new CellExchange_Class(sheet);
            IRow row = SearchRowFromMark(sheet, StaticMark.abonent, false);

            var selectionWells = Helpers.LogicHelper.SelectionWellLogic.Find(DateControl_Class.SelectMonth, 1);

            foreach (var selectionWell in selectionWells)
            {
                sheet.ShiftRows(row.RowNum + 3, sheet.LastRowNum, 0);
                row.CopyRowTo(row.RowNum + 3);
                sheet.GetRow(row.RowNum + 1).CopyRowTo(row.RowNum + 4);
                sheet.GetRow(row.RowNum + 2).CopyRowTo(row.RowNum + 5);
            }

            foreach (var selectionWell in selectionWells.OrderBy(x => x.Number))
            {
                Client client = selectionWell.Objecte.Client;

                ClientName(client, false);
                WellNumber(selectionWell);
                Substitute.AddExchange(mark.number_sample,
                                       $"{selectionWell.Number}-С-{MyTools.YearMonth_From_YM(MyTools.YM_From_YMDHM(selectionWell.YMDHM), MyTools.EDateTimeTypes.DivisionSymbol, DivisionSymbol: "/")}",
                                       1);
                row            = SearchRowFromMark(sheet, "{таблица}");
                tableSelection = new TableSelection(selectionWell.Objecte, selectionWell.Sample);
                tableSelection.CreateTable(SearchCellFromMark(sheet, "{таблица}", false), selectionWell);
            }

            tableSelection.Signature(SearchCellFromMark(sheet, "{пример}", false), Substitute);
            ResizeWidth(sheet, MyTools.ETypeFormatBook.Horizontal, tableSelection.table);
            MonthYearSelect();
            Worker worker = AdditionnTable.GetSigner(data.ETypeTemplate.Journal, "Таблица");

            Substitute.AddExchange(mark.fio, worker.FIO, 1);
            Substitute.AddExchange(mark.job, worker.Post, 1);
            Substitute.Exchange();
        }
Exemplo n.º 8
0
        protected override void internalStart()
        {
            Objecte obj = _negotiationAssistant.Objecte;

            book = TemplateStorage.WorkBook;

            Substitute = new CellExchange_Class(book.GetSheetAt(0));
            ClientName(_negotiationAssistant.Objecte.Client);
            NumberFolder(obj.NumberFolder);

            #region Подписывающий
            var works = AdditionnTable.GetSigner(data.ETypeTemplate.LetterNotification, "Письмо");
            Substitute.AddExchange("{должность}", works.Post, 0);
            Substitute.AddExchange("{ФИО}", works.FIO, 0);
            #endregion

            #region адрес/дата
            ObjectAdres(obj, true);
            CP = new Control_Print();
            CP.Elems.SetRowFromGrid(MyTools.GL_Auto);
            var DateSelect = new DateSelector(_negotiationAssistant.YMD);
            CP.Elems.SetFromGrid(DateSelect.View);
            CP.ShowDialog();

            if (DateSelect.dateTime == null)
            {
                return;
            }

            _negotiationAssistant.YMD = MyTools.YMD_From_DateTime(DateSelect.dateTime);
            Substitute.AddExchange("{дата отбора}", MyTools.YearMonthDay_From_YMD(DateSelect.dateTime), 0);
            #endregion

            Substitute.AddExchange("{адрес отбора}", obj.Adres, 0);
            Substitute.Exchange();
            Print("Письма", "Письмо", EPathPrint.Documents);
        }
Exemplo n.º 9
0
        private void LoadTitle()
        {
            Substitute = new CellExchange_Class(sheet);

            ClientName(this._selectionWell.Objecte.Client, false);
            ClientAdres(this._selectionWell.Objecte.Client, false);
            ObjectAdres(this._selectionWell.Objecte, false);
            Substitute.AddExchange(mark.period,
                                   $"{MyTools.YearMonth_From_YM(StartYM, MyTools.EDateTimeTypes.BeautifulWords)} - {MyTools.YearMonth_From_YM(StartYM + MonthCount - 1, MyTools.EDateTimeTypes.BeautifulWords)}",
                                   0);
            Worker worker = AdditionnTable.GetSigner(data.ETypeTemplate.InspectionResult, "Результат");

            Substitute.AddExchange(mark.fio, worker.FIO, 0);
            Substitute.AddExchange(mark.job, worker.Post, 0);
            sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(8, 8, 6, 8 + (MonthCount > 6 ? MonthCount / 2 : 0) + (ShowNorms ? 2 : 0)));

            Substitute.Exchange();
            int span = 2 + MonthCount + (ShowNorms ? 2 : 0);

            for (int i = 0; i < 5; i++)
            {
                sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(i, i, 0, span));
            }
        }