Помощь в написании студенческих работ
Антистрессовый сервис

Разработка требований к функциональности генератора документов

Дипломная Купить готовую Узнать стоимостьмоей работы

Колонок. Split ('/');int row = b.RefersToRange.Row;int col = b.RefersToRange.Column;int rowsCount =0;int colCount = s. Length;for (int k=j+1;k≤sheetData.UsedRange.Rows.Count-1;k++) {if (sheetData.Cells. Value2≠null) { rowsCount =(k — j);break; } }if (rowsCount == 0) rowsCount = sheetData.UsedRange.Rows.Countj+1;////заголовкиколонокfor (int c = 0; c ≤ colCount — 1;c… Читать ещё >

Разработка требований к функциональности генератора документов (реферат, курсовая, диплом, контрольная)

Содержание

  • ВВЕДЕНИЕ
  • 1. Постановка задачи
    • 1. 1. Исследование необходимости в разработке генератора документов
    • 1. 2. Анализ рынка аналогичного программного обеспечение
    • 1. 3. Разработка требований к функциональности генератора документов
    • 1. 4. Обоснование выбора средств разработки
  • 2. Практическая часть
    • 2. 1. Разработка структуры базы данных
    • 2. 2. Разработка архитектуры
  • приложения
    • 2. 3. Алгоритм работы генератора документов
    • 2. 4. Руководство пользователя
    • 2. 5. Руководство администратора
    • 2. 6. Тестирование генератора документов на контрольном примере
  • ЗАКЛЮЧЕНИЕ
  • СПИСОК ИСПОЛЬЗОВАННОЙ ЛИТЕРАТУРЫ
  • Приложение А. Исходный код программы
  • Приложение Б. Примеры выходных документов

O ffice.Interop.Excel.Name b in ap. Names) {if (b.Name.Equals (m.Наименование)) {if (dict[m]. G etType () == typeof (System.Windows.Forms.TextBox)) { System.Windows.Forms.TextBox t = (System.Windows.Forms.TextBox)dict[m]; b.RefersToRange.Value2 = t. Text; }else {////вставляемтаблицуDataGrid dgv = (DataGrid)dict[m]; System.Data.DataTable dt = (System.Data.DataTable)dgv.DataSource;//Microsoft.Office.Interop.Word.Table tbl1 = ap.Selection.Tables.Add (ap.Selection.Range, 1, dt.Columns.Count);int row = b.RefersToRange.Row;int col = b.RefersToRange.Column;////заголовкиколонокfor (int i = 0; i <= dt.Columns.Count — 1; i++) { Microsoft.Office.Interop.Excel.Range rng = (Microsoft.Office.Interop.Excel.Range)sheet.Cells[row, i + col]; rng. Value2 = dt. Columns[i]. C olumnName; rng. Borders[XlBordersIndex.xlInsideVertical].

L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlInsideHorizontal]. L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlEdgeRight]. L.

ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlEdgeLeft]. L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; }////строкитаблицыfor (int i = 0; i <= dt.Rows.Count — 1; i++){//вставляем строку, так как под меткой таблицы ниже могут быть данные и большая таблица может их перетерестьMicrosoft.Office.Interop.Excel.Range Line = (Microsoft.Office.Interop.Excel.Range)sheet.Rows[row + 2 + i]; Line. Insert ();for (int j = 0; j <= dt.Columns.Count — 1; j++) { Microsoft.Office.Interop.Excel.Range rng = (Microsoft.Office.Interop.Excel.Range)sheet.Cells[row + i + 1, j + col]; rng. Value2 = dt. Rows[i][j] == null? & quot;": dt. Rows[i][j]. T oString ();; rng. Borders[XlBordersIndex.xlInsideVertical]. L.

ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlInsideHorizontal]. L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlEdgeRight]. L.

ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlEdgeLeft]. LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot;} } }break; } } } ap. Visible = true;//получаем список меток с текущей датой и временемforeach (BDDataSet.МеткиRow m in dictDatetime) { //ищемнужнуюметкуforeach (Microsoft.Office.Interop.Excel.Name b in ap. Names) {if (b.Name.Equals (m.Наименование)) {//текущаядатаif (m.Код.

ВидаМетки == 3) b.RefersToRange.Value2 = DateTime.Now.ToShortDateString ();//текущеевремяif (m.Код.

