Автор работы: Пользователь скрыл имя, 04 Апреля 2014 в 23:36, дипломная работа
Цель разработки и внедрения АСУ - улучшение качества управления системами различных видов, которое достигается[1]
своевременным предоставлением с помощью АСУ полной и достоверной информации управленческому персоналу для принятия решений;
применением математических методов и моделей для принятия оптимальных решений.
Кроме того, внедрение АСУ обычно приводит к совершенствованию организационных структур и методов управления, более гибкой регламентации документооборота и процедур управления, упорядочению использования и создания нормативов, совершенствованию организации предприятия.
15. http://www.krugosvet.ru
16. Трудовой кодекс Республики Казахстан от 17.07.2007 №251
17. Санитарные правила и нормы №1.01.004.01
18. Охрана труда и техника безопасности в практической деятельности субъектов Республики Казахстан/ Сост. В.И.Скала.- Алматы. ТОО «Издательство LEM», 2004.-328 с.
Листинг программы
Файл MainWindow.xaml.cs
using System;
using System.Drawing;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
using Tools;
using Tools.Client;
using Tools.Dialogs;
using Application = System.Windows.Application;
namespace Employee
{
public partial class MainWindow
{
readonly NotifyIcon _notifyIcon = new NotifyIcon();
readonly ContextMenuStrip _iconContextMenu = new ContextMenuStrip();
public MainWindow()
{
InitializeComponent();
SetNotify();
}
private void SetNotify()
{
_notifyIcon.Icon = new Icon(Properties.Resources.
_notifyIcon.Visible = true;
_notifyIcon.ContextMenuStrip = _iconContextMenu;
_notifyIcon.Text = Properties.Resources.
_notifyIcon.BalloonTipTitle = Properties.Resources.
_notifyIcon.MouseDoubleClick += TraybtnShowClick;
//Создаем кнопки для ContextMenu
var btnShow = new ToolStripMenuItem(Properties.
btnShow.Click += TraybtnShowClick;
var separator = new ToolStripSeparator();
var btnClose = new ToolStripMenuItem(Properties.
btnClose.Click += TraybtnCloseClick;
_iconContextMenu.Items.
}
private void TraybtnShowClick(object sender, EventArgs e)
{
Show();
}
private void TraybtnCloseClick(object sender, EventArgs e)
{
if (System.Windows.MessageBox.
Properties.Resources.
Properties.Resources.SConfirm,
MessageBoxButton.YesNo,
MessageBoxImage.Question,
MessageBoxResult.Yes) == MessageBoxResult.Yes)
{
_notifyIcon.Dispose();
Application.Current.Shutdown()
}
}
private void WindowClosing(object sender,
System.ComponentModel.
{
e.Cancel = true;
}
private void ButtonClick(object sender, RoutedEventArgs e)
{
Hide();
}
private void BtnDepartmentsClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new Client(ModuleNames.
window.MainGrid.Children.Add(
Hide();
window.ShowDialog();
}
}
private void ButtonPersonalClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new Client(ModuleNames.Personal) { Title = "Персонал" };
window.MainGrid.Children.Add(
Hide();
window.ShowDialog();
}
}
private void BtnProjectsClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new Client(ModuleNames.Projects) { Title = "Проекты" };
window.MainGrid.Children.Add(
Hide();
window.ShowDialog();
}
}
private void BtnReportsClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new Client(ModuleNames.Reports) { Title = "Отчеты" };
window.MainGrid.Children.Add(
Hide();
window.ShowDialog();
}
}
private void BtnToolsClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new PropertiesDialog();
ModulesOpen.AddModule(
window.ShowDialog();
ModulesOpen.RemoveModule(
}
}
private void BtnDepartmentsMouseEnter(
{
tbStatus.Text = "Подразделения";
}
private void BtnDepartmentsMouseLeave(
{
tbStatus.Text = string.Empty;
}
private void BtnPersonalMouseEnter(object
sender, System.Windows.Input.
{
tbStatus.Text = "Персонал";
}
private void BtnPersonalMouseLeave(object sender, System.Windows.Input.
{
tbStatus.Text = string.Empty;
}
private void BtnProjectsMouseEnter(object
sender, System.Windows.Input.
{
tbStatus.Text = "Проекты";
}
private void BtnProjectsMouseLeave(object
sender, System.Windows.Input.
{
tbStatus.Text = string.Empty;
}
private void BtnReportsMouseEnter(object
sender, System.Windows.Input.
{
tbStatus.Text = "Отчеты";
}
private void BtnReportsMouseLeave(object
sender, System.Windows.Input.
{
tbStatus.Text = string.Empty;
}
private void BtnToolsMouseEnter(object sender, System.Windows.Input.
{
tbStatus.Text = "Настройки";
}
private void BtnToolsMouseLeave(object
sender, System.Windows.Input.
{
tbStatus.Text = string.Empty;
}
private void WindowMouseDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}
}
}
Файл DepartmnetsControl.xaml.cs
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Departments.Departments;
using Departments.
using Reports;
using Tools.Dialogs;
using Tools.Filter;
namespace Departments
{
public partial class DepartmentsControl : UserControl
{
readonly DepartmentsTableAdapter taDepartments = new DepartmentsTableAdapter();
readonly PersonalTableAdapter taPersonal = new PersonalTableAdapter();
private readonly dsDepartments dsDepartments;
public dsDepartments.DepartmentsRow CurrentDepartment
{
get { return dsDepartments.Departments.
}
public DepartmentsControl()
{
InitializeComponent();
dsDepartments = ((dsDepartments)(FindResource(
Fill();
TreeViewContext();
}
private void Fill()
{
taDepartments.Fill(
taPersonal.Fill(dsDepartments.
}
private void SaveChanges()
{
taDepartments.Update(
}
private void BtnEditClick(object sender, RoutedEventArgs e)
{
if (tvDepartments.SelectedItem == null) return;
var editcontrol = new DepartmentEdit(dsDepartments, CurrentDepartment.ID) {sd = SaveChanges};
EditDialog.Edit(editcontrol);
TreeViewContext();
}
private void BtnAddChildClick(object sender, RoutedEventArgs e)
{
var editcontrol = new DepartmentEdit(dsDepartments, 0) { sd = SaveChanges };
EditDialog.Add(editcontrol);
TreeViewContext();
}
private void BtnDeleteClick(object sender, RoutedEventArgs e)
{
//todo: Сделать рекурсивное удаление
if (tvDepartments.SelectedItem == null) return;
if (MessageBox.Show(
Properties.Resources.SDelete,
Properties.Resources.
MessageBoxButton.YesNo,
MessageBoxImage.Question,
MessageBoxResult.Yes) != MessageBoxResult.Yes) return;
((dsDepartments.DepartmentsRow
SaveChanges();
TreeViewContext();
}
private void BtnRefreshClick(object sender, RoutedEventArgs e)
{
Fill();
TreeViewContext();
}
private void MiDepartmentsJournalClick(
{
ReportsControl.ShowCustom(
}
private void MiSingleDepartmentClick(object sender, RoutedEventArgs e)
{
ReportsControl.ShowCustom(
}
private void BtnFilterClick(object sender, RoutedEventArgs e)
{
var filter = new FilterWindow();
filter.ShowDialog();
}
}
}
Файл DepartmentsEdit.xaml.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Tools.Classes;
using Tools.Controls;
namespace Departments.Departments
{
public partial class DepartmentEdit
{
private readonly dsDepartments dsDepartments = new dsDepartments();
private dsDepartments journalDs;
private readonly CollectionViewSource viewsource;
public dsDepartments.DepartmentsRow CurrentRow
{
get { return (dsDepartments.DepartmentsRow) ((DataRowView) viewsource.View.CurrentItem).
}
public DepartmentEdit(dsDepartments ds, int currentId)
{
//todo: Сделать потом нормально
dsDepartments.Merge(ds);
journalDs = ds;
InitializeComponent();
viewsource = ((CollectionViewSource)(
viewsource.Source = dsDepartments.Departments;
if (currentId != 0)
viewsource.View.
dtbDirector.MainDataSet = dsDepartments;
dtbParent.MainDataSet = dsDepartments;
dtbDirector.Init();
dtbParent.Init();
if (currentId == 0) return;
var row = (dsDepartments.Departments.
dtbDirector.Filter = string.Format("id_Department = {0}", row.ID);
dtbParent.Filter = string.Format("ID <> {0}", row.ID);
if (!row.Isid_DirectorNull())
dtbDirector.SelectedValue = row.id_Director;
if (!row.IsID_ParentNull())
dtbParent.SelectedValue = row.ID_Parent;
}
public override void Revert()
{
CurrentRow.RejectChanges();
}
public override bool Add()
{
var row = dsDepartments.Departments.
dsDepartments.Departments.
viewsource.View.
return true;
}
public override void RemoveLastRow()
{
CurrentRow.Delete();
}
public override void SaveChanges()
{
if (dtbDirector.SelectedValue != null && (int)dtbDirector.SelectedValue != -1)
CurrentRow.id_Director = (int)dtbDirector.
else
CurrentRow.Setid_DirectorNull(
if (dtbParent.SelectedValue != null && (int)dtbParent.SelectedValue != -1)
CurrentRow.ID_Parent = (int)dtbParent.SelectedValue;
else
CurrentRow.SetID_ParentNull();
journalDs.Departments.Merge(
base.SaveChanges();
}
public override bool IsValid()
{
ValidateControls();
return !Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
}
public override void ValidateControls()
{
var beName = BindingOperations.
if (beName != null) beName.UpdateSource();
var beCode = BindingOperations.
if (beCode != null) beCode.UpdateSource();
var beCreationDate = BindingOperations.
if (beCreationDate != null) beCreationDate.UpdateSource();
var beAddress = BindingOperations.
if (beAddress != null) beAddress.UpdateSource();
var bePhone = BindingOperations.
if (bePhone != null) bePhone.UpdateSource();
}
}
}
Файл PersonalControl.xaml.cs
using System;
using System.Data;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using Personal.
using Personal.Personal;
using Reports;
using Tools;
using Tools.Client;
using Tools.Dialogs;
using Tools.Search;
namespace Personal
{
public partial class PersonalControl : UserControl
{
readonly DepartmentsTableAdapter taDepartments = new DepartmentsTableAdapter();
readonly PersonalTableAdapter taPersonal = new PersonalTableAdapter { ClearBeforeFill = false };
readonly dic_EducationTypesTableAdapter
taEducationTypes = new dic_
readonly dic_JobTypesTableAdapter taJobTypes = new dic_JobTypesTableAdapter();
readonly dic_PositionsTableAdapter taPositions = new dic_PositionsTableAdapter();
readonly dic_RanksTableAdapter taRanks = new dic_RanksTableAdapter();
readonly WorkHistoryTableAdapter taWorkHistory = new WorkHistoryTableAdapter{
readonly PersonalVacationsTableAdapter
taVocations = new PersonalVacationsTableAdapter(
readonly BusinessTripsTableAdapter taTrips = new BusinessTripsTableAdapter();
readonly AttestationsTableAdapter taAttestations = new AttestationsTableAdapter();
private readonly dsPersonal dsPersonal;
private readonly CollectionViewSource personalviewsource;
public dsPersonal.DepartmentsRow CurrentDepartment
{
get { return (dsPersonal.DepartmentsRow) tvDepartments.SelectedItem; }
}
public dsPersonal.PersonalRow CurrentPersonal
{
get { return (dsPersonal.PersonalRow)((
}
public PersonalControl()
{
InitializeComponent();
personalviewsource = ((CollectionViewSource)(
dsPersonal = ((dsPersonal)(FindResource("
Fill();
TreeViewContext();
}
private void Fill()
{
FillDictionaries();
taDepartments.Fill(dsPersonal.
//todo: Реализовать в EditControl'е
}
private void FillDictionaries()
{
taPositions.Fill(dsPersonal.
taRanks.Fill(dsPersonal.dic_
taJobTypes.Fill(dsPersonal.
taEducationTypes.Fill(
}
private void TreeViewContext()
{
tvDepartments.DataContext = Enumerable.Where(dsPersonal.
Информация о работе Разработка системы управления персоналом