Дипломная работа: Автоматизация учета и обработки заявок в благотворительном фонде "Урал"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
105
// tbl1.Cell(1, i +
1).Range.Borders[WdBorderType.wdBorderRight].LineStyle =
WdLineStyle.wdLineStyleSingle;
// tbl1.Cell(1, i + 1).Range.Borders[WdBorderType.wdBorderTop].LineStyle
= WdLineStyle.wdLineStyleSingle;
// tbl1.Cell(1, i +
1).Range.Borders[WdBorderType.wdBorderBottom].LineStyle =
WdLineStyle.wdLineStyleSingle;
//}
////строки таблицы
//for (int i = 0; i <= dataGridView4.Rows.Count - 1; i++)
//{
// tbl1.Rows.Add();
// for (int j = 0; j <= 1; j++)
// {
// if (dataGridView4.Rows[i].Cells[2 + j].Value == null) continue;
// //if (j == 0) tbl1.Cell(tbl1.Rows.Count, j + 1).Range.Text =
bDDataSet.Комплектующие.FindByКодКомплект(Convert.ToInt32(dataGridView4.
Rows[i].Cells[2 + j].Value)).Наименование;
// // else
// {
// tbl1.Cell(tbl1.Rows.Count, j + 1).Range.Text =
dataGridView4.Rows[i].Cells[2 + j].Value == null ? "" :
dataGridView4.Rows[i].Cells[j].Value.ToStri ng();
// tbl1.Cell(tbl1.Rows.Count, j +
1).Range.Borders[WdBorderType.wdBorderLeft].LineStyle =
WdLineStyle.wdLineStyleSingle;
// tbl1.Cell(tbl1.Rows.Count, j +
1).Range.Borders[WdBorderType.wdBorderRight].Line Style =
WdLineStyle.wdLineStyleSingle;
// tbl1.Cell(tbl1.Rows.Count, j +
1).Range.Borders[WdBorderType.wdBorderTop].LineStyle =
WdLineStyle.wdLineStyleSingle;
// tbl1.Cell(tbl1.Rows.Count, j +
1).Range.Borders[WdBorderType.wdBorderBottom].LineStyle =
WdLineStyle.wdLineStyleSingle;
// }
// }
//}
106
//wdDoc.Bookmarks["док"].Select();
//wdApp.Selection.TypeText(sb.ToString());
wdDoc.SaveAs(Environment.CurrentDirectory + @"\документы\ + Заявка
" + mod.НомерЗаявки + ".pdf", WdSaveFormat.wdFormatPDF);
wdDoc.Close(false);
Process.Start(Environment.CurrentDirectory + @"\документы\ + Заявка " +
mod.НомерЗаявки + ".pdf");
}
private void toolStripButton5_Click(object sender, EventArgs e)
{
ZayavkaDataSet.ЗаявкаRow mod =
(ZayavkaDataSet.ЗаявкаRow)((DataRowView)dataGridView2.Rows[dataGridView2.
CurrentRow.Index].DataBoundItem).Row;
Print(mod);
}
private void бланкЗаявкиToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void toolStripButton4_Click(object sender, EventArgs e)
{
ZayavkaDataSet.РезультатыОбработкиRow r =
(ZayavkaDataSet.РезультатыОбработкиRow)((DataRowView)dataGridView3.Rows[
dataGridView3.CurrentRow.Index].DataBoundItem).Row;
ZayavkaDataSet.ЗаявкаRow mod =
bDDataSet.Заявка.FindByКодЗаявки(r.КодЗаявки);
Print(mod);
}
private void списокЗаявителейToolStripMenuItem_Click(object sender,
EventArgs e)
{
FormReports f = new FormReports();
f.FillReport("Список заявителей");
f.Show();
}
private void списокЗаявокToolStripMenuItem_Click(object sender, EventArgs
e)
{
107
FormReports f = new FormReports();
f.FillReport("Список заявок");
f.Show();
}
private void результатыОбработкиЗаявокToolStripMenuItem_Click(object
sender, EventArgs e)
{
FormReports f = new FormReports();
f.FillReport("Результаты обработки заявок");
f.Show();
}
private void статистикаПриемаЗаявокToolStripMenuItem_Click(object sender,
EventArgs e)
{
FormReports f = new FormReports();
f.FillReport( "Статистика приема и обработки заявок");
f.Show();
}
public int KodSotrud = 1;
private void пользователиToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!isAdmin)
{
MessageBox.Show("У вас нет прав доступа к данному справочнику","",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
FormUsers f = new FormUsers();
f.Show();
}
}
private void выходToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Windows.Forms.Application.Exit();
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
System.Windows.Forms.Application.Exit();
}
108
private void бланкОтчетаПоЗаявке ToolStripMenuItem_Click(object sender,
EventArgs e)
{
Process.Start(Environment.CurrentDirectory + @"\шаблоны\заявка.docx");
}
private void бланкШаблонаОтчетаToolStripMenuItem_Click(object sender,
EventArgs e)
{
Process.Start(Environment.CurrentDirectory + @"\шаблоны\Шаблон
отчета.docx");
}
public static void SendMail(string smtpServer, string from, string password,
string mailto, string caption, string message, string attachFile = null)
{
try
{
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
mail.From = new MailAddress(from);
mail.To.Add(new MailAddress(mailto));
mail.Subject = caption;
mail.Body = message;
if (!string.IsNullOrEmpty(attachFile))
mail.Attachments.Add(new Attachment(attachFile));
SmtpClient client = new SmtpClient();
client.Host = smtpServer;
client.Port = 587;
client.EnableSsl = true;
client.Credentials = new NetworkCredential(from.Split('@')[0], password);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(mail);
mail.Dispose();
}
catch (Exception e)
{
throw new Exception("Mail.Send: " + e.Message);
}
}
private void видыОрганизацийToolStripMenuItem_Click(object sender,
EventArgs e)
{
//FormVidOrg f = new FormVidOrg();
//f.Show();
}
109
private void статусыЗаявителейToolStripMenuItem_Click(object sender,
EventArgs e)
{
FormStatus f = new FormStatus();
f.Show();
}
private void группыЗаявокToolStripMenuItem_Click(object sender, EventArgs
e)
{
FormGrZayavka f = new FormGrZayavka();
f.Show();
}
private void
статистикаЗаявокПоСтатусамЗаявителейИВидамЗаявокToolStripMenuItem_Click(
object sender, EventArgs e)
{
FormReports f = new FormReports();
f.FillReport("Статистика заявок по статусам заявителей и видам заявок");
f.Show();
}
private void dataGridView2_SelectionChanged(object sender, EventArgs e)
{
if (dataGridView2.CurrentRow != null)
{
ZayavkaDataSet.ЗаявкаRow z =
(ZayavkaDataSet.ЗаявкаRow)((DataRowView)dataGridView2.Rows[dataGridView2.
CurrentRow.Index].DataBoundItem).Row;
if (z == null) return;
результатыОбработкиBindingSource.Filter = "КодЗаявки=" +
z.КодЗаявки.ToString();
требованияПоЗаявкеBindingSource.Filter = "КодЗаявки=" +
z.КодЗаявки.ToString();
bDDataSet.РезультатыОбработки.КодЗаявкиColumn.DefaultValue =
z.КодЗаявки;
bDDataSet.ТребованияПоЗаявке.КодЗаявкиColumn.DefaultValue =
z.КодЗаявки;
}
else
{
результатыОбработкиBindingSource.Filter = "КодЗаявки=-1";
Источник: https://baza.diplomsite.ru/previewfile/2372