ВидаМетки == 4) b.RefersToRange.Value2 = DateTime.Now.ToShortTimeString ();break; } } }//колонтитулы sheet.PageSetup.CenterFooter = textBox2. Text; sheet.PageSetup.CenterHeader = textBox1. Text; ReleaseObject (ap);return sheet; }catch (Exception ee) {MessageBox.Show (ee.Message, «Возниклаошибка», MessageBoxButtons. OK, MessageBoxIcon. Error);returnnull; } }privatevoid button2_Click (object sender, EventArgs e) {// получаемвыбранныйшаблонBDDataSet.Шаблон.

СтипомRow sh = (BDDataSet.Шаблон.

СтипомRow)((DataRowView)comboBox1.SelectedItem).Row;//; comboBox1. SelectedItem;if (sh == null) return;try {string filename = Path. GetTempFileName (); filename = Path. ChangeExtension (filename, (sh.Код.

Типа == 1? «.docx»: «.xlsx»));using (Stream file = File. OpenWrite (filename)) { file. Write (sh.Шаблон, 0, sh.Шаблон.Length); file. Flush (); file. Close (); }//вордовскийшаблонif (sh.Код.

Типа == 1) { FillWordDoc (filename, sh);//Process.Start (filename);}//вордовскийшаблонif (sh.Код.

Типа == 2) {FillExcelDoc (filename, sh); } }catch (Exception ee) {MessageBox.Show (ee.Message, «Возниклаошибка», MessageBoxButtons. OK, MessageBoxIcon. Error); } }privatevoid button3_Click (object sender, EventArgs e) {// получаемвыбранныйшаблонBDDataSet.Шаблон.

СтипомRow sh = (BDDataSet.Шаблон.

СтипомRow)((DataRowView)comboBox1.SelectedItem).Row;//; comboBox1. SelectedItem;if (sh == null) return;try {string filename = Path. GetTempFileName (); filename = Path. ChangeExtension (filename, (sh.Код.

Типа == 1? «.docx»: «.xlsx»));using (Stream file = File. OpenWrite (filename)) { file. Write (sh.Шаблон, 0, sh.Шаблон.Length); }Process.Start (filename); }catch (Exception ee) {MessageBox.Show (ee.Message, «Возниклаошибка», MessageBoxButtons. OK, MessageBoxIcon. Error); } }privatevoid button4_Click (object sender, EventArgs e) {// получаемвыбранныйшаблонBDDataSet.Шаблон.

СтипомRow sh = (BDDataSet.Шаблон.

СтипомRow)((DataRowView)comboBox1.SelectedItem).Row;//; comboBox1. SelectedItem;if (sh == null) return;FormMetki f = newFormMetki (); f. FillMetki (sh); f. Show (); }privatevoidконвертацияToolStripMenuItem_Click (object sender, EventArgs e) {FormKonvert f = newFormKonvert (); f. Show (); }privatevoidвыходToolStripMenuItem_Click (object sender, EventArgs e) {this.Close (); }BDDataSet.Шаблон.

СтипомRow sh;privatevoid button5_Click (object sender, EventArgs e) { Microsoft.Office.Interop.Excel.Application ap = new Microsoft.Office.Interop.Excel.Application (); ap. Visible = false; Microsoft.Office.Interop.Excel.Workbook book = ap.Workbooks.Add (); Microsoft.Office.Interop.Excel.Worksheet sheet = book. Worksheets[1]; sheet. Cells[1, 2] = «Введите верхний колонтитул»; sheet. Cells[2, 2] = «Введите нижний колонтитул» ;sheet.Columns[2]. ColumnWidth = 31; Microsoft.Office.Interop.Excel.Range rng = sheet. Range[sheet.Cells[1, 3], sheet. Cells[1, 3]]; rng.Interior.ColorIndex = 33; rng = sheet. Range[sheet.Cells[2,3], sheet. Cells[2, 3]]; rng.Interior.ColorIndex = 34; rng = sheet. Range[sheet.Cells[1,1], sheet. Cells[1, 2]]; rng. Merge (); rng = sheet. Range[sheet.Cells[2, 1], sheet. Cells[2, 2]]; rng. Merge (); sh = (BDDataSet.Шаблон.

СтипомRow)((DataRowView)comboBox1.SelectedItem).Row;BDDataSet.МеткиDataTable m = меткиTableAdapter.GetDataByКод.

Шаблона (sh.Код.

Шаблона);int i = 1; sheet. Cells[4, 1] = «Имя документа документа» ;sheet.Columns[1]. ColumnWidth = 10;bool isEstTable = false;foreach (BDDataSet.МеткиRow metka in m) {if (metka.Код.

ВидаМетки ≠ 1 && metka.Код.

ВидаМетки ≠ 2) continue; i++;if (metka.Код.

ВидаМетки == 1) sheet. Cells[4, i] = «Введитетекст/число»; sheet. Cells[5, i] = metka. Наименование;if (metka.Код.

ВидаМетки == 2) { sheet. Cells[4, i] = «Введитетаблицу» ;string[] cols = metka.Заголовки.

Колонок.Split ('/');int j = i; isEstTable= true;foreach (string s in cols) { sheet. Cells[6, j] = s; j++; } Microsoft.Office.Interop.Excel.Range rng2 = sheet. Range[sheet.Cells[4, i], sheet. Cells[4, j-1]]; rng2. Merge (); rng2 = sheet. Range[sheet.Cells[5, i], sheet. Cells[5, j-1]]; rng2. Merge (); i += j-i-1; }if (metka.Код.

ВидаМетки == 2) sheet. Columns[i]. ColumnWidth = 45;if (metka.Код.

ВидаМетки == 1) sheet. Columns[i]. ColumnWidth = 25;}//email sheet. Cells[4, i + 1] = «Введите здесь адрес электронной почты получателя, если документ необходимо отправить по почте»; sheet. Cells[4, i + 2] = «Введите тему письма»; sheet. Cells[4, i + 3] = «Введите текст письма» ;sheet.Cells[5, i + 1] = «EMAIL»; sheet. Cells[5, i + 2] = «Темаписьма» ;sheet.Cells[5, i + 3] = «Текст письма» ;Microsoft.Office.Interop.Excel.Range rng1 = sheet. Range[sheet.Cells[5, i + 1], sheet. Cells[5, i + 3]]; rng1.Interior.ColorIndex = 44; sheet. Columns[i + 1]. ColumnWidth = 30; sheet. Columns[i + 2]. ColumnWidth = 30; sheet. Columns[i + 3]. ColumnWidth = 30; rng1 = sheet. Range[sheet.Cells[4, 1], sheet. Cells[4, i + 3]]; rng1.Interior.ColorIndex = 15; rng1.Font.Size = 10; rng1.Font.Italic = true; rng1 = sheet. Range[sheet.Cells[5, 1], sheet. Cells[6, i]]; rng1.Interior.ColorIndex = 36;if (!isEstTable){//скрываем 6-ю строку, если нет таблиц в документеrng1 = sheet. Range[sheet.Cells[6, 1], sheet. Cells[6, i + 3]]; rng1.EntireRow.Hidden = true; } rng1 = sheet. Range[sheet.Cells[1, 3], sheet. Cells[1, i + 3]]; rng1. Merge (); rng1 = sheet. Range[sheet.Cells[2, 3], sheet. Cells[2, i + 3]]; rng1. Merge (); sheet.UsedRange.WrapText = true; sheet.UsedRange.EntireRow.AutoFit (); ap. Visible = true; }privatevoid button7_Click (object sender, EventArgs e) { openFileDialog1. Filter = «*.xlsx-*.xlsx» ;if (openFileDialog1.ShowDialog () == DialogResult. OK) { textBox3. Text = openFileDialog1. FileName; } }privatevoid button6_Click (object sender, EventArgs e) {if (sh == null) return;BDDataSet.МеткиDataTable m = меткиTableAdapter.GetDataByКод.

Шаблона (sh.Код.

Шаблона);string filename = Path. GetTempFileName (); filename = Path. ChangeExtension (filename, (sh.Код.

Типа == 1? «.docx»: «.xlsx»));using (Stream file = File. OpenWrite (filename)) { file. Write (sh.Шаблон, 0, sh.Шаблон.Length); file. Flush (); file. Close (); }string path = «» ;if (sh.Код.

Типа == 1) path= FillWordDocPacket (filename, textBox3. Text);if (sh.Код.

Типа == 2) path=FillExcelPacket (filename, textBox3. Text);Process.Start (path); }privatevoid comboBox1_SelectedIndexChanged (object sender, EventArgs e) {if (comboBox1.SelectedItem == null) { return; }// получаемвыбранныйшаблонsh = (BDDataSet.Шаблон.

СтипомRow)((DataRowView)comboBox1.SelectedItem).Row;//; comboBox1. SelectedItem;if (sh == null) return; tableLayoutPanel1.Controls.Clear (); label2. Visible = true; label3. Visible = true; label4. Visible = true; label5. Visible = true; button2. Visible = true; button4. Visible = true; button3. Visible = true; textBox1. Visible = true; textBox2. Visible = true;//получаемегометкиBDDataSet.МеткиDataTable m = меткиTableAdapter.GetDataByКод.

Шаблона (sh.Код.

Шаблона);if (m ≠ null && m.Rows.Count > 0) { tableLayoutPanel1. RowCount = m. Count; dict = newDictionary<BDDataSet.МеткиRow, Control>();int i = 0;foreach (BDDataSet.МеткиRow metka in m){//текст или числоif (metka.Код.

ВидаМетки == 1){System.Windows.Forms.Label lab = new System.Windows.Forms.Label (); lab. Text = metka. Наименование; System.Windows.Forms.TextBox text = new System.Windows.Forms.TextBox (); text.Name = «m» + metka.Код.

Метки; text. Tag = metka; text. Width = 350; tableLayoutPanel1.Controls.Add (lab); tableLayoutPanel1.Controls.Add (text); dict. Add (metka, text); i++;}///Типметкитаблицаif (metka.Код.

ВидаМетки == 2){ System.Windows.Forms.Label lab = new System.Windows.Forms.Label (); lab. Text = metka. Наименование;DataGrid dgv = newDataGrid (); System.Data.DataTable dt = new System.Data.DataTable ();string[] ss = metka.Заголовки.

Колонок.Split ('/');if (ss ≠ null && ss. Count () > 0) {foreach (string s in ss) { dt.Columns.Add (s); } } dgv. Width = 350; dgv. Height = 250; dict. Add (metka, dgv); dgv. DataSource = dt; tableLayoutPanel1.Controls.Add (lab); tableLayoutPanel1.Controls.Add (dgv); i++;}//ти метки — текущая дата или времяif (metka.Код.

ВидаМетки == 3 — metka.Код.

ВидаМетки == 4){ dictDatetime. Add (metka); } } } }privatevoid checkBox1_CheckedChanged (object sender, EventArgs e){ } }}Листинг А.2 — Пакетное создание документов MSExcelprivatestring FillExcelPacket (string filename, string filenameData) { Microsoft.Office.Interop.Excel.Application apData = new Microsoft.Office.Interop.Excel.Application (); apData. Visible = false; Microsoft.Office.Interop.Excel.Workbook bookData = null; Microsoft.Office.Interop.Excel.Workbooks databook = apData. Workbooks; apData.Workbooks.Open (filenameData, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing); bookData = databook[1]; //ноывйапликейшендлядокументов Microsoft.Office.Interop.Excel.Application ap = new Microsoft.Office.Interop.Excel.Application (); ap. Visible = false; Microsoft.Office.Interop.Excel.Worksheet sheetData = bookData. Worksheets[1]; //создаемпапкуstring nameFold = System.Windows.Forms.Application.StartupPath + @" документы" + sh. Выражение1 + «_» + DateTime.Now.ToShortDateString ().Replace («.», «.

-");DirectoryInfo d;if (!Directory.Exists (nameFold)) d = Directory. CreateDirectory (nameFold);else { nameFold = System.Windows.Forms.Application.StartupPath + @" документы" + sh. Выражение1 + «_» + DateTime.Now.ToShortDateString ().Replace («.», «.

-") + «.

-" + DateTime.Now.ToShortTimeString ().Replace («:», «.

-& quot;); d = Directory. CreateDirectory (nameFold); }for (int j = 7; j <= sheetData.UsedRange.Rows.Count — 1; j++)//строки {if (sheetData.Cells[j, 1]. value2 == null) continue; //нетпорядковгономерадокументаstring numberDoc =Convert.ToString (sheetData.Cells[j, 1]. V alue2);//////////////новыйдокумент Microsoft.Office.Interop.Excel.Workbook book = null; Microsoft.Office.Interop.Excel.Workbooks excelappworkbooks = ap. Workbooks; ap.Workbooks.Open (filename, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing); book = excelappworkbooks[1]; Microsoft.Office.Interop.Excel.Worksheet sheet = book. Worksheets[1]; //////////////for (int i = 2; i <= sheetData.UsedRange.Columns.Count — 3; i++)//колонки {string nameCol = sheetData. Cells[5, i]. V alue2 == null? &.

