Автор работы: Пользователь скрыл имя, 04 Апреля 2014 в 23:36, дипломная работа
Цель разработки и внедрения АСУ - улучшение качества управления системами различных видов, которое достигается[1]
своевременным предоставлением с помощью АСУ полной и достоверной информации управленческому персоналу для принятия решений;
применением математических методов и моделей для принятия оптимальных решений.
Кроме того, внедрение АСУ обычно приводит к совершенствованию организационных структур и методов управления, более гибкой регламентации документооборота и процедур управления, упорядочению использования и создания нормативов, совершенствованию организации предприятия.
}
private void FillPersonal(dsPersonal.
{
taPersonal.FillByDepartment(
foreach (var departmentsRow in department.GetDepartmentsRows(
{
FillPersonal(departmentsRow);
}
}
private void TvDepartmentsSelectedItemChang
{
if (CurrentDepartment == null) return;
dsPersonal.WorkHistory.Clear()
dsPersonal.Personal.Clear();
FillPersonal(
foreach (var person in dsPersonal.Personal)
{
taWorkHistory.FillByPersonal(
}
SetStatus();
}
private void SaveChanges()
{
taPersonal.Update(dsPersonal.
taWorkHistory.Update(
}
private void SetStatus()
{
foreach (dsPersonal.PersonalRow personalRow in dsPersonal.Personal.Rows)
{
personalRow._NeedAttestation =
taAttestations.
personalRow._IsInTrip = taTrips.GetTrips(personalRow.
personalRow._IsInVocation = taVocations.GetVocations(
}
}
private void BtnAddClick(object sender, RoutedEventArgs e)
{
var editcontrol = new PersonalEdit(dsPersonal, 0) { sd = SaveChanges };
EditDialog.Add(editcontrol);
FillPersonal(
SetStatus();
}
private void BtnEditClick(object sender, RoutedEventArgs e)
{
if (tvDepartments.SelectedItem == null) return;
var editcontrol = new PersonalEdit(dsPersonal, CurrentPersonal.ID) { sd = SaveChanges };
EditDialog.Edit(editcontrol);
FillPersonal(
SetStatus();
}
private void BtnDeleteClick(object sender, RoutedEventArgs e)
{
if (lbPersonal.SelectedItem == null) return;
if (MessageBox.Show(
Properties.Resources.SDelete,
Properties.Resources.
MessageBoxButton.YesNo,
MessageBoxImage.Question,
MessageBoxResult.Yes) != MessageBoxResult.Yes) return;
((DataRowView)
SaveChanges();
FillPersonal(
SetStatus();
}
private void BtnRefreshClick(object sender, RoutedEventArgs e)
{
if (CurrentDepartment == null) return;
dsPersonal.WorkHistory.Clear()
dsPersonal.Personal.Clear();
FillPersonal(
foreach (var person in dsPersonal.Personal)
{
taWorkHistory.FillByPersonal(
}
SetStatus();
}
private void MiAttestationsClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new Client(ModuleNames.
window.MainGrid.Children.Add(
window.ShowDialog();
}
}
private void MiCandidatesClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new Client(ModuleNames.Candidates) { Title = "Кандидаты на работу" };
window.MainGrid.Children.Add(
window.ShowDialog();
}
}
private void MiTripsClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new Client(ModuleNames.Trips) { Title = "Командировки" };
window.MainGrid.Children.Add(
window.ShowDialog();
}
}
private void MiVocationsClick(object sender, RoutedEventArgs e)
{
if (!ModulesOpen.CheckModule(
{
var window = new Client(ModuleNames.Vocations) { Title = "Отпуска" };
window.MainGrid.Children.Add(
window.ShowDialog();
}
}
private void BtnFindClick(object sender, RoutedEventArgs e)
{
SearchWindow.Find(
}
private void MiPersonalJournalClick(object sender, RoutedEventArgs e)
{
ReportsControl.ShowCustom(
}
private void MiSinglePersonalClick(object sender, RoutedEventArgs e)
{
ReportsControl.ShowCustom(Repo
}
}
}
Файл PersonalEdit.xaml.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
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 TextBox = System.Windows.Controls.
namespace Personal.Personal
{
public partial class PersonalEdit : EditControl
{
private readonly dsPersonal dsPersonal;
private dsPersonal journalDs;
private readonly CollectionViewSource personalviewsource;
private readonly CollectionViewSource positionsviewsource;
private readonly CollectionViewSource ranksviewsource;
private readonly CollectionViewSource jobTypesviewsource;
private readonly CollectionViewSource educationTypesviewsource;
private MemoryStream imageMemoryStream;
public dsPersonal.PersonalRow CurrentRow
{
get { return (dsPersonal.PersonalRow)((
}
public PersonalEdit(dsPersonal ds, int currentId)
{
InitializeComponent();
journalDs = ds;
dsPersonal = ((dsPersonal)(FindResource("
dsPersonal.Merge(ds);
personalviewsource = ((CollectionViewSource)(
positionsviewsource = ((CollectionViewSource)(
ranksviewsource = ((CollectionViewSource)(
jobTypesviewsource = ((CollectionViewSource)(
educationTypesviewsource = ((CollectionViewSource)(
if (currentId != 0)
personalviewsource.View.
dtbDepartment.Init();
if (currentId == 0) return;
var row = (dsPersonal.Personal.FindByID(
if (!row.Isid_DepartmentNull())
dtbDepartment.SelectedValue = row.id_Department;
}
public override void Revert()
{
CurrentRow.RejectChanges();
}
public override bool Add()
{
var row = dsPersonal.Personal.
dsPersonal.Personal.
personalviewsource.View.
return true;
}
public override void RemoveLastRow()
{
CurrentRow.Delete();
}
public override void SaveChanges()
{
if ((int)dtbDepartment.
CurrentRow.id_Department = (int)dtbDepartment.
else
CurrentRow.Setid_
journalDs.Personal.Merge(
journalDs.WorkHistory.Merge(
base.SaveChanges();
}
public override bool IsValid()
{
ValidateControls();
return !Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
!Validation.GetHasError(
}
public override void ValidateControls()
{
var beFirstName = BindingOperations.
if (beFirstName != null) beFirstName.UpdateSource();
var beLastName = BindingOperations.
if (beLastName != null) beLastName.UpdateSource();
var bePatronimic = BindingOperations.
if (bePatronimic != null) bePatronimic.UpdateSource();
var beDateOfBirth = BindingOperations.
if (beDateOfBirth != null) beDateOfBirth.UpdateSource();
var beAddress = BindingOperations.
if (beAddress != null) beAddress.UpdateSource();
var bePhone = BindingOperations.
if (bePhone != null) bePhone.UpdateSource();
var beBirthPlace = BindingOperations.
if (beBirthPlace != null) beBirthPlace.UpdateSource();
var beDocNumber = BindingOperations.
if (beDocNumber != null) beDocNumber.UpdateSource();
var beDocGivenDate = BindingOperations.
if (beDocGivenDate != null) beDocGivenDate.UpdateSource();
var beContractNumber = BindingOperations.
if (beContractNumber != null) beContractNumber.UpdateSource(
var beSalary = BindingOperations.
if (beSalary != null) beSalary.UpdateSource();
}
private void BtnImageDialogClick(object sender, RoutedEventArgs e)
{
var dialog = new OpenFileDialog();
if (dialog.ShowDialog() != DialogResult.OK) return;
var fs = (FileStream)dialog.OpenFile();
imageMemoryStream = new MemoryStream();
for (long i = 0; i < fs.Length; i++)
imageMemoryStream.WriteByte((
tbImagePath.Text = dialog.FileName;
}
private void BtnImageApplyClick(object sender, RoutedEventArgs e)
{
if (imageMemoryStream == null) return;
CurrentRow.Photo = imageMemoryStream.ToArray();
}
}
}
Файл CandidatesControl.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 Personal.
using Reports;
using Tools.Dialogs;
using Tools.Search;
namespace Personal.Candidates
{
public partial class CandidatesControl : UserControl
{
readonly СandidatesTableAdapter taCandidates = new СandidatesTableAdapter();
readonly dic_SexTableAdapter taSex = new dic_SexTableAdapter();
readonly dic_EducationTypesTableAdapter taEducationTypes = new dic_
readonly dic_DocumentTypesTableAdapter
taDocumentTypes = new dic_DocumentTypesTableAdapter(
readonly dic_PositionsTableAdapter taPositions = new dic_PositionsTableAdapter();
readonly dic_RanksTableAdapter taRanks = new dic_RanksTableAdapter();
readonly dic_JobTypesTableAdapter taJobTypes = new dic_JobTypesTableAdapter();
readonly dic_ContractTypesTableAdapter
taContractType = new dic_ContractTypesTableAdapter(
readonly PersonalTableAdapter tapersonal = new PersonalTableAdapter();
readonly DepartmentsTableAdapter taDepartment = new DepartmentsTableAdapter();
private readonly dsPersonal dsPersonal;
private readonly CollectionViewSource candidatesViewSource;
private bool? accepted = false;
public dsPersonal.СandidatesRow CurrentCandidate
{
get { return (dsPersonal.СandidatesRow)((
}
public CandidatesControl()
{
InitializeComponent();
candidatesViewSource = ((CollectionViewSource)(
dsPersonal = ((dsPersonal)(FindResource("
Fill();
}
private void Fill()
{
taCandidates.Fill(dsPersonal.
FillDictionaries();
}
private void FillDictionaries()
{
taSex.Fill(dsPersonal.dic_Sex)
taEducationTypes.Fill(
taDocumentTypes.Fill(
}
private void SaveChanges()
{
taCandidates.Update(
}
private void BtnAddClick(object sender, RoutedEventArgs e)
{
var editcontrol = new CandidatesEdit(dsPersonal, 0) { sd = SaveChanges };
EditDialog.Add(editcontrol);
}
private void BtnEditClick(object sender, RoutedEventArgs e)
{
if (candidatesViewSource.View.
var editcontrol = new CandidatesEdit(dsPersonal, CurrentCandidate.ID) { sd = SaveChanges };
EditDialog.Edit(editcontrol);
}
private void BtnAcceptClick(object sender, RoutedEventArgs e)
{
taJobTypes.Fill(dsPersonal.
taContractType.Fill(
taPositions.Fill(dsPersonal.di
taRanks.Fill(dsPersonal.dic_
taDepartment.Fill(dsPersonal.
var row = dsPersonal.Personal.
row.FirstName = CurrentCandidate.FirstName;
row.LastName = CurrentCandidate.LastName;
row.Patronimic = CurrentCandidate.Patronimic;
row.DateOfBirth = CurrentCandidate.DateOfBirth;
row.id_Sex = CurrentCandidate.id_Sex;
row.id_Document = CurrentCandidate.id_Document;
row.DocumentNumber = CurrentCandidate.
row.DocGivenDate = CurrentCandidate.DocGivenDate;
row.id_EducationType = CurrentCandidate.id_
row.Address = CurrentCandidate.Address;
row.Phone = CurrentCandidate.Phone;
dsPersonal.Personal.
var editcontrol = new Personal.PersonalEdit(
accepted = EditDialog.Edit(editcontrol);
if (accepted == null || !((bool) accepted)) return;
tapersonal.Update(dsPersonal.
CurrentCandidate.Delete();
SaveChanges();
accepted = false;
}
private void BtnRefreshClick(object sender, RoutedEventArgs e)
{
Fill();
}
private void BtnFindClick(object sender, RoutedEventArgs e)
{
SearchWindow.Find(
}
private void MiCandidatesJournalClick(
{
Информация о работе Разработка системы управления персоналом