Разработка системы управления персоналом

Автор работы: Пользователь скрыл имя, 04 Апреля 2014 в 23:36, дипломная работа

Краткое описание

Цель разработки и внедрения АСУ - улучшение качества управления системами различных видов, которое достигается[1]
своевременным предоставлением с помощью АСУ полной и достоверной информации управленческому персоналу для принятия решений;
применением математических методов и моделей для принятия оптимальных решений.
Кроме того, внедрение АСУ обычно приводит к совершенствованию организационных структур и методов управления, более гибкой регламентации документооборота и процедур управления, упорядочению использования и создания нормативов, совершенствованию организации предприятия.

Вложенные файлы: 1 файл

Diplom_russ.doc

— 4.14 Мб (Скачать файл)

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.iPersonal, 20, 10);

            _notifyIcon.Visible = true;

            _notifyIcon.ContextMenuStrip = _iconContextMenu;

            _notifyIcon.Text = Properties.Resources.SNotifyInfo;

            _notifyIcon.BalloonTipTitle = Properties.Resources.SNotifyInfo;

            _notifyIcon.MouseDoubleClick += TraybtnShowClick;

 

            //Создаем кнопки для ContextMenu

            var btnShow = new ToolStripMenuItem(Properties.Resources.SOpen);

            btnShow.Click += TraybtnShowClick;

 

            var separator = new ToolStripSeparator();

 

            var btnClose = new ToolStripMenuItem(Properties.Resources.SExit);

            btnClose.Click += TraybtnCloseClick;

 

            _iconContextMenu.Items.AddRange(new ToolStripItem[]{btnShow, separator, btnClose});

        }

        private void TraybtnShowClick(object sender, EventArgs e)

        {

            Show();

        }

        private void TraybtnCloseClick(object sender, EventArgs e)

        {

            if (System.Windows.MessageBox.Show(

                    Properties.Resources.SExitConfirm,

                    Properties.Resources.SConfirm,

                    MessageBoxButton.YesNo,

                    MessageBoxImage.Question,

                    MessageBoxResult.Yes) == MessageBoxResult.Yes)

            {

                _notifyIcon.Dispose();

                Application.Current.Shutdown();

            }

        }

        private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)

        {

            e.Cancel = true;

        }

        private void ButtonClick(object sender, RoutedEventArgs e)

        {

            Hide();

        }

        private void BtnDepartmentsClick(object sender, RoutedEventArgs e)

        {

            if (!ModulesOpen.CheckModule(ModuleNames.Departments))

            {

                var window = new Client(ModuleNames.Departments) { Title = "Подразделения" };

                window.MainGrid.Children.Add(new Departments.DepartmentsControl());

                Hide();

                window.ShowDialog();

            }

        }

        private void ButtonPersonalClick(object sender, RoutedEventArgs e)

        {

            if (!ModulesOpen.CheckModule(ModuleNames.Personal))

            {

                var window = new Client(ModuleNames.Personal) { Title = "Персонал" };

                window.MainGrid.Children.Add(new Personal.PersonalControl());

                Hide();

                window.ShowDialog();

            }

        }

 

        private void BtnProjectsClick(object sender, RoutedEventArgs e)

        {

            if (!ModulesOpen.CheckModule(ModuleNames.Projects))

            {

                var window = new Client(ModuleNames.Projects) { Title = "Проекты" };

                window.MainGrid.Children.Add(new Projects.Projects.ProjectsControl());

                Hide();

                window.ShowDialog();

            }

        }

 

        private void BtnReportsClick(object sender, RoutedEventArgs e)

        {

            if (!ModulesOpen.CheckModule(ModuleNames.Reports))

            {

                var window = new Client(ModuleNames.Reports) { Title = "Отчеты" };

                window.MainGrid.Children.Add(new Reports.ReportsControl());

                Hide();

                window.ShowDialog();

            }

        }

 

        private void BtnToolsClick(object sender, RoutedEventArgs e)

        {

            if (!ModulesOpen.CheckModule(ModuleNames.Tools))

            {

                var window = new PropertiesDialog();

                ModulesOpen.AddModule(ModuleNames.Tools);

                window.ShowDialog();

                ModulesOpen.RemoveModule(ModuleNames.Tools);

            }

        }

        private void BtnDepartmentsMouseEnter(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = "Подразделения";

        }

        private void BtnDepartmentsMouseLeave(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = string.Empty;

        }

        private void BtnPersonalMouseEnter(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = "Персонал";

        }

        private void BtnPersonalMouseLeave(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = string.Empty;

        }

        private void BtnProjectsMouseEnter(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = "Проекты";

        }

        private void BtnProjectsMouseLeave(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = string.Empty;

        }

        private void BtnReportsMouseEnter(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = "Отчеты";

        }

        private void BtnReportsMouseLeave(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = string.Empty;

        }

        private void BtnToolsMouseEnter(object sender, System.Windows.Input.MouseEventArgs e)

        {

            tbStatus.Text = "Настройки";

        }

        private void BtnToolsMouseLeave(object sender, System.Windows.Input.MouseEventArgs e)

        {

            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.dsDepartmentsTableAdapters;

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.FindByID((int)tvDepartments.SelectedValue); }

        }

        public DepartmentsControl()

        {

            InitializeComponent();

            dsDepartments = ((dsDepartments)(FindResource("dsDepartments")));

            Fill();

            TreeViewContext();

        }

        private void Fill()

        {

            taDepartments.Fill(dsDepartments.Departments);

            taPersonal.Fill(dsDepartments.Personal);

        }

        private void SaveChanges()

        {

            taDepartments.Update(dsDepartments.Departments);

        }

        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.SDeleteConfirm,

                MessageBoxButton.YesNo,

                MessageBoxImage.Question,

                MessageBoxResult.Yes) != MessageBoxResult.Yes) return;

            ((dsDepartments.DepartmentsRow)tvDepartments.SelectedItem).Delete();

            SaveChanges();

            TreeViewContext();

        }

        private void BtnRefreshClick(object sender, RoutedEventArgs e)

        {

            Fill();

            TreeViewContext();

       }

        private void MiDepartmentsJournalClick(object sender, RoutedEventArgs e)

        {

            ReportsControl.ShowCustom(ReportIndexes.ReportIndex.DepartmentsJournal);

        }

        private void MiSingleDepartmentClick(object sender, RoutedEventArgs e)

        {

            ReportsControl.ShowCustom(ReportIndexes.ReportIndex.SingleDepartment);

        }

        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).Row; }

        }

        public DepartmentEdit(dsDepartments ds, int currentId)

        {

            //todo: Сделать потом нормально

            dsDepartments.Merge(ds);

            journalDs = ds;

            InitializeComponent();

            viewsource = ((CollectionViewSource)(FindResource("departmentsViewSource")));

            viewsource.Source = dsDepartments.Departments;

            if (currentId != 0)

        viewsource.View.MoveCurrentToPosition(dsDepartments.Departments.FindByID(currentId).GetRowPosition());

            dtbDirector.MainDataSet = dsDepartments;

            dtbParent.MainDataSet = dsDepartments;

            dtbDirector.Init();

            dtbParent.Init();

            if (currentId == 0) return;

            var row = (dsDepartments.Departments.FindByID(currentId));

            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.NewDepartmentsRow();

            dsDepartments.Departments.AddDepartmentsRow(row);

            viewsource.View.MoveCurrentToLast();

            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.SelectedValue;

            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(dsDepartments.Departments);

            base.SaveChanges();

        }

        public override bool IsValid()

        {

            ValidateControls();

            return !Validation.GetHasError(tbName) &&

                   !Validation.GetHasError(tbCode) &&

                   !Validation.GetHasError(dtpCreationDate) &&

                   !Validation.GetHasError(tbAddressNoInBase) &&

                   !Validation.GetHasError(tbPhone);

        }

        public override void ValidateControls()

        {

            var beName = BindingOperations.GetBindingExpression(tbName, TextBox.TextProperty);

            if (beName != null) beName.UpdateSource();

            var beCode = BindingOperations.GetBindingExpression(tbCode, TextBox.TextProperty);

            if (beCode != null) beCode.UpdateSource();

            var beCreationDate = BindingOperations.GetBindingExpression(dtpCreationDate, DatePicker.SelectedDateProperty);

            if (beCreationDate != null) beCreationDate.UpdateSource();

            var beAddress = BindingOperations.GetBindingExpression(tbAddressNoInBase, TextBox.TextProperty);

            if (beAddress != null) beAddress.UpdateSource();

            var bePhone = BindingOperations.GetBindingExpression(tbPhone, TextBox.TextProperty);

            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.dsPersonalTableAdapters;

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_EducationTypesTableAdapter();

        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{ClearBeforeFill = false};

        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)((DataRowView)personalviewsource.View.CurrentItem).Row; }

        }

        public PersonalControl()

        {

            InitializeComponent();

            personalviewsource = ((CollectionViewSource)(FindResource("personalViewSource")));

            dsPersonal = ((dsPersonal)(FindResource("dsPersonal")));

            Fill();

            TreeViewContext();

        }

        private void Fill()

        {

            FillDictionaries();

            taDepartments.Fill(dsPersonal.Departments);

            //todo: Реализовать в EditControl'е

        }

        private void FillDictionaries()

        {

            taPositions.Fill(dsPersonal.dic_Positions);

            taRanks.Fill(dsPersonal.dic_Ranks);

            taJobTypes.Fill(dsPersonal.dic_JobTypes);

            taEducationTypes.Fill(dsPersonal.dic_EducationTypes);

        }

        private void TreeViewContext()

        {

            tvDepartments.DataContext = Enumerable.Where(dsPersonal.Departments, item => item.IsID_ParentNull());

Информация о работе Разработка системы управления персоналом