quot;": Convert. ToString (sheetData.Cells[5, i]. Value2);if (nameCol == «») continue;DataRow[] dr = bDDataSet1.Метки.Select («Код.

Шаблона=" + sh.Код.

Шаблона + «and Наименование='» + nameCol+" '");if (dr == null — dr. Length == 0) continue;BDDataSet.МеткиRow metka = ((BDDataSet.МеткиRow)dr[0]);int vidMetka = metka.Код.

ВидаМетки;//ищемнужнуюметкуforeach (Microsoft.Office.Interop.Excel.Name b in ap. Names) {if (b.Name.Equals (nameCol)){//тест или числоif (vidMetka == 1){b.RefersToRange.Value2 = sheetData. Cells[j, i]. Value2 == null? «»: Convert. ToString (sheetData.Cells[j, i]. Value2); }//текущаядатаif (vidMetka == 3) b.RefersToRange.Value2 = DateTime.Now.ToShortDateString ();//текущеевремяif (vidMetka == 4) b.RefersToRange.Value2 = DateTime.Now.ToShortTimeString ();if (vidMetka == 2) {///вставляемтаблицуstring[] s= metka.Заголовки.

Колонок.Split ('/');int row = b.RefersToRange.Row;int col = b.RefersToRange.Column;int rowsCount =0;int colCount = s. Length;for (int k=j+1;k<=sheetData.UsedRange.Rows.Count-1;k++) {if (sheetData.Cells[k, 1]. V alue2≠null) { rowsCount =(k — j);break; } }if (rowsCount == 0) rowsCount = sheetData.UsedRange.Rows.Countj+1;////заголовкиколонокfor (int c = 0; c <= colCount — 1;c++) { Microsoft.Office.Interop.Excel.Range rng = (Microsoft.Office.Interop.Excel.Range)sheet.Cells[row, col+ c]; rng. Value2 = s[c]; rng. Borders[XlBordersIndex.xlInsideVertical]. L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlInsideHorizontal]. L.

ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlEdgeRight]. L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlEdgeLeft]. L.

ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; }////строкитаблицыfor (int r = 0; r <= rowsCount — 1; r++){//вставляем строку, так как под меткой таблицы ниже могут быть данные и большая таблица может их перетерестьMicrosoft.Office.Interop.Excel.Range Line = (Microsoft.Office.Interop.Excel.Range)sheet.Rows[row + 1 + r]; Line. Insert ();for (int m = 0; m <= colCount — 1; m++) { Microsoft.Office.Interop.Excel.Range rng = (Microsoft.Office.Interop.Excel.Range)sheet.Cells[row + r + 1, m + col]; rng. Value2 = sheetData. Cells[j + r, i + m]. V alue2==null? & quot;": Convert. ToString (sheetData.Cells[j+r, i+m]. V.

