Диплом: Автоматизация учета рабочего времени сотрудников компании ОАО "ЭХМЗ им.Н.Д.Зелинского"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
77
{
if (this.timeUchDataSet1.Sotr.Rows.Count == 0) return;
this.tabTableAdapter1.FillByMonth(this.timeUchDataSet1.Tab, Mnt);
int i = 0;
foreach (DataRow aRow in this.timeUchDataSet1.Sotr.Rows)
{
dataGridView1.Rows.Add();
dataGridView1.Rows[i].Cells[0].Value = aRow["FIO"].ToString();
dataGridView1.Rows[i].Cells[1].Value = aRow["ID"].ToString();
i++;
}
int idRow = -1;
foreach (DataRow aRow in this.timeUchDataSet1.Tab.Rows)
{
for (int j = 0; j < dataGridView1.RowCount-1; j++)
{
if (dataGridView1.Rows[j].Cells[1].Value.ToString() ==
aRow["IDsotr"].ToString())
{
idRow = j;
break;
}
}
if (idRow > -1)
{
DateTime d = Convert.ToDateTime(aRow["dt"].ToString());
int dS = d.Day;
(dataGridView1.Rows[idRow].Cells[dS + 1] as
DataGridViewComboBoxCell).Value = Convert.ToInt32(aRow["IDob"].ToString());
idRow = -1;
78
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: данная строка кода позволяет загрузить данные в таблицу
"timeUchDataSet1.Ob". При необходимости она может быть перемещена или
удалена.
this.obTableAdapter.Fill(this.timeUchDataSet1.Ob);
DateTime CurrDate = DateTime.Now;
toolStripComboBox1.SelectedIndex = CurrDate.Month - 1;
sotrTableAdapter1.Fill(timeUchDataSet1.Sotr);
LoadTree();
}
private void Form1_Activated(object sender, EventArgs e)
{
dataGridView1.RowCount = 0;
LoadTab(toolStripComboBox1.SelectedIndex + 1);
}
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
if (treeView1.SelectedNode.Name != "0")
sotrTableAdapter1.FillByOtd(timeUchDataSet1.Sotr,
Convert.ToInt32(treeView1.SelectedNode.Name));
else sotrTableAdapter1.Fill(timeUchDataSet1.Sotr);
dataGridView1.RowCount = 1;
LoadTab(toolStripComboBox1.SelectedIndex + 1);
}
79
private void dataGridView1_CellEndEdit(object sender,
DataGridViewCellEventArgs e)
{
DateTime CurrDate = DateTime.Now;
DateTime dt = new
DateTime(CurrDate.Year,toolStripComboBox1.SelectedIndex + 1,e.ColumnIndex-1);
tabTableAdapter1.InsertQueryTab(Convert.ToInt32(dataGridView1[1,
e.RowIndex].Value), dt, Convert.ToInt32(dataGridView1[e.ColumnIndex,
e.RowIndex].Value));
}
private void dataGridView1_DataError(object sender,
DataGridViewDataErrorEventArgs e)
{
}
private void сотрудникиToolStripMenuItem_Click(object sender,
EventArgs e)
{
Sotr f1 = new Sotr();
f1.Show();
}
private void обозначенияToolStripMenuItem_Click(object sender,
EventArgs e)
{
Ob f1 = new Ob();
f1.Show();
}
80
private void должностиToolStripMenuItem_Click(object sender,
EventArgs e)
{
Dolg f1 = new Dolg();
f1.Show();
}
private void отделыToolStripMenuItem_Click(object sender, EventArgs e)
{
Otd f1 = new Otd();
f1.Show();
}
private void dsjlToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void больничныйЛистToolStripMenuItem_Click(object sender,
EventArgs e)
{
bl f1 = new bl();
f1.Show();
}
private void приказыToolStripMenuItem_Click(object sender, EventArgs
e)
{
Prik f1 = new Prik();
f1.Show();
}
81
private void актыToolStripMenuItem_Click(object sender, EventArgs e)
{
Akt f1 = new Akt();
f1.Show();
}
private void оПрограммеToolStripMenuItem_Click(object sender,
EventArgs e)
{
AboutBox1 f1 = new AboutBox1();
f1.Show();
}
private void
табельУчетаРабочегоВремениToolStripMenuItem_Click(object sender, EventArgs e)
{
var wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
var wordDocument =
wordApp.Documents.Open(Application.StartupPath + "/tmpl/T12.docx");
Object missing = Type.Missing;
Microsoft.Office.Interop.Word.Find find = wordApp.Selection.Find;
find.Text = "$DT$";
DateTime CurrDate = DateTime.Now;
find.Replacement.Text = CurrDate.ToString();
Object wrap =
Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue;
Object replace =
Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll;
find.Execute(FindText: Type.Missing,
MatchCase: false,
MatchWholeWord: false,
82
MatchWildcards: false,
MatchSoundsLike: missing,
MatchAllWordForms: false,
Forward: true,
Wrap: wrap,
Format: false,
ReplaceWith: missing, Replace: replace);
find.Text = "$P$";
find.Replacement.Text = treeView1.SelectedNode.Text;
find.Execute(FindText: Type.Missing,
MatchCase: false,
MatchWholeWord: false,
MatchWildcards: false,
MatchSoundsLike: missing,
MatchAllWordForms: false,
Forward: true,
Wrap: wrap,
Format: false,
ReplaceWith: missing, Replace: replace);
Microsoft.Office.Interop.Word.Table tbl2;
tbl2 = wordDocument.Content.Tables[4];
for (int row = 0; row < dataGridView1.RowCount - 1; row++)
{
tbl2.Rows.Add();
tbl2.Cell(row + 6, 1).Range.Text = (row+1).ToString();
tbl2.Cell(row + 6, 2).Range.Text =
dataGridView1.Rows[row].Cells[0].Value.ToString();
tbl2.Cell(row + 6, 3).Range.Text =
dataGridView1.Rows[row].Cells[1].Value.ToString();
tbl2.Cell(row + 6, 4).Range.Text =
dataGridView1.Rows[row].Cells[2].Value.ToString();
83
tbl2.Cell(row + 6, 5).Range.Text =
dataGridView1.Rows[row].Cells[3].Value.ToString();
tbl2.Cell(row + 6, 6).Range.Text =
dataGridView1.Rows[row].Cells[4].Value.ToString();
tbl2.Cell(row + 6, 7).Range.Text =
dataGridView1.Rows[row].Cells[5].Value.ToString();
tbl2.Cell(row + 6, 8).Range.Text =
dataGridView1.Rows[row].Cells[6].Value.ToString();
tbl2.Cell(row + 6, 9).Range.Text =
dataGridView1.Rows[row].Cells[7].Value.ToString();
tbl2.Cell(row + 6, 10).Range.Text =
dataGridView1.Rows[row].Cells[8].Value.ToString();
tbl2.Cell(row + 6, 11).Range.Text =
dataGridView1.Rows[row].Cells[9].Value.ToString();
tbl2.Cell(row + 6, 12).Range.Text =
dataGridView1.Rows[row].Cells[10].Value.ToString();
tbl2.Cell(row + 6, 13).Range.Text =
dataGridView1.Rows[row].Cells[11].Value.ToString();
tbl2.Cell(row + 6, 14).Range.Text =
dataGridView1.Rows[row].Cells[12].Value.ToString();
tbl2.Cell(row + 6, 15).Range.Text =
dataGridView1.Rows[row].Cells[13].Value.ToString();
tbl2.Cell(row + 6, 16).Range.Text =
dataGridView1.Rows[row].Cells[14].Value.ToString();
tbl2.Cell(row + 6, 17).Range.Text =
dataGridView1.Rows[row].Cells[15].Value.ToString();
tbl2.Cell(row + 6, 18).Range.Text =
dataGridView1.Rows[row].Cells[16].Value.ToString();
tbl2.Cell(row + 6, 20).Range.Text =
dataGridView1.Rows[row].Cells[17].Value.ToString();
tbl2.Cell(row + 6, 21).Range.Text =
dataGridView1.Rows[row].Cells[18].Value.ToString();
84
tbl2.Cell(row + 6, 22).Range.Text =
dataGridView1.Rows[row].Cells[19].Value.ToString();
tbl2.Cell(row + 6, 23).Range.Text =
dataGridView1.Rows[row].Cells[20].Value.ToString();
tbl2.Cell(row + 6, 24).Range.Text =
dataGridView1.Rows[row].Cells[21].Value.ToString();
tbl2.Cell(row + 6, 25).Range.Text =
dataGridView1.Rows[row].Cells[22].Value.ToString();
tbl2.Cell(row + 6, 26).Range.Text =
dataGridView1.Rows[row].Cells[23].Value.ToString();
tbl2.Cell(row + 6, 27).Range.Text =
dataGridView1.Rows[row].Cells[24].Value.ToString();
tbl2.Cell(row + 6, 28).Range.Text =
dataGridView1.Rows[row].Cells[25].Value.ToString();
tbl2.Cell(row + 6, 29).Range.Text =
dataGridView1.Rows[row].Cells[26].Value.ToString();
tbl2.Cell(row + 6, 30).Range.Text =
dataGridView1.Rows[row].Cells[27].Value.ToString();
tbl2.Cell(row + 6, 31).Range.Text =
dataGridView1.Rows[row].Cells[28].Value.ToString();
tbl2.Cell(row + 6, 32).Range.Text =
dataGridView1.Rows[row].Cells[29].Value.ToString();
tbl2.Cell(row + 6, 33).Range.Text =
dataGridView1.Rows[row].Cells[30].Value.ToString();
tbl2.Cell(row + 6, 34).Range.Text =
dataGridView1.Rows[row].Cells[31].Value.ToString();
}
wordApp.Visible = true;
}
private void dataGridView1_DoubleClick(object sender, EventArgs e)
{
85
}
private void dataGridView1_CellDoubleClick(object sender,
DataGridViewCellEventArgs e)
{
if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value !=
null)
{
if ((e.ColumnIndex>2) && (e.RowIndex>0))
{
DateTime CurrDate = DateTime.Now;
DateTime dt = new
DateTime(CurrDate.Year,toolStripComboBox1.SelectedIndex + 1,e.ColumnIndex-1);
ViewCard f1 = new ViewCard();
f1.dt = dt;
f1.sotr =
Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[1].Value);
f1.Show();
}
}
}
}

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)