alue2); rng. Borders[XlBordersIndex.xlInsideVertical]. L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlInsideHorizontal]. L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlEdgeRight]. L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot; rng. Borders[XlBordersIndex.xlEdgeLeft].

L ineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlDot;} } } } } }//колонтитулыsheet.PageSetup.CenterFooter = sheetData. Cells[2, 3]. value2 == null? & quot;": sheetData. Cells[2, 3].

value2;; sheet.PageSetup.CenterHeader = sheetData. Cells[1, 3]. value2==null? & quot;": sheetData. Cells[1, 3]. value2; ;//сохраняемдокумент book. SaveAs (d.FullName + @" «+ numberDoc + «.xlsx»); book. Close ();if (checkBox1.Checked && sheetData. Cells[j, sheetData.UsedRange.Columns.Count-2]. V alue2 ≠ null) {string email = sheetData. Cells[j, sheetData.UsedRange.Columns.Count — 2]. V.

alue2 == null? & quot;": Convert. ToString (sheetData.Cells[j, sheetData.UsedRange.Columns.Count — 2]. V alue2);string tema = sheetData. Cells[j, sheetData.UsedRange.Columns.Count — 1].

V alue2 == null? & quot;": Convert. ToString (sheetData.Cells[j, sheetData.UsedRange.Columns.Count — 1]. V.

alue2);string text = sheetData. Cells[j, sheetData.UsedRange.Columns.Count ]. V alue2 == null? & quot;": Convert. ToString (sheetData.Cells[j, sheetData.UsedRange.Columns.Count ]. Value2);ClassEmail.SendMail («smtp.mail.ru», «test-diplom-2017@mail.ru», «test2017″, email, tema, text, d. FullName + @» «+ numberDoc + „.xlsx“); } } ap. Quit (); apData. Quit ();return d. FullName; }Листинг А.3 — Пакетное создание документов MSWord///<summary>/// Заполняем вордовский документ///</summary>///<param name="filename» ></param>///<param name="sh" ></param>publicstring FillWordDocPacket (string filename, string filenameData) { Microsoft.Office.Interop.Excel.Application apData = new Microsoft.Office.Interop.Excel.Application (); apData. Visible = false; Microsoft.Office.Interop.Excel.Workbook bookData = null; Microsoft.Office.Interop.Excel.Workbooks databook = apData. Workbooks; apData.Workbooks.Open (filenameData, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing, Type. Missing); bookData = databook[1]; Microsoft.Office.Interop.Excel.Worksheet sheetData = bookData. Worksheets[1]; Microsoft.Office.Interop.Word.Application ap = new Microsoft.Office.Interop.Word.Application (); ap. Visible = false;string nameFold = «» ;//создаемпапку nameFold = System.Windows.Forms.Application.StartupPath + @" документы" + sh. Выражение1 + «_» + DateTime.Now.ToShortDateString ().Replace («.», «.

-");DirectoryInfo d;if (!Directory.Exists (nameFold)) d = Directory. CreateDirectory (nameFold);else { nameFold = System.Windows.Forms.Application.StartupPath + @" документы" + sh. Выражение1 + «_» + DateTime.Now.ToShortDateString ().Replace («.», «.

-") + «.

-" + DateTime.Now.ToShortTimeString ().Replace («:», «.

-& quot;); d = Directory. CreateDirectory (nameFold); }for (int j = 7; j <= sheetData.UsedRange.Rows.Count — 1; j++)//строки {if (sheetData.Cells[j, 1]. value2 == null) continue; //нетпорядковгономерадокументаstring numberDoc = Convert. ToString (sheetData.Cells[j, 1]. V alue2);//////////////новыйдокументDocument documentData = null; documentData = ap.Documents.Open (filename);//////////////for (int i = 2; i <= sheetData.UsedRange.Columns.Count — 3; i++)//колонки {string nameCol = sheetData. Cells[5, i]. V alue2 == null ?

& quot;": Convert. ToString (sheetData.Cells[5, i]. Value2);if (nameCol == «») continue;DataRow[] dr = bDDataSet1.Метки.Select («Код.

Шаблона=" + sh.Код.

Шаблона + «and Наименование='» + nameCol + «'»);if (dr == null — dr. Length == 0) continue;BDDataSet.МеткиRow metka = ((BDDataSet.МеткиRow)dr[0]);int vidMetka = metka.Код.

ВидаМетки; documentData. Bookmarks[metka.Наименование]. Select (); Microsoft.Office.Interop.Word.Selection currentSelection = ap. Selection;if (vidMetka == 1) { currentSelection. TypeText (sheetData.Cells[j, i]. Value2 == null? «»: Convert. ToString (sheetData.Cells[j, i]. Value2)); }//текущаядатаif (vidMetka == 3) currentSelection. TypeText (DateTime.Now.ToShortDateString ());//текущеевремяif (vidMetka == 4) currentSelection. TypeText (DateTime.Now.ToShortTimeString ());if (vidMetka == 2) {///вставляемтаблицуstring[] s = metka.Заголовки.

Колонок.Split ('/');//int row = b.RefersToRange.Row;// int col = b.RefersToRange.Column;int rowsCount = 0;int colCount = s. Length;for (int k = j + 1; k <= sheetData.UsedRange.Rows.Count — 1; k++) {if (sheetData.Cells[k, 1]. V alue2 ≠ null) { rowsCount = (k — j) ;break; } }if (rowsCount == 0) rowsCount = sheetData.UsedRange.Rows.Count — j +1; documentData. Bookmarks[metka.Наименование]. S elect (); Microsoft.Office.Interop.Word.Table tbl1 = ap.Selection.Tables.Add (ap.Selection.Range, 1, colCount);////заголовкиколонокfor (int c = 0; c <= colCount — 1; c++) { tbl1. Cell (1, c + 1).Range.Text = s[c]; tbl1. Cell (1, c + 1).Range.Borders[WdBorderType.wdBorderLeft]. L ineStyle = WdLineStyle. wdLineStyleSingle; tbl1. Cell (1, c + 1).Range.Borders[WdBorderType.wdBorderRight]. L.

ineStyle = WdLineStyle. wdLineStyleSingle; tbl1. Cell (1, c + 1).Range.Borders[WdBorderType.wdBorderTop]. L ineStyle = WdLineStyle. wdLineStyleSingle; tbl1. Cell (1, c + 1).Range.Borders[WdBorderType.wdBorderBottom]. L ineStyle = WdLineStyle. wdLineStyleSingle; }////строкитаблицыfor (int r = 0; r <= rowsCount — 1; r++) { tbl1.Rows.Add ();for (int m = 0; m <= colCount — 1; m++) { tbl1. Cell (tbl1.Rows.Count, m + 1).Range.Text = sheetData. Cells[j + r, i + m]. V alue2 == null ?

& quot;": Convert. ToString (sheetData.Cells[j + r, i + m]. V alue2); tbl1. Cell (tbl1.Rows.Count, m + 1).Range.Borders[WdBorderType.wdBorderLeft]. L ineStyle = WdLineStyle. wdLineStyleSingle; tbl1. Cell (tbl1.Rows.Count, m + 1).Range.Borders[WdBorderType.wdBorderRight]. L ineStyle = WdLineStyle. wdLineStyleSingle; tbl1. Cell (tbl1.Rows.Count, m + 1).Range.Borders[WdBorderType.wdBorderTop].

L ineStyle = WdLineStyle. wdLineStyleSingle; tbl1. Cell (tbl1.Rows.Count, m + 1).Range.Borders[WdBorderType.wdBorderBottom]. L ineStyle = WdLineStyle. wdLineStyleSingle; } } } }//сохраняемдокумент//колонтитулы ap.ActiveDocument.Sections[1]. F ooters[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text = sheetData. Cells[2, 3]. value2 == null? &.

quot;": sheetData. Cells[2, 3]. value2;; ap.ActiveDocument.Sections[1]. H eaders[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text = sheetData. Cells[1, 3]. value2 == null? & quot;": sheetData. Cells[1, 3]. value2; ;//получаем список меток с текущей датой и временемDataRow[] dr1 = bDDataSet1.Метки.Select («Код.

Шаблона=" + sh.Код.

Шаблона + «and (Код.

ВидаМетки=3 or Код.

ВидаМетки=4)");foreach (BDDataSet.МеткиRow m in dr1) { documentData. Bookmarks[m.Наименование]. Select (); Microsoft.Office.Interop.Word.Selection currentSelection = ap. Selection;if (m.Код.

ВидаМетки == 3) currentSelection. TypeText (DateTime.Now.ToShortDateString ());if (m.Код.

ВидаМетки == 4) currentSelection. TypeText (DateTime.Now.ToShortTimeString ()); } documentData. SaveAs (d.FullName + @" «+ numberDoc + «.docx»); documentData. Close ();if (checkBox1.Checked && sheetData. Cells[j, sheetData.UsedRange.Columns.Count — 2]. V alue2 ≠ null) {string email = sheetData. Cells[j, sheetData.UsedRange.Columns.Count — 2]. V alue2 == null ?

& quot;": Convert. ToString (sheetData.Cells[j, sheetData.UsedRange.Columns.Count — 2]. V alue2);string tema = sheetData. Cells[j, sheetData.UsedRange.Columns.Count — 1].

V alue2 == null? & quot;": Convert. ToString (sheetData.Cells[j, sheetData.UsedRange.Columns.Count — 1]. V alue2);string text = sheetData. Cells[j, sheetData.UsedRange.Columns.Count]. V.

alue2 == null? & quot;": Convert. ToString (sheetData.Cells[j, sheetData.UsedRange.Columns.Count ]. V alue2);ClassEmail.SendMail («smtp.mail.ru», «test-diplom-2017@mail.ru», «test2017″, email, tema, text, d. FullName + @» «+ numberDoc + «.docx»); } } ap. Quit (); apData. Quit ();returnd.FullName; } Приложение Б. Примеры выходных документов.

Показать весь текст

Список литературы

  1. В.В. Проектирование информационных систем. СПб.: Питер, 2014. — 256 с.
  2. Г. А., Проектирование информационных систем. Учебное пособие, М.- Омега-Л, 2015. — 432 с.
  3. Официальный сайт «AutomaticDocs» [Электронный ресурс]. URL: http://ru.automaticdocs.com
  4. Официальный сайт «ESCOM.BPM» [Электронный ресурс]. URL: http://www.escom-bpm.com/services/106.html
  5. Официальный сайт «GenDOCFT» [Электронный ресурс]. URL: http://s-autom.ru/
  6. ГОСТ 19.202−78 Спецификация. Требования к содержанию и оформле-нию.
  7. Э.М. Разработка баз данных: учебник. — 2-е изд. — М.: ИНФРА — М, 2012. — 398 с.
  8. А., Макашарипов С. Эффективная работа с СУБД. — С-Пб.: Питер, 2013. — 169 с.
  9. Н. Н. Проектирование баз данных. СУБД. Учебное пособие — СПб.: Горячая Линия — Телеком, 2013. — 296 с.
  10. О.Ю. Эффективная работа с СУБД — М.: Эксмо, 2012. — 352 с.
  11. В.Д., Харитонова И.А. MSAccess — СПб.: БХВ — Петербург, 2010. — 374 с.
  12. , К.Е. Изучение MSAccess — М.: Высшее образование, 2014. — 215 с.
  13. Ширин, В.М. MySQL — М.: Высшее образование, 2011. — 369 с.
  14. Сайт MSSQLServer [Электронный ресурс], URL: https://www.microsoft.com/ru-ru/server-cloud/products/sql-server/overview.aspx
  15. Сайт EmbarcaderoRADStudio [Электронный ресурс], URL: https://www.embarcadero.com
  16. Назаров С.В. Delphi. — М.: Академия, 2012. — 290 с.
  17. Э., Язык программирования C# 5.0 и платформа .NET 4.5, М.: Вильямс, 2015. — 1312 с.
  18. К.К., Основы программирования в Microsoft Visual C#, СПб.: БХВ-Петербург, 2011. — 425 с.
  19. А., Самоучитель Visual Studio .NET 2015, СПб.: Питер, 2015. — 564 с.
  20. Баканов М.И., C++, Учебник. — М.: Наука, 2013. — 298 с.
  21. .М., Мкртумян И. Б. Информационные системы. — М.: Интер, 2012. — 488 с.
  22. Н.А., Проектирование баз данных. Учебное пособие, М.: Горячая линия — Телеком, 2013. — 240 с.
  23. Организация данных в реляционных базах данных [Электронный ресурс], URL: http://www.mstu.edu.ru/study/materials/zelenkov/ch4_1.html
  24. Документация по VisualStudio [Электронный ресурс], URL: https://docs.microsoft.com/ru-ru/visualstudio/
  25. Зозуля Ю.Н. C#. — СПб.: Питер, 2011- 196 с.
  26. ГОСТ 19.202−78 «Руководство пользователя. Спецификация. Требования к содержанию и оформлению»
  27. К. Разработка требований к программному обеспечению. СПб.: БХВ-Петерберг, 2014 — 736 с.
  28. ГОСТ 19.503−79"Руководство администратора. Спецификация. Требования к содержанию и оформлению"
  29. Вставка меток к MSWordhttps://microsoft.support.office.com
  30. Именованные диапазоны MSExcelhttps://microsoft.support.office.com
Заполнить форму текущей работой
Купить готовую работу

ИЛИ