Last fixes
This commit is contained in:
2
ClassDiagram1.cd
Normal file
2
ClassDiagram1.cd
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram />
|
BIN
ClassDiagram1.png
Normal file
BIN
ClassDiagram1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 328 KiB |
220
DC/CD_DB.cd
Normal file
220
DC/CD_DB.cd
Normal file
@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.DataBase.Access">
|
||||
<Position X="0.5" Y="9" Width="2.5" />
|
||||
<AssociationLine Name="User" Type="Diplom_O.DataBase.User" FixedFromPoint="true">
|
||||
<Path>
|
||||
<Point X="3" Y="9.75" />
|
||||
<Point X="5" Y="9.75" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAADAAAAAAAAAAAAAAAAAAgAACAAgAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\AccessDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="User" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Chel">
|
||||
<Position X="5" Y="0.5" Width="2.75" />
|
||||
<AssociationLine Name="Learny" Type="Diplom_O.DataBase.Learn" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5" Y="2.938" />
|
||||
<Point X="3" Y="2.938" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="Rabotniky" Type="Diplom_O.DataBase.Rabotnik" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="7.562" Y="3.719" />
|
||||
<Point X="7.562" Y="4.25" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="Freey" Type="Diplom_O.DataBase.Free" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5" Y="1.312" />
|
||||
<Point X="3" Y="1.312" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AgACAAAAAAAAEBAAADAAAABAAAAMAAADAAAAoAIBAAA=</HashCode>
|
||||
<FileName>DataBase\ChelDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="CorrStajy" />
|
||||
<Property Name="Learny" />
|
||||
<Property Name="Rabotniky" />
|
||||
<Property Name="Freey" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Child">
|
||||
<Position X="0.5" Y="5.25" Width="2.5" />
|
||||
<AssociationLine Name="Parent1" Type="Diplom_O.DataBase.Chel" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="3" Y="5.688" />
|
||||
<Point X="3.367" Y="5.688" />
|
||||
<Point X="3.367" Y="3.625" />
|
||||
<Point X="5" Y="3.625" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="Parent2" Type="Diplom_O.DataBase.Chel" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="3" Y="5.5" />
|
||||
<Point X="3.188" Y="5.5" />
|
||||
<Point X="3.188" Y="3.312" />
|
||||
<Point X="5" Y="3.312" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AgACAAAAAAAAABAAAAAAAAAAAwAMMAAAAAAAAAIAAAA=</HashCode>
|
||||
<FileName>DataBase\ChildDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Parent1" />
|
||||
<Property Name="Parent2" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.CorrStaj">
|
||||
<Position X="9.5" Y="0.5" Width="2.75" />
|
||||
<AssociationLine Name="TypeStaj" Type="Diplom_O.DataBase.TypeStaj" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="12.062" Y="2.757" />
|
||||
<Point X="12.062" Y="3.25" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAACAAAAJAAAAAAEAAAAAAAAAAAACAAEAAQAAAAABAA=</HashCode>
|
||||
<FileName>DataBase\CorrStajDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Chel" />
|
||||
<Property Name="TypeStaj" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Free">
|
||||
<Position X="0.5" Y="0.5" Width="2.5" />
|
||||
<AssociationLine Name="Chel" Type="Diplom_O.DataBase.Chel" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="3" Y="0.937" />
|
||||
<Point X="5" Y="0.937" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICAAAAACAAAAAAAAAAAAAAAAAACAAAAQAAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\FreeDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Chel" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Learn">
|
||||
<Position X="0.5" Y="2.5" Width="2.5" />
|
||||
<AssociationLine Name="Chel" Type="Diplom_O.DataBase.Chel" FixedFromPoint="true">
|
||||
<Path>
|
||||
<Point X="3" Y="2.625" />
|
||||
<Point X="5" Y="2.625" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICCAQAAAAQAAAAAAAAAAAAAAAACAAAAQAAQAAAAAA=</HashCode>
|
||||
<FileName>DataBase\LearnDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Chel" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Rabotnik">
|
||||
<Position X="5" Y="4.25" Width="2.75" />
|
||||
<AssociationLine Name="Chel" Type="Diplom_O.DataBase.Chel" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.562" Y="4.25" />
|
||||
<Point X="5.562" Y="3.719" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="Shtat" Type="Diplom_O.DataBase.Shtat" FixedFromPoint="true">
|
||||
<Path>
|
||||
<Point X="7.625" Y="6.507" />
|
||||
<Point X="7.625" Y="7" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="RabotnikTypeStajy" Type="Diplom_O.DataBase.RabotnikTypeStaj" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="7.75" Y="5.125" />
|
||||
<Point X="11.75" Y="5.125" />
|
||||
<Point X="11.75" Y="5.5" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICAAAAACAAEAAAAAAAAAAAAAAACBEAAAAAAACAIAA=</HashCode>
|
||||
<FileName>DataBase\RabotinkDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Chel" />
|
||||
<Property Name="Shtat" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="RabotnikTypeStajy" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.RabotnikTypeStaj">
|
||||
<Position X="9.5" Y="5.5" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAQAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\RabotnikTypeStajDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Shtat">
|
||||
<Position X="5" Y="7" Width="2.75" />
|
||||
<AssociationLine Name="Rabotniky" Type="Diplom_O.DataBase.Rabotnik" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="6.812" Y="7" />
|
||||
<Point X="6.812" Y="6.507" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAAAgAAAAAAAAQAAAAAAAAAhAAAAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\ShtatDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="Rabotniky" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.TypeStaj">
|
||||
<Position X="9.5" Y="3.25" Width="2.75" />
|
||||
<AssociationLine Name="RabotnikTypeStajy" Type="Diplom_O.DataBase.RabotnikTypeStaj" FixedFromPoint="true">
|
||||
<Path>
|
||||
<Point X="12" Y="4.546" />
|
||||
<Point X="12" Y="5.5" />
|
||||
</Path>
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="0.122" Y="0.643" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAAAEAAAAAAAAAQAAAAAAAAAAAAAAACAAAA=</HashCode>
|
||||
<FileName>DataBase\TypeStajDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="CorrStajy" />
|
||||
<Property Name="RabotnikTypeStajy" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.User">
|
||||
<Position X="5" Y="9" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAQAAAAAEAAAIAAAAAAAAAAAAAAQAAAAAIA=</HashCode>
|
||||
<FileName>DataBase\UserDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="Accessy" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.MainDB">
|
||||
<Position X="8" Y="7.25" Width="4.25" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAQAAEIAAABAAAAAAEAAAQAABACAAgACABIA=</HashCode>
|
||||
<FileName>DataBase\ConnectDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
11
DC/CD_DB_2.cd
Normal file
11
DC/CD_DB_2.cd
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.DataBase.FuncDB">
|
||||
<Position X="0.5" Y="0.5" Width="6" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BSSTjADAzlZYlACEECmxBNd8Y8AAMCSYAGggMG1jQCI=</HashCode>
|
||||
<FileName>DataBase\AccessDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
50
DC/CD_M_1.cd
Normal file
50
DC/CD_M_1.cd
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.DataBase.Child">
|
||||
<Position X="0.5" Y="8.25" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AgACAAAAAAAAABAAAAAAAAAAAwAMMAAAAAAAAAIAAAA=</HashCode>
|
||||
<FileName>DataBase\ChildDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.User">
|
||||
<Position X="5.75" Y="5.75" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAQAAAAAEAAAIAAAAAAAAAAAAAAQAAAAAIA=</HashCode>
|
||||
<FileName>DataBase\UserDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.Program">
|
||||
<Position X="5.75" Y="8.25" Width="2.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAABAAAAAA=</HashCode>
|
||||
<FileName>Program.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.ChildForm">
|
||||
<Position X="0.5" Y="0.5" Width="5" />
|
||||
<AssociationLine Name="child" Type="Diplom_O.DataBase.Child">
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="0.148" Y="0.082" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAgQBAABGCCACCCAAACACAABAQBAAAA8gE=</HashCode>
|
||||
<FileName>SupportForms\ChildForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="child" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.LoginForm">
|
||||
<Position X="5.75" Y="0.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAAQBAAAACCCCACAAAAACAAAAABQBAAQQE=</HashCode>
|
||||
<FileName>SupportForms\LoginForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="user" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
24
DC/CD_M_2.cd
Normal file
24
DC/CD_M_2.cd
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.ChildForm">
|
||||
<Position X="4.5" Y="0.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AIgQBAABgCAAABADAACACCADAAAIAQEIgGAAACABAAE=</HashCode>
|
||||
<FileName>MainForms\ChildForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.LoginForm">
|
||||
<Position X="8.5" Y="0.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAAQBAAAACCCCACAAAAACAAEAABAAAAQAE=</HashCode>
|
||||
<FileName>MainForms\LoginForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.OtpForm">
|
||||
<Position X="0.5" Y="0.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>QIAQEAABACAAQBADAECACGACAAAAAQAIgGAAAAABIBE=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
105
DC/CD_M_3.cd
Normal file
105
DC/CD_M_3.cd
Normal file
@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.DataBase.Rabotnik">
|
||||
<Position X="0.5" Y="12" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICAAAAACAAEAAAAAAAAAAAAAAACBEAAAAAAACAIAA=</HashCode>
|
||||
<FileName>DataBase\RabotinkDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.RabForm">
|
||||
<Position X="0.5" Y="0.5" Width="4.75" />
|
||||
<AssociationLine Name="tableMainColumns" Type="Diplom_O.ColumnConf" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.25" Y="10.5" />
|
||||
<Point X="5.792" Y="10.5" Type="JumpStart" />
|
||||
<Point X="5.958" Y="10.5" Type="JumpEnd" />
|
||||
<Point X="10.312" Y="10.5" />
|
||||
<Point X="10.312" Y="12.5" />
|
||||
</Path>
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="0.125" Y="1.684" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="tableHistoryColumns" Type="Diplom_O.ColumnConf" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.25" Y="11.062" />
|
||||
<Point X="5.792" Y="11.062" Type="JumpStart" />
|
||||
<Point X="5.958" Y="11.062" Type="JumpEnd" />
|
||||
<Point X="10.062" Y="11.062" />
|
||||
<Point X="10.062" Y="12.5" />
|
||||
</Path>
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="0.112" Y="1.072" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="tableStajColumns" Type="Diplom_O.ColumnConf" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.25" Y="10.062" />
|
||||
<Point X="5.792" Y="10.062" Type="JumpStart" />
|
||||
<Point X="5.958" Y="10.062" Type="JumpEnd" />
|
||||
<Point X="10.562" Y="10.062" />
|
||||
<Point X="10.562" Y="12.5" />
|
||||
</Path>
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="0.151" Y="2.1" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="formResult" Type="Diplom_O.DataBase.Rabotnik" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.062" Y="11.8" />
|
||||
<Point X="5.062" Y="13.25" />
|
||||
<Point X="3.25" Y="13.25" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AKASAAgDJCEAABYVDCSBCCKCIABAIQEIQLhBESgJABE=</HashCode>
|
||||
<FileName>MainForms\RabForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="formResult" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Field Name="tableMainColumns" />
|
||||
<Field Name="tableHistoryColumns" />
|
||||
<Field Name="tableStajColumns" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.StajForm">
|
||||
<Position X="5.75" Y="0.5" Width="5.25" />
|
||||
<AssociationLine Name="rabotnik" Type="Diplom_O.DataBase.Rabotnik" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.875" Y="9.684" />
|
||||
<Point X="5.875" Y="13.875" />
|
||||
<Point X="3.25" Y="13.875" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="tableStajColumns" Type="Diplom_O.ColumnConf" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="10.812" Y="9.684" />
|
||||
<Point X="10.812" Y="12.5" />
|
||||
</Path>
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="0.149" Y="2.544" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AKAQAAABACARABAXAAaAKCCiBAEIAQAIAGBAAQAhIIE=</HashCode>
|
||||
<FileName>MainForms\StajForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="rabotnik" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Field Name="tableStajColumns" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Struct Name="Diplom_O.ColumnConf">
|
||||
<Position X="6.25" Y="12.5" Width="4.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAIAAAAAAAAAEAEAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>GlobalFormFunc.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Struct>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
61
DC/CD_M_4.cd
Normal file
61
DC/CD_M_4.cd
Normal file
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.DataBase.Shtat">
|
||||
<Position X="5.5" Y="1" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAAAgAAAAAAAAQAAAAAAAAAhAAAAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\ShtatDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.ShtatForm">
|
||||
<Position X="0.5" Y="0.5" Width="4.75" />
|
||||
<AssociationLine Name="tableColumns" Type="Diplom_O.ColumnConf" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.25" Y="7.812" />
|
||||
<Point X="7.438" Y="7.812" />
|
||||
<Point X="7.438" Y="8.75" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="formResult" Type="Diplom_O.DataBase.Shtat" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.25" Y="0.625" />
|
||||
<Point X="8.062" Y="0.625" />
|
||||
<Point X="8.062" Y="1" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AIAQAAAhACAIQhAHBCCBCCICAAAAAwEIgMBhACABAAE=</HashCode>
|
||||
<FileName>MainForms\ShtatForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="formResult" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Field Name="tableColumns" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.WorkShtatForm">
|
||||
<Position X="5.5" Y="3.25" Width="3.75" />
|
||||
<AssociationLine Name="shtat" Type="Diplom_O.DataBase.Shtat" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="8" Y="3.25" />
|
||||
<Point X="8" Y="2.873" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAQACAAQBAAAACCACACAAAAACAAAAABAAABQCk=</HashCode>
|
||||
<FileName>SupportForms\WorkShtatForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="shtat" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Struct Name="Diplom_O.ColumnConf">
|
||||
<Position X="1.75" Y="8.75" Width="6" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAIAAAAAAAAAEAEAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>GlobalFormFunc.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Struct>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
45
DC/CD_M_5.cd
Normal file
45
DC/CD_M_5.cd
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.DataBase.Chel">
|
||||
<Position X="6" Y="1" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AgACAAAAAAAAEBAAADAAAABAAAAMAAADAAAAoAIBAAA=</HashCode>
|
||||
<FileName>DataBase\ChelDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.ChelForm">
|
||||
<Position X="0.5" Y="0.5" Width="5.25" />
|
||||
<AssociationLine Name="tableColumns" Type="Diplom_O.ColumnConf" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.75" Y="5.125" />
|
||||
<Point X="8.625" Y="5.125" />
|
||||
<Point X="8.625" Y="5.5" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="formResult" Type="Diplom_O.DataBase.Chel" ManuallyRouted="true" FixedFromPoint="true" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="5.75" Y="0.625" />
|
||||
<Point X="8.562" Y="0.625" />
|
||||
<Point X="8.562" Y="1" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AIExAAABACAIQBAHBCCBCCACAAAAAQGYgMBhACABAAE=</HashCode>
|
||||
<FileName>MainForms\ChelForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="formResult" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Field Name="tableColumns" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Struct Name="Diplom_O.ColumnConf">
|
||||
<Position X="6" Y="5.5" Width="4.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAIAAAAAAAAAEAEAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>GlobalFormFunc.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Struct>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
52
DC/CD_M_6.cd
Normal file
52
DC/CD_M_6.cd
Normal file
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.DataBase.Free">
|
||||
<Position X="0.5" Y="6.5" Width="2.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICAAAAACAAAAAAAAAAAAAAAAAACAAAAQAAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\FreeDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Learn">
|
||||
<Position X="5.25" Y="0.5" Width="2.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICCAQAAAAQAAAAAAAAAAAAAAAACAAAAQAAQAAAAAA=</HashCode>
|
||||
<FileName>DataBase\LearnDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.LearnForm">
|
||||
<Position X="0.5" Y="0.5" Width="3.75" />
|
||||
<AssociationLine Name="learn" Type="Diplom_O.DataBase.Learn" FixedToPoint="true">
|
||||
<Path>
|
||||
<Point X="4.25" Y="0.875" />
|
||||
<Point X="5.25" Y="0.875" />
|
||||
</Path>
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="0.161" Y="0.121" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>ACAAAEAQACAAQBAAAACCACACAAABACDAEAABAAQAQAE=</HashCode>
|
||||
<FileName>SupportForms\LearnForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="learn" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.OptForm">
|
||||
<Position X="4.5" Y="3.25" Width="4.25" />
|
||||
<AssociationLine Name="free" Type="Diplom_O.DataBase.Free">
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="0.131" Y="0.147" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAkAAACABQBEQAACCACACAAAAACAAAAABAAUAQAE=</HashCode>
|
||||
<FileName>SupportForms\OptForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="free" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
30
DC/CD_M_7.cd
Normal file
30
DC/CD_M_7.cd
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.LearnForm">
|
||||
<Position X="3.25" Y="0.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>QIAQAAABACAAABADAACACCACAAAAQQAIgEAAAAABIAE=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SettingsForm">
|
||||
<Position X="7.25" Y="0.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>QIAUAAABACAAAACJAQCACCACAAA4AQAIECAgAAABAAE=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.WorkChelForm">
|
||||
<Position X="11.25" Y="0.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>EAgAQAAAACAQQBAABCCCACCCAAACACAAAAhBAAEAQAk=</HashCode>
|
||||
<FileName>SupportForms\WorkChelForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.WorkerForm">
|
||||
<Position X="0.5" Y="0.5" Width="2.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAAABgDAACCACACAAACACAAAAAAAAEAAAE=</HashCode>
|
||||
<NewMemberFileName>SupportForms\WorkerForm.Designer.cs</NewMemberFileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
462
DC/ClassDiagram2.cd
Normal file
462
DC/ClassDiagram2.cd
Normal file
@ -0,0 +1,462 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
|
||||
<Class Name="Diplom_O.DataBase.Access">
|
||||
<Position X="12.25" Y="5.25" Width="2.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAADAAAAAAAAAAAAAAAAAAgAACAAgAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\AccessDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="User" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.FuncDB">
|
||||
<Position X="11.5" Y="15" Width="6" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BSSTjADAzlZYlACEECmxBNd8Y8AAMCSYAGggMG1jQCI=</HashCode>
|
||||
<FileName>DataBase\AccessDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Chel">
|
||||
<Position X="16.75" Y="8" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AgACAAAAAAAAEBAAADAAAABAAAAMAAADAAAAoAIBAAA=</HashCode>
|
||||
<FileName>DataBase\ChelDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="CorrStajy" />
|
||||
<Property Name="Learny" />
|
||||
<Property Name="Rabotniky" />
|
||||
<Property Name="Freey" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Child">
|
||||
<Position X="16.75" Y="12" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AgACAAAAAAAAABAAAAAAAAAAAwAMMAAAAAAAAAIAAAA=</HashCode>
|
||||
<FileName>DataBase\ChildDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Parent1" />
|
||||
<Property Name="Parent2" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.MainDB">
|
||||
<Position X="12.25" Y="3" Width="4.25" />
|
||||
<AssociationLine Name="Shtat" Type="Diplom_O.DataBase.Shtat" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="16.5" Y="3.875" />
|
||||
<Point X="18.042" Y="3.875" Type="JumpStart" />
|
||||
<Point X="18.208" Y="3.875" Type="JumpEnd" />
|
||||
<Point X="28.542" Y="3.875" Type="JumpStart" />
|
||||
<Point X="28.708" Y="3.875" Type="JumpEnd" />
|
||||
<Point X="33.167" Y="3.875" />
|
||||
<Point X="33.167" Y="11.562" />
|
||||
<Point X="30" Y="11.562" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="Rabotniky" Type="Diplom_O.DataBase.Rabotnik" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="12.25" Y="4.062" />
|
||||
<Point X="11.422" Y="4.062" />
|
||||
<Point X="11.422" Y="14.619" />
|
||||
<Point X="19.853" Y="14.619" Type="JumpStart" />
|
||||
<Point X="20.019" Y="14.619" Type="JumpEnd" />
|
||||
<Point X="22.174" Y="14.619" Type="JumpStart" />
|
||||
<Point X="22.341" Y="14.619" Type="JumpEnd" />
|
||||
<Point X="22.792" Y="14.619" Type="JumpStart" />
|
||||
<Point X="22.958" Y="14.619" Type="JumpEnd" />
|
||||
<Point X="23.081" Y="14.619" Type="JumpStart" />
|
||||
<Point X="23.247" Y="14.619" Type="JumpEnd" />
|
||||
<Point X="23.812" Y="14.619" />
|
||||
<Point X="23.812" Y="12.257" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="Chely" Type="Diplom_O.DataBase.Chel" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="12.25" Y="4.312" />
|
||||
<Point X="11.743" Y="4.312" />
|
||||
<Point X="11.743" Y="12.904" />
|
||||
<Point X="15.307" Y="12.904" />
|
||||
<Point X="15.307" Y="11.594" />
|
||||
<Point X="17.25" Y="11.594" />
|
||||
<Point X="17.25" Y="11.219" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="RabotnikTypeStajy" Type="Diplom_O.DataBase.RabotnikTypeStaj" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="16.5" Y="4.062" />
|
||||
<Point X="18.042" Y="4.062" Type="JumpStart" />
|
||||
<Point X="18.208" Y="4.062" Type="JumpEnd" />
|
||||
<Point X="28.542" Y="4.062" Type="JumpStart" />
|
||||
<Point X="28.708" Y="4.062" Type="JumpEnd" />
|
||||
<Point X="30.375" Y="4.062" />
|
||||
<Point X="30.375" Y="9.5" />
|
||||
<Point X="30" Y="9.5" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="Childy" Type="Diplom_O.DataBase.Child" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="12.25" Y="4.188" />
|
||||
<Point X="11.582" Y="4.188" />
|
||||
<Point X="11.582" Y="13.312" />
|
||||
<Point X="16.75" Y="13.312" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="Learny" Type="Diplom_O.DataBase.Learn" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="12.25" Y="4.437" />
|
||||
<Point X="11.881" Y="4.437" />
|
||||
<Point X="11.881" Y="9.864" />
|
||||
<Point X="14.25" Y="9.864" />
|
||||
<Point X="14.25" Y="10.25" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAQAAEIAAABAAAAAAEAAAQAABACAAgACABIA=</HashCode>
|
||||
<FileName>DataBase\ConnectDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="Shtat" />
|
||||
<Property Name="Rabotniky" />
|
||||
<Property Name="Chely" />
|
||||
<Property Name="TypeStajy" />
|
||||
<Property Name="RabotnikTypeStajy" />
|
||||
<Property Name="Childy" />
|
||||
<Property Name="Learny" />
|
||||
<Property Name="CorrStajy" />
|
||||
<Property Name="Freey" />
|
||||
<Property Name="Accessy" />
|
||||
<Property Name="Usery" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.CorrStaj">
|
||||
<Position X="21.5" Y="7" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAACAAAAJAAAAAAEAAAAAAAAAAAACAAEAAQAAAAABAA=</HashCode>
|
||||
<FileName>DataBase\CorrStajDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Chel" />
|
||||
<Property Name="TypeStaj" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Free">
|
||||
<Position X="12.25" Y="7.75" Width="2.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICAAAAACAAAAAAAAAAAAAAAAAACAAAAQAAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\FreeDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Chel" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Learn">
|
||||
<Position X="12.25" Y="10.25" Width="2.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICCAQAAAAQAAAAAAAAAAAAAAAACAAAAQAAQAAAAAA=</HashCode>
|
||||
<FileName>DataBase\LearnDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Chel" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Rabotnik">
|
||||
<Position X="21.5" Y="10" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>BAICAAAAACAAEAAAAAAAAAAAAAAACBEAAAAAAACAIAA=</HashCode>
|
||||
<FileName>DataBase\RabotinkDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Property Name="Chel" />
|
||||
<Property Name="Shtat" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="RabotnikTypeStajy" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.RabotnikTypeStaj">
|
||||
<Position X="27.25" Y="9" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAQAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\RabotnikTypeStajDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.Shtat">
|
||||
<Position X="27.25" Y="11" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAAAgAAAAAAAAQAAAAAAAAAhAAAAAAAAAAA=</HashCode>
|
||||
<FileName>DataBase\ShtatDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="Rabotniky" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.TypeStaj">
|
||||
<Position X="27.25" Y="7" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAAAEAAAAAAAAAQAAAAAAAAAAAAAAACAAAA=</HashCode>
|
||||
<FileName>DataBase\TypeStajDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="CorrStajy" />
|
||||
<Property Name="RabotnikTypeStajy" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.DataBase.User">
|
||||
<Position X="16.75" Y="5.25" Width="2.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAACAAAAAAQAAAAAEAAAIAAAAAAAAAAAAAAQAAAAAIA=</HashCode>
|
||||
<FileName>DataBase\UserDB.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Property Name="Accessy" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.Program">
|
||||
<Position X="34" Y="10.5" Width="2.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAABAAAAAA=</HashCode>
|
||||
<FileName>Program.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.ChelForm">
|
||||
<Position X="24.25" Y="27" Width="5.25" />
|
||||
<AssociationLine Name="tableColumns" Type="Diplom_O.ColumnConf" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="24.25" Y="27.488" />
|
||||
<Point X="23.423" Y="27.488" />
|
||||
<Point X="23.423" Y="16.562" />
|
||||
<Point X="27.5" Y="16.562" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="formResult" Type="Diplom_O.DataBase.Chel" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="24.25" Y="27.625" />
|
||||
<Point X="23.164" Y="27.625" />
|
||||
<Point X="23.164" Y="14.428" />
|
||||
<Point X="22.958" Y="14.428" Type="JumpStart" />
|
||||
<Point X="22.792" Y="14.428" Type="JumpEnd" />
|
||||
<Point X="22.341" Y="14.428" Type="JumpStart" />
|
||||
<Point X="22.174" Y="14.428" Type="JumpEnd" />
|
||||
<Point X="20.134" Y="14.428" />
|
||||
<Point X="20.134" Y="9.471" />
|
||||
<Point X="19.5" Y="9.471" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AIExAAABACAIQBAHBCCBCCACAAAAAQGYgMBhACABAAE=</HashCode>
|
||||
<FileName>MainForms\ChelForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="formResult" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Field Name="tableColumns" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.ChildForm">
|
||||
<Position X="34" Y="25.75" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AIgQBAABgCAAABADAACACCADAAAIAQEIgGAAACABAAE=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.LearnForm">
|
||||
<Position X="30" Y="17.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>QIAQAAABACAAABADAACACCACAAAAQQAIgEAAAAABIAE=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.LoginForm">
|
||||
<Position X="30" Y="29.75" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAAQBAAAACCCCACAAAAACAAEAABAAAAQAE=</HashCode>
|
||||
<FileName>MainForms\LoginForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.OtpForm">
|
||||
<Position X="34" Y="17.5" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>QIAQEAABACAAQBADAECACGACAAAAAQAIgGAAAAABIBE=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.RabForm">
|
||||
<Position X="17.75" Y="17.5" Width="4.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AKASAAgDJCEAABYVDCSBCCKCIABAIQEIQLhBESgJABE=</HashCode>
|
||||
<FileName>MainForms\RabForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="formResult" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Field Name="tableMainColumns" />
|
||||
<Field Name="tableHistoryColumns" />
|
||||
<Field Name="tableStajColumns" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SettingsForm">
|
||||
<Position X="30" Y="23" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>QIAUAAABACAAAACJAQCACCACAAA4AQAIECAgAAABAAE=</HashCode>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.ShtatForm">
|
||||
<Position X="17.75" Y="29.25" Width="4.75" />
|
||||
<AssociationLine Name="tableColumns" Type="Diplom_O.ColumnConf" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="22.5" Y="29.75" />
|
||||
<Point X="23.08" Y="29.75" />
|
||||
<Point X="23.08" Y="16.188" />
|
||||
<Point X="23.081" Y="16.188" Type="JumpStart" />
|
||||
<Point X="23.247" Y="16.188" Type="JumpEnd" />
|
||||
<Point X="27.5" Y="16.188" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<AssociationLine Name="formResult" Type="Diplom_O.DataBase.Shtat" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="22.5" Y="29.555" />
|
||||
<Point X="22.875" Y="29.555" />
|
||||
<Point X="22.875" Y="12.507" />
|
||||
<Point X="23.729" Y="12.507" Type="JumpStart" />
|
||||
<Point X="23.895" Y="12.507" Type="JumpEnd" />
|
||||
<Point X="24.5" Y="12.507" />
|
||||
<Point X="24.5" Y="12.125" />
|
||||
<Point X="27.25" Y="12.125" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AIAQAAAhACAIQhAHBCCBCCICAAAAAwEIgMBhACABAAE=</HashCode>
|
||||
<FileName>MainForms\ShtatForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="formResult" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Field Name="tableColumns" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.StajForm">
|
||||
<Position X="24.25" Y="17.5" Width="5.25" />
|
||||
<AssociationLine Name="rabotnik" Type="Diplom_O.DataBase.Rabotnik" ManuallyRouted="true">
|
||||
<Path>
|
||||
<Point X="24.562" Y="17.5" />
|
||||
<Point X="24.562" Y="16.83" />
|
||||
<Point X="23.506" Y="16.83" Type="JumpStart" />
|
||||
<Point X="23.34" Y="16.83" Type="JumpEnd" />
|
||||
<Point X="23.247" Y="16.83" Type="JumpStart" />
|
||||
<Point X="22.997" Y="16.83" Type="JumpEnd" />
|
||||
<Point X="22.958" Y="16.83" Type="JumpStart" />
|
||||
<Point X="22.792" Y="16.83" Type="JumpEnd" />
|
||||
<Point X="22.341" Y="16.83" Type="JumpStart" />
|
||||
<Point X="22.174" Y="16.83" Type="JumpEnd" />
|
||||
<Point X="21.974" Y="16.83" Type="JumpStart" />
|
||||
<Point X="21.807" Y="16.83" Type="JumpEnd" />
|
||||
<Point X="21.301" Y="16.83" Type="JumpStart" />
|
||||
<Point X="21.135" Y="16.83" Type="JumpEnd" />
|
||||
<Point X="19.936" Y="16.83" />
|
||||
<Point X="19.936" Y="11.687" />
|
||||
<Point X="20.051" Y="11.687" Type="JumpStart" />
|
||||
<Point X="20.217" Y="11.687" Type="JumpEnd" />
|
||||
<Point X="21.5" Y="11.687" />
|
||||
</Path>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AKAQAAABACARABAXAAaAKCCiBAEIAQAIAGBAAQAhIIE=</HashCode>
|
||||
<FileName>MainForms\StajForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="rabotnik" />
|
||||
</ShowAsAssociation>
|
||||
<ShowAsCollectionAssociation>
|
||||
<Field Name="tableStajColumns" />
|
||||
</ShowAsCollectionAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.ChildForm">
|
||||
<Position X="34" Y="3" Width="6" />
|
||||
<AssociationLine Name="child" Type="Diplom_O.DataBase.Child">
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="1.141" Y="0.097" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAgQBAABGCCACCCAAACACAABAQBAAAA8gE=</HashCode>
|
||||
<FileName>SupportForms\ChildForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="child" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.LearnForm">
|
||||
<Position X="5.25" Y="17.25" Width="5.25" />
|
||||
<AssociationLine Name="learn" Type="Diplom_O.DataBase.Learn">
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="1.061" Y="0.103" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>ACAAAEAQACAAQBAAAACCACACAAABACDAEAABAAQAQAE=</HashCode>
|
||||
<FileName>SupportForms\LearnForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="learn" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.LoginForm">
|
||||
<Position X="5.25" Y="2" Width="4.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAAQBAAAACCCCACAAAAACAAAAABQBAAQQE=</HashCode>
|
||||
<FileName>SupportForms\LoginForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="user" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.OptForm">
|
||||
<Position X="5.25" Y="7.25" Width="4.25" />
|
||||
<AssociationLine Name="free" Type="Diplom_O.DataBase.Free">
|
||||
<MemberNameLabel ManuallyPlaced="true">
|
||||
<Position X="1.352" Y="0.11" />
|
||||
</MemberNameLabel>
|
||||
</AssociationLine>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAkAAACABQBEQAACCACACAAAAACAAAAABAAUAQAE=</HashCode>
|
||||
<FileName>SupportForms\OptForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="free" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.WorkChelForm">
|
||||
<Position X="38" Y="17.5" Width="3.25" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>EAgAQAAAACAQQBAABCCCACCCAAACACAAAAhBAAEAQAk=</HashCode>
|
||||
<FileName>SupportForms\WorkChelForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.WorkerForm">
|
||||
<Position X="5.25" Y="23.5" Width="5.25" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAAABgDAACCACACAAACACAAAAAAAAEAAAE=</HashCode>
|
||||
<NewMemberFileName>SupportForms\WorkerForm.Designer.cs</NewMemberFileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Diplom_O.SupportForms.WorkShtatForm">
|
||||
<Position X="5.25" Y="12.75" Width="3.75" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAQACAAQBAAAACCACACAAAAACAAAAABAAABQCk=</HashCode>
|
||||
<FileName>SupportForms\WorkShtatForm.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<ShowAsAssociation>
|
||||
<Field Name="shtat" />
|
||||
</ShowAsAssociation>
|
||||
</Class>
|
||||
<Struct Name="Diplom_O.ColumnConf">
|
||||
<Position X="27.5" Y="15" Width="6" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAIAAAAAAAAAEAEAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>GlobalFormFunc.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Struct>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
226
DataBase/AccessDB.cs
Normal file
226
DataBase/AccessDB.cs
Normal file
@ -0,0 +1,226 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class Access
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("User")]
|
||||
public int UserId { get; set; }
|
||||
public User User { get; set; }
|
||||
public int FormId { get; set; }
|
||||
public int FormatAccess { get; set; }
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void AccessCheckValid(Access obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null) throw new Exception("Ошибка инициализации.");
|
||||
if (UserGetById(obj.UserId) == null) throw new Exception("Пользователь не указан.");
|
||||
if (obj.FormId < 0 || obj.FormId >= FormArray.formName.Length) throw new Exception("Неверно указана форма.");
|
||||
if (obj.FormId < 0 || obj.FormatAccess >= FormArray.formAccess.Length) throw new Exception("Неверно указаны разрешения");
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
|
||||
public static Access AccessGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Accessy
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Access[] AccessGetByUserIdFormId(int UserId, int FormId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Accessy
|
||||
where a.UserId == UserId && a.FormId == FormId
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.ToArray();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Access AccessGetByUserIdFormIdAccessId(int UserId, int FormId, int AccessId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Accessy
|
||||
where
|
||||
a.UserId == UserId &&
|
||||
a.FormId == FormId &&
|
||||
a.FormatAccess == AccessId
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void AccessAdd(Access obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
AccessCheckValid(obj);
|
||||
var local_obj = AccessGetByUserIdFormIdAccessId(obj.UserId, obj.FormId, obj.FormatAccess);
|
||||
if (local_obj == null)
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Accessy.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void AccessDelete(Access obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = AccessGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Разрешение не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Accessy.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static Access[] AccessList(int UserId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var access = (
|
||||
from a in db.Accessy
|
||||
where a.UserId == UserId
|
||||
orderby a.FormId
|
||||
orderby a.FormatAccess
|
||||
select a
|
||||
).ToArray();
|
||||
return access;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static bool[,] AccessListTable(int UserId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = new bool[FormArray.formName.Length, FormArray.formAccess.Length];
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var list = AccessList(UserId);
|
||||
foreach (var r in list)
|
||||
result[r.FormId, r.FormatAccess] = true;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static int AccessToSettingsFullCountWithoutUserId(User user)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var users =
|
||||
(from a in db.Usery
|
||||
where a.Id != user.Id
|
||||
select a).ToArray();
|
||||
var count = 0;
|
||||
foreach(var usr in users)
|
||||
{
|
||||
var access =
|
||||
from a in db.Accessy
|
||||
where
|
||||
a.UserId == usr.Id &&
|
||||
a.FormId == 7
|
||||
select a;
|
||||
if (access.Count() == FormArray.formAccess.Length)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
322
DataBase/ChelDB.cs
Normal file
322
DataBase/ChelDB.cs
Normal file
@ -0,0 +1,322 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class Chel
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string FName { get; set; }
|
||||
public string SName { get; set; }
|
||||
public string TName { get; set; }
|
||||
public bool Male { get; set; }
|
||||
public DateTime Birthday { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string INN { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public string SNILS { get; set; }
|
||||
public string Pasport { get; set; }
|
||||
public bool Pensia { get; set; }
|
||||
public List<CorrStaj> CorrStajy { get; set; }
|
||||
public List<Learn> Learny { get; set; }
|
||||
public List<Rabotnik> Rabotniky { get; set; }
|
||||
public List<Free> Freey { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void ChelCheckValid(Chel obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null) throw new Exception("Ошибка инициализации человека.");
|
||||
if (string.IsNullOrEmpty(obj.FName)) throw new Exception("Фамилия не указана.");
|
||||
if (string.IsNullOrEmpty(obj.SName)) throw new Exception("Имя не указано.");
|
||||
if (obj.Birthday > DateTime.Now) throw new Exception("Дата рождения не верна.");
|
||||
if (obj.Birthday > DateTime.Now.AddYears(-18).AddDays(1)) throw new Exception("Нельза добавить несовершеннолетнего.");
|
||||
var rgx = new Regex("^[0-9]{12}$");
|
||||
if (!rgx.IsMatch(obj.INN)) throw new Exception("ИНН указан неверно.");
|
||||
rgx = new Regex("^[0-9]{3}-[0-9]{3}-[0-9]{3} [0-9]{2}$");
|
||||
if (!rgx.IsMatch(obj.SNILS)) throw new Exception("СНИЛС указан неверно.");
|
||||
if (string.IsNullOrEmpty(obj.Pasport)) throw new Exception("Надо добавить паспорт.");
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
|
||||
public static Chel ChelGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Chely
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Chel ChelGetByINN(string inn)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Chely
|
||||
where a.INN == inn
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Chel ChelGetBySNILS(string snils)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Chely
|
||||
where a.SNILS == snils
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ChelGetFIOShortById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
(from a in db.Chely
|
||||
where a.Id == id
|
||||
select a).Single();
|
||||
try
|
||||
{
|
||||
return res.FName + " " +
|
||||
res.SName[0].ToString() + "." +
|
||||
((!string.IsNullOrEmpty(res.TName)) ?
|
||||
res.TName[0].ToString() + "." : "");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChelAdd(Chel obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChelCheckValid(obj);
|
||||
if (ChelGetByINN(obj.INN) != null)
|
||||
throw new Exception("ИНН повторяется.");
|
||||
if (ChelGetBySNILS(obj.SNILS) != null)
|
||||
throw new Exception("СНИЛС повторяется.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Chely.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void ChelChange(Chel obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChelCheckValid(obj);
|
||||
var localObj = ChelGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Человека не существует.");
|
||||
var innObj = ChelGetByINN(obj.INN);
|
||||
if (innObj != null && innObj.Id != localObj.Id)
|
||||
throw new Exception("ИНН повторяется.");
|
||||
var snilsObj = ChelGetBySNILS(obj.SNILS);
|
||||
if (snilsObj != null && snilsObj.Id != localObj.Id)
|
||||
throw new Exception("СНИЛС повторяется.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Chely.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void ChelDelete(Chel obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = ChelGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Человека не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Chely.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static Chel[] ChelList(string filter = null, bool isWorker = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var chels = (
|
||||
from a in db.Chely
|
||||
select a
|
||||
).ToList();
|
||||
|
||||
filter = filter == null ? "" : filter.ToLower();
|
||||
for (var i = 0; i < chels.Count;)
|
||||
{
|
||||
if (!isWorker)
|
||||
{
|
||||
var check = new List<Rabotnik>(RabotnikHistoryByChelId(chels[i].Id));
|
||||
var a = check.FindAll(x => !x.End.HasValue || (x.Start >= DateTime.Now && x.End.Value <= DateTime.Now)).Count();
|
||||
if (a > 0)
|
||||
{
|
||||
chels.RemoveAt(i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var fname = chels[i].FName.ToLower();
|
||||
var sname = chels[i].SName.ToLower();
|
||||
var tname = chels[i].TName.ToLower();
|
||||
var bday = chels[i].Birthday.ToString("yyyy.MM.dd");
|
||||
var adres = chels[i].Address.ToLower();
|
||||
var inn = chels[i].INN.ToLower();
|
||||
var snils = chels[i].SNILS.ToLower();
|
||||
var pasp = chels[i].Pasport.ToLower();
|
||||
if (
|
||||
fname.Contains(filter) || sname.Contains(filter) ||
|
||||
tname.Contains(filter) || bday.Contains(filter) ||
|
||||
adres.Contains(filter) || inn.Contains(filter) ||
|
||||
snils.Contains(filter) || pasp.Contains(filter)
|
||||
)
|
||||
i++;
|
||||
else
|
||||
chels.RemoveAt(i);
|
||||
}
|
||||
return chels.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static string[][] ChelListTableMain(string filter = null, bool isWorker = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ChelListTableMain(ChelList(filter, isWorker));
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] ChelListTableMain(Chel[] data)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = new List<string[]>();
|
||||
foreach (var chel in data)
|
||||
result.Add(
|
||||
new string[]
|
||||
{
|
||||
chel.Id.ToString(),
|
||||
chel.FName.ToString(),
|
||||
chel.SName.ToString(),
|
||||
chel.TName.ToString(),
|
||||
chel.Male ? "Муж." : "Жен.",
|
||||
chel.Birthday.ToString("yyyy.MM.dd"),
|
||||
chel.Address.ToString(),
|
||||
chel.Phone.ToString(),
|
||||
chel.INN.ToString(),
|
||||
chel.SNILS.ToString(),
|
||||
chel.Pasport.ToString(),
|
||||
chel.Pensia ? "Да" : "Нет",
|
||||
}
|
||||
);
|
||||
return result.ToArray();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
264
DataBase/ChildDB.cs
Normal file
264
DataBase/ChildDB.cs
Normal file
@ -0,0 +1,264 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class Child
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Chel")]
|
||||
public int? Parent1Id { get; set; }
|
||||
public Chel Parent1 { get; set; }
|
||||
[ForeignKey("Chel")]
|
||||
public int? Parent2Id { get; set; }
|
||||
public Chel Parent2 { get; set; }
|
||||
public string FName { get; set; }
|
||||
public string SName { get; set; }
|
||||
public string TName { get; set; }
|
||||
public bool Male { get; set; }
|
||||
public DateTime Birthday { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void ChildCheckValid(Child obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
throw new Exception("Ошибка инициализации ребенка.");
|
||||
if (string.IsNullOrEmpty(obj.FName))
|
||||
throw new Exception("Пустая фамилия.");
|
||||
if (string.IsNullOrEmpty(obj.FName))
|
||||
throw new Exception("Пустое имя.");
|
||||
if (!obj.Parent2Id.HasValue && !obj.Parent1Id.HasValue)
|
||||
throw new Exception("Не указано ни одного родителя.");
|
||||
if (obj.Parent2Id.HasValue && obj.Parent1Id.HasValue && obj.Parent1Id.Value == obj.Parent2Id.Value)
|
||||
throw new Exception("Указан один и тот же родитель 2 раза.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Child ChildGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Childy
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChildAdd(Child obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChildCheckValid(obj);
|
||||
if (!obj.Parent1Id.HasValue && obj.Parent2Id.HasValue)
|
||||
{
|
||||
obj.Parent1Id = obj.Parent2Id;
|
||||
obj.Parent2Id = null;
|
||||
}
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Childy.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void ChildChange(Child obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChildCheckValid(obj);
|
||||
var localObjById = ChildGetById(obj.Id);
|
||||
if (localObjById == null)
|
||||
throw new Exception("Не существует запись о ребенке.");
|
||||
if (!obj.Parent1Id.HasValue && obj.Parent2Id.HasValue)
|
||||
{
|
||||
obj.Parent1Id = obj.Parent2Id;
|
||||
obj.Parent2Id = null;
|
||||
}
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Childy.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void ChildDelete(Child obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = ChildGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Запись о ребенке не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Childy.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Child[] ChildList(string filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var child = (
|
||||
from a in db.Childy
|
||||
select a
|
||||
).ToList();
|
||||
var _filter = string.IsNullOrEmpty(filter) ? "" : filter.ToLower();
|
||||
for (var i = 0; i < child.Count;)
|
||||
{
|
||||
var fname = child[i].FName.ToLower();
|
||||
var sname = child[i].SName.ToLower();
|
||||
var tname = child[i].TName.ToLower();
|
||||
var bday = child[i].Birthday.ToString("yyyy.MM.dd");
|
||||
if (
|
||||
fname.Contains(filter) || sname.Contains(filter) ||
|
||||
tname.Contains(filter) || bday.Contains(filter)
|
||||
)
|
||||
i++;
|
||||
else
|
||||
child.RemoveAt(i);
|
||||
}
|
||||
return child.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static string[][] ChildTableMain(string filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var result = new List<string[]>();
|
||||
var childs = ChildList(filter);
|
||||
foreach (var child in childs)
|
||||
{
|
||||
result.Add(
|
||||
new string[]
|
||||
{
|
||||
child.Id.ToString(),
|
||||
child.FName + " " +
|
||||
child.SName[0].ToString() + "." +
|
||||
((!string.IsNullOrEmpty(child.TName)) ?
|
||||
child.TName[0].ToString() + "." : ""),
|
||||
child.Male ? "Мальчик" : "Девочка",
|
||||
child.Birthday.ToString("yyyy.MM.dd"),
|
||||
child.Parent1Id.HasValue ? ChelGetFIOShortById(child.Parent1Id.Value) : "",
|
||||
child.Parent2Id.HasValue ? ChelGetFIOShortById(child.Parent2Id.Value) : ""
|
||||
}
|
||||
);
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static int ChildCount(DateTime dt, bool? isMale = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var workIds = (
|
||||
from a in db.Rabotniky
|
||||
where
|
||||
!a.End.HasValue ||
|
||||
(
|
||||
dt >= a.Start
|
||||
&&
|
||||
dt <= a.End.Value
|
||||
)
|
||||
select a.ChelId
|
||||
).ToArray();
|
||||
var _dt = dt.AddYears(-15);
|
||||
var res = (
|
||||
from a in db.Childy
|
||||
where
|
||||
a.Birthday > _dt
|
||||
&&
|
||||
(
|
||||
!isMale.HasValue
|
||||
||
|
||||
a.Male == isMale.Value
|
||||
)
|
||||
&&
|
||||
(
|
||||
(
|
||||
a.Parent1Id.HasValue
|
||||
&&
|
||||
workIds.Contains(a.Parent1Id.Value)
|
||||
)
|
||||
||
|
||||
(
|
||||
a.Parent2Id.HasValue
|
||||
&&
|
||||
workIds.Contains(a.Parent2Id.Value)
|
||||
)
|
||||
)
|
||||
select a
|
||||
).Count();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -15,7 +15,14 @@ namespace Diplom_O.DataBase
|
||||
public DbSet<Shtat> Shtat { get; set; }
|
||||
public DbSet<Rabotnik> Rabotniky { get; set; }
|
||||
public DbSet<Chel> Chely { get; set; }
|
||||
public DbSet<ChelToChel> ChelToChely { get; set; }
|
||||
public DbSet<TypeStaj> TypeStajy { get; set; }
|
||||
public DbSet<RabotnikTypeStaj> RabotnikTypeStajy { get; set; }
|
||||
public DbSet<Child> Childy { get; set; }
|
||||
public DbSet<Learn> Learny { get; set; }
|
||||
public DbSet<CorrStaj> CorrStajy { get; set; }
|
||||
public DbSet<Free> Freey { get; set; }
|
||||
public DbSet<Access> Accessy { get; set; }
|
||||
public DbSet<User> Usery { get; set; }
|
||||
|
||||
public MainDB()
|
||||
{
|
||||
@ -29,67 +36,30 @@ namespace Diplom_O.DataBase
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder) { }
|
||||
|
||||
}
|
||||
public class Rabotnik
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Chel")]
|
||||
public int ChelId { get; set; }
|
||||
public Chel Chel { get; set; }
|
||||
[ForeignKey("Shtat")]
|
||||
public int ShtatId { get; set; }
|
||||
public Shtat Shtat { get; set; }
|
||||
|
||||
public string KodSotr { get; set; }
|
||||
public string Kategoriya { get; set; }
|
||||
public bool Pensiya { get; set; }
|
||||
|
||||
public DateTime Start { get; set; }
|
||||
public DateTime? End { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class Shtat
|
||||
public static partial class FuncDB
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string Doljnost { get; set; }
|
||||
public int Size { get; set; }
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
public class Chel
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string FName { get; set; }
|
||||
public string SName { get; set; }
|
||||
public string TName { get; set; }
|
||||
public bool Male { get; set; }
|
||||
public DateTime Birthday { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string INN { get; set; }
|
||||
public string SNILS { get; set; }
|
||||
public string Pasport { get; set; }
|
||||
public List<Rabotnik> Rabota { get; set; }
|
||||
}
|
||||
public class ChelToChel
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Chel1")]
|
||||
public int Chel1Id { get; set; }
|
||||
public Chel Chel1 { get; set; }
|
||||
[ForeignKey("Chel2")]
|
||||
public int Chel2Id { get; set; }
|
||||
public Chel Chel2 { get; set; }
|
||||
public int Lvl { get; set; }
|
||||
public static void InitDB()
|
||||
{
|
||||
if (UserGetByLogin("Admin") != null)
|
||||
return;
|
||||
var user = new User()
|
||||
{
|
||||
Login = "Admin",
|
||||
Pass = "Admin",
|
||||
Hide = true,
|
||||
Default = 7
|
||||
};
|
||||
UserAdd(user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
179
DataBase/CorrStajDB.cs
Normal file
179
DataBase/CorrStajDB.cs
Normal file
@ -0,0 +1,179 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class CorrStaj
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Chel")]
|
||||
public int ChelId { get; set; }
|
||||
public Chel Chel { get; set; }
|
||||
[ForeignKey("TypeStaj")]
|
||||
public int TypeStajId { get; set; }
|
||||
public TypeStaj TypeStaj { get; set; }
|
||||
public int Year { get; set; }
|
||||
public int Month { get; set; }
|
||||
public int Day { get; set; }
|
||||
public bool AddFlag { get; set; }
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void CorrStajValid(CorrStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
throw new Exception("Ошибка инициализации стажа.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static CorrStaj CorrStajGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var corrstaj =
|
||||
from a in db.CorrStajy
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return corrstaj.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static CorrStaj CorrStaj(int chelId, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var ts = TypeStajGetByName(name);
|
||||
if (ts == null)
|
||||
return null;
|
||||
var corrstaj =
|
||||
from a in db.CorrStajy
|
||||
where a.TypeStajId == ts.Id && a.ChelId == chelId
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return corrstaj.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void CorrStajAdd(CorrStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
CorrStajValid(obj);
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.CorrStajy.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void CorrStajChange(CorrStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
CorrStajValid(obj);
|
||||
var localObjById = CorrStajGetById(obj.Id);
|
||||
var localObjByName = CorrStaj(obj.ChelId, TypeStajGetById(obj.TypeStajId).Name);
|
||||
if (localObjById == null)
|
||||
throw new Exception("Корректировка стажа не существует.");
|
||||
if (localObjByName != null &&
|
||||
localObjByName.Id != localObjById.Id)
|
||||
throw new Exception("Корректировка стажа существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.CorrStajy.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void CorrStajDelete(CorrStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = CorrStajGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Корректироваки стажа не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.CorrStajy.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static CorrStaj[] CorrStajList(int chelId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (
|
||||
from a in db.CorrStajy
|
||||
where a.ChelId == chelId
|
||||
select a
|
||||
).ToList();
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
224
DataBase/FreeDB.cs
Normal file
224
DataBase/FreeDB.cs
Normal file
@ -0,0 +1,224 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class Free
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Chel")]
|
||||
public int ChelId { get; set; }
|
||||
public Chel Chel { get; set; }
|
||||
public string Type { get; set; }
|
||||
public DateTime Start { get; set; }
|
||||
public DateTime? End { get; set; }
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void FreeCheckValid(Free obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null) throw new Exception("Ошибка инициализации.");
|
||||
if (string.IsNullOrEmpty(obj.Type)) throw new Exception("Тип не указан.");
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static Free FreeGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Freey
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void FreeAdd(Free obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
FreeCheckValid(obj);
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
obj.Start = new DateTime(obj.Start.Year, obj.Start.Month, obj.Start.Day, 0, 0, 0);
|
||||
if (obj.End.HasValue)
|
||||
obj.End = new DateTime(obj.End.Value.Year, obj.End.Value.Month, obj.End.Value.Day, 23, 59, 59);
|
||||
db.Freey.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void FreeChange(Free obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
FreeCheckValid(obj);
|
||||
var localObj = FreeGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Отстранение не указано.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
obj.Start = new DateTime(obj.Start.Year, obj.Start.Month, obj.Start.Day, 0, 0, 0);
|
||||
if (obj.End.HasValue)
|
||||
obj.End = new DateTime(obj.End.Value.Year, obj.End.Value.Month, obj.End.Value.Day, 23, 59, 59);
|
||||
db.Freey.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void FreeDelete(Free obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = FreeGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Отстранение не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Freey.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static Free[] FreeList(int chelId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var free = (
|
||||
from a in db.Freey
|
||||
where a.ChelId == chelId
|
||||
select a
|
||||
).ToArray();
|
||||
return free;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Dictionary<string, int> FreeListDays(int chelId, DateTime start, DateTime end)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var list =
|
||||
from a in db.Freey
|
||||
where
|
||||
a.ChelId == chelId &&
|
||||
a.Start <= end &&
|
||||
(!a.End.HasValue || a.End.Value >= start)
|
||||
select a;
|
||||
var subres = new Dictionary<string, int>();
|
||||
foreach(var r in list)
|
||||
{
|
||||
var s = r.Start <= start ? start : r.Start;
|
||||
var e = r.End.HasValue ?
|
||||
r.End.Value >= end ? end :
|
||||
r.End.Value :
|
||||
end;
|
||||
var d = (int)Math.Ceiling((e - s).TotalDays);
|
||||
if (d <= 0)
|
||||
continue;
|
||||
if (!subres.ContainsKey("Общее"))
|
||||
subres.Add("Общее", 0);
|
||||
subres["Общее"] = subres["Общее"] + d;
|
||||
if (!subres.ContainsKey(r.Type))
|
||||
subres.Add(r.Type, 0);
|
||||
subres[r.Type] = subres[r.Type] + d;
|
||||
}
|
||||
return subres;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] FreeListTable(int chelId, DateTime? start = null, DateTime? end = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var list =
|
||||
from a in db.Freey
|
||||
where
|
||||
a.ChelId == chelId &&
|
||||
(!end.HasValue || a.Start <= end.Value) &&
|
||||
(!a.End.HasValue || !start.HasValue || a.End.Value >= start.Value)
|
||||
select a;
|
||||
var subres = new List<string[]>();
|
||||
foreach (var r in list)
|
||||
{
|
||||
var s = !start.HasValue ? r.Start :
|
||||
r.Start <= start ? start.Value : r.Start;
|
||||
var e = r.End.HasValue ?
|
||||
end.HasValue ?
|
||||
r.End.Value >= end ? end.Value :
|
||||
r.End.Value :
|
||||
end.Value :
|
||||
DateTime.Now;
|
||||
subres.Add(
|
||||
new string[]{
|
||||
r.Id.ToString(),
|
||||
r.Type,
|
||||
s.ToString("yyyy.MM.dd"),
|
||||
e.ToString("yyyy.MM.dd"),
|
||||
Math.Ceiling((e - s).TotalDays).ToString()
|
||||
});
|
||||
}
|
||||
return subres.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,340 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public static class FuncDB
|
||||
{
|
||||
public static void ChkShtat(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(obj.Doljnost)) throw new Exception("Пустая должность.");
|
||||
if (obj.Size <= 0) throw new Exception("Количество мест <= 0.");
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static Shtat GetShtat(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = from a in db.Shtat
|
||||
where a.Id == id
|
||||
select a;
|
||||
try { return res.Single(); }
|
||||
catch { return null; }
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static (Shtat shtat, int ost)[] ListShtat(string filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var f = (string.IsNullOrEmpty(filter)) ? "" : filter.ToLower();
|
||||
var shtat = (string.IsNullOrEmpty(f)) ?
|
||||
(from a in db.Shtat
|
||||
where a.Active
|
||||
select a).ToArray() :
|
||||
(from a in db.Shtat
|
||||
where a.Doljnost.ToLower().Contains(f) && a.Active
|
||||
select a).ToArray();
|
||||
var res = new List<(Shtat shtat, int ost)>();
|
||||
for (var i = 0; i < shtat.Length; i++)
|
||||
res.Add((shtat[i], shtat[i].Size - BusySizeShtat(shtat[i].Id)));
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static void AddShtat(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChkShtat(obj);
|
||||
if (HaveDoljFromShtat(obj.Doljnost)) throw new Exception("Должность существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
obj.Active = true;
|
||||
db.Shtat.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static void ChangeShtat(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChkShtat(obj);
|
||||
if (GetShtat(obj.Id) == null) throw new Exception("Должность не существует.");
|
||||
if (GetShtat(obj.Id).Doljnost != obj.Doljnost && HaveDoljFromShtat(obj.Doljnost)) throw new Exception("Должность существует.");
|
||||
if (obj.Size < BusySizeShtat(obj.Id)) throw new Exception("Занятых мест больше > указанных.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Shtat.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static void DelShtat(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChkShtat(obj);
|
||||
if (GetShtat(obj.Id) == null) throw new Exception("Должность не существует.");
|
||||
if (BusySizeShtat(obj.Id) > 0) throw new Exception("Есть занятые места.");
|
||||
obj.Active = false;
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Shtat.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static int BusySizeShtat(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (from a in db.Rabotniky
|
||||
where a.ShtatId == id && !a.End.HasValue
|
||||
select a).ToArray();
|
||||
return res.Length;
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static bool HaveDoljFromShtat(string dolj)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var chkDolj = from a in db.Shtat
|
||||
where a.Doljnost == dolj && a.Active
|
||||
select a;
|
||||
return chkDolj.Count() > 0;
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
|
||||
public static void ChkChel(Chel chel)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(chel.FName)) throw new Exception("Фамилия не указана.");
|
||||
if (string.IsNullOrEmpty(chel.SName)) throw new Exception("Имя не указано.");
|
||||
if (chel.Birthday > DateTime.Now) throw new Exception("Дата рождения не верна.");
|
||||
var rgx = new Regex("^[0-9]{12}$");
|
||||
if (!rgx.IsMatch(chel.INN)) throw new Exception("ИНН указан неверно.");
|
||||
rgx = new Regex("^[0-9]{3}-[0-9]{3}-[0-9]{3} [0-9]{2}$");
|
||||
if (!rgx.IsMatch(chel.SNILS)) throw new Exception("СНИЛС указан неверно.");
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static Chel GetChel(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = from a in db.Chely
|
||||
where a.Id == id
|
||||
select a;
|
||||
try { return res.Single(); }
|
||||
catch { return null; }
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static Chel[] ListChel(string filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var f = (string.IsNullOrEmpty(filter)) ? "" : filter.ToLower();
|
||||
return (string.IsNullOrEmpty(f)) ?
|
||||
(from a in db.Chely
|
||||
select a).ToArray() :
|
||||
(from a in db.Chely
|
||||
where
|
||||
(!string.IsNullOrEmpty(a.FName) && a.FName.ToLower().Contains(f)) ||
|
||||
(!string.IsNullOrEmpty(a.SName) && a.SName.ToLower().Contains(f)) ||
|
||||
(!string.IsNullOrEmpty(a.TName) && a.TName.ToLower().Contains(f)) ||
|
||||
a.Birthday.ToString("yyyy.MM.dd").ToLower().Contains(f) ||
|
||||
(!string.IsNullOrEmpty(a.Address) && a.Address.ToLower().Contains(f)) ||
|
||||
(!string.IsNullOrEmpty(a.INN) && a.INN.ToLower().Contains(f)) ||
|
||||
(!string.IsNullOrEmpty(a.SNILS) && a.SNILS.ToLower().Contains(f)) ||
|
||||
(!string.IsNullOrEmpty(a.Pasport) && a.Pasport.ToLower().Contains(f))
|
||||
select a).ToArray();
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static bool HaveChelRabotnik(int id, bool all=false)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (from a in db.Rabotniky
|
||||
where a.ChelId == id && (all || !a.End.HasValue)
|
||||
select a).ToArray();
|
||||
return res.Length > 0;
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static void AddChel(Chel chel)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChkChel(chel);
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Chely.Add(chel);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static void ChangeChel(Chel chel)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChkChel(chel);
|
||||
if (GetChel(chel.Id) == null) throw new Exception("Человека не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Chely.Update(chel);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static void DelChel(Chel chel)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChkChel(chel);
|
||||
if (GetChel(chel.Id) == null) throw new Exception("Человека не существует.");
|
||||
if (HaveChelRabotnik(chel.Id, true)) throw new Exception("Человек есть в таблице работников.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Chely.Remove(chel);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static bool HaveChelToChel(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (from a in db.ChelToChely
|
||||
where a.Chel1Id == id || a.Chel2Id == id
|
||||
select a).Count();
|
||||
return res > 0;
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static bool CanBirthdayChelToChel(int id, DateTime date)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (from a in db.ChelToChely
|
||||
join b in db.Chely on a.Chel2Id equals b.Id
|
||||
join c in db.Chely on a.Chel1Id equals c.Id
|
||||
where (a.Chel1Id == id && date > b.Birthday) ||
|
||||
(a.Chel2Id == id && date < c.Birthday)
|
||||
select a).Count();
|
||||
return res == 0;
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static (int chelToChelId, Chel chel, int lvl)[] ListRodFromChel(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var rodChel = new List<(int chelToChelId, Chel chel, int lvl)>();
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var parents = new List<(Chel chel,int lvl)>() { (GetChel(id), 0) };
|
||||
var childrens = new List<(Chel chel, int lvl)>() { (GetChel(id), 0) };
|
||||
while (parents.Count > 0 || childrens.Count > 0)
|
||||
{
|
||||
var newParents = new List<(Chel chel, int lvl)>();
|
||||
var newChildrens = new List<(Chel chel, int lvl)>();
|
||||
for(var i = 0; i < parents.Count || i < childrens.Count; i++)
|
||||
{
|
||||
var parentsLinks =
|
||||
(from a in db.ChelToChely
|
||||
where (i < parents.Count) && a.Chel2Id == parents[i].chel.Id
|
||||
select a).ToArray();
|
||||
var childrensLinks =
|
||||
(from a in db.ChelToChely
|
||||
where (i < childrens.Count) && a.Chel1Id == childrens[i].chel.Id
|
||||
select a).ToArray();
|
||||
for (var j = 0; j < parentsLinks.Length || j < childrensLinks.Length; j++)
|
||||
{
|
||||
var chel = j < parentsLinks.Length ? GetChel(parentsLinks[j].Chel1Id) : null;
|
||||
if (chel != null && rodChel.FindAll(x => x.chel.Id == chel.Id).Count == 0)
|
||||
{
|
||||
rodChel.Add((parentsLinks[j].Id, chel, parents[i].lvl - parentsLinks[j].Lvl));
|
||||
newParents.Add((chel, parents[i].lvl - parentsLinks[j].Lvl));
|
||||
}
|
||||
|
||||
chel = j < childrensLinks.Length ? GetChel(childrensLinks[j].Chel2Id) : null;
|
||||
if (chel != null && rodChel.FindAll(x => x.chel.Id == chel.Id).Count == 0)
|
||||
{
|
||||
rodChel.Add((childrensLinks[j].Id, chel, childrens[i].lvl + childrensLinks[j].Lvl));
|
||||
newChildrens.Add((chel, childrens[i].lvl + childrensLinks[j].Lvl));
|
||||
}
|
||||
}
|
||||
}
|
||||
parents = newParents;
|
||||
childrens = newChildrens;
|
||||
}
|
||||
}
|
||||
return rodChel.OrderByDescending(x => x.lvl).ToArray();
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
|
||||
public static ChelToChel GetChelToChel(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = from a in db.ChelToChely
|
||||
where a.Id == id
|
||||
select a;
|
||||
try { return res.Single(); }
|
||||
catch { return null; }
|
||||
}
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
}
|
||||
}
|
182
DataBase/LearnDB.cs
Normal file
182
DataBase/LearnDB.cs
Normal file
@ -0,0 +1,182 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class Learn
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Chel")]
|
||||
public int ChelId { get; set; }
|
||||
public Chel Chel { get; set; }
|
||||
public string NameSchool { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string Spec { get; set; }
|
||||
public string Curs { get; set; }
|
||||
public string ProfPer { get; set; }
|
||||
public DateTime End { get; set; }
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void LearnCheckValid(Learn obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null) throw new Exception("Ошибка инициализации.");
|
||||
if (ChelGetById(obj.ChelId) == null) throw new Exception("Человек не указан.");
|
||||
if (string.IsNullOrEmpty(obj.NameSchool)) throw new Exception("Обр. учр. не указано.");
|
||||
if (string.IsNullOrEmpty(obj.Type)) throw new Exception("Уровень не указан.");
|
||||
if (string.IsNullOrEmpty(obj.Spec)) throw new Exception("Специальность не указана.");
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static Learn LearnGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Learny
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void LearnAdd(Learn obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
LearnCheckValid(obj);
|
||||
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Learny.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void LearnChange(Learn obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
LearnCheckValid(obj);
|
||||
var localObj = LearnGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Образование не указано.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Learny.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void LearnDelete(Learn obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = LearnGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Образование не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Learny.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static Learn[] LearnList(int chelId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var learns = (
|
||||
from a in db.Learny
|
||||
where a.ChelId == chelId
|
||||
select a
|
||||
).ToArray();
|
||||
return learns;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static string[][] LearnListTableMain(int chelId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return LearnListTableMain(LearnList(chelId));
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] LearnListTableMain(Learn[] data)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = new List<string[]>();
|
||||
foreach (var learn in data)
|
||||
result.Add(
|
||||
new string[]
|
||||
{
|
||||
learn.Id.ToString(),
|
||||
learn.NameSchool,
|
||||
learn.Type,
|
||||
learn.Spec,
|
||||
learn.End.ToString("yyyy.MM.dd"),
|
||||
learn.Curs,
|
||||
learn.ProfPer
|
||||
}
|
||||
);
|
||||
return result.ToArray();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
448
DataBase/RabotinkDB.cs
Normal file
448
DataBase/RabotinkDB.cs
Normal file
@ -0,0 +1,448 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class Rabotnik
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Chel")]
|
||||
public int ChelId { get; set; }
|
||||
public Chel Chel { get; set; }
|
||||
[ForeignKey("Shtat")]
|
||||
public int? ShtatId { get; set; }
|
||||
public Shtat Shtat { get; set; }
|
||||
public string TabNum { get; set; }
|
||||
public bool AnotherWork { get; set; }
|
||||
public DateTime Start { get; set; }
|
||||
public DateTime? End { get; set; }
|
||||
public List<RabotnikTypeStaj> RabotnikTypeStajy { get; set; }
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void RabotnikCheckValid(Rabotnik obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
throw new Exception("Ошибка инициализации сотрудника.");
|
||||
if (string.IsNullOrEmpty(obj.TabNum) && !obj.AnotherWork)
|
||||
throw new Exception("Пустой табельный номер.");
|
||||
if (
|
||||
obj.Start > (obj.End.HasValue ? obj.End.Value : DateTime.Now)
|
||||
)
|
||||
throw new Exception("Неверная дата.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static Rabotnik RabotnikGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Rabotniky
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static Rabotnik[] RabotnikHistoryById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var rabotnik = RabotnikGetById(id);
|
||||
RabotnikCheckValid(rabotnik);
|
||||
return
|
||||
RabotnikHistoryByChelId(
|
||||
rabotnik.ChelId
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Rabotnik[] RabotnikHistoryByRabotingId(Rabotnik obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
RabotnikCheckValid(obj);
|
||||
return RabotnikHistoryByChelId(
|
||||
obj.ChelId
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Rabotnik[] RabotnikHistoryByChelId(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Rabotniky
|
||||
where a.ChelId == id
|
||||
orderby a.Start
|
||||
select a;
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool RabotnikCheckDate(int chelId, DateTime start, DateTime? end, int rabotnikId = -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
var _end = end ?? now;
|
||||
return (
|
||||
from a in db.Rabotniky
|
||||
where
|
||||
a.ChelId == chelId
|
||||
&&
|
||||
(rabotnikId != -1 ? a.Id != rabotnikId : true)
|
||||
&&
|
||||
(
|
||||
(
|
||||
a.Start >= start
|
||||
&&
|
||||
a.Start <= _end
|
||||
)
|
||||
||
|
||||
(
|
||||
(a.End ?? now) >= start
|
||||
&&
|
||||
(a.End ?? now) <= _end
|
||||
)
|
||||
)
|
||||
select a
|
||||
).Count() == 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void RabotnikAdd(Rabotnik obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
RabotnikCheckValid(obj);
|
||||
if (!RabotnikCheckDate(obj.ChelId, obj.Start, obj.End))
|
||||
throw new Exception("Попадает в существующий временной интервал.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Rabotniky.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void RabotnikChange(Rabotnik obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
RabotnikCheckValid(obj);
|
||||
var localObjById = RabotnikGetById(obj.Id);
|
||||
if (localObjById == null)
|
||||
throw new Exception("Не существует запись о сотруднике.");
|
||||
if (obj.ChelId != localObjById.ChelId)
|
||||
throw new Exception("Нельзя менять человека.");
|
||||
if (!RabotnikCheckDate(obj.ChelId, obj.Start, obj.End, obj.Id))
|
||||
throw new Exception("Пересекатеся с другими записями о работе.");
|
||||
/*if (ShtatGetById(obj.ShtatId) == null)
|
||||
throw new Exception("Должность не существует.");*/
|
||||
if (Program.IsDebug)
|
||||
throw new Exception("НАДО ДОРАБОТАТЬ ПРОВЕРКУ ЗАПОЛНЕНИЯ ДОЛЖНОСТЕЙ");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Rabotniky.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void RabotnikDelete(Rabotnik obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = RabotnikGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Запись о сотруднике не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var type = FuncDB.RabotnikTypeStajList(obj.Id);
|
||||
foreach (var r in type)
|
||||
FuncDB.RabotnikTypeStajDelete(r);
|
||||
db.Rabotniky.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Rabotnik[] RabotnikList(string filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var _filter = string.IsNullOrEmpty(filter) ? null : filter.ToLower();
|
||||
var rabotnik = (
|
||||
from a in db.Rabotniky
|
||||
select a
|
||||
);
|
||||
return rabotnik.ToArray();
|
||||
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Rabotnik[] RabotnikListLast(string filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var _chel = FuncDB.ChelList();
|
||||
var rabotnik = new List<Rabotnik>();
|
||||
var _filter = string.IsNullOrEmpty(filter) ? null : filter.ToLower();
|
||||
foreach (var c in _chel)
|
||||
{
|
||||
var rab = (
|
||||
from a in db.Rabotniky
|
||||
where a.End == null && a.ChelId == c.Id
|
||||
select a
|
||||
).ToArray();
|
||||
if (rab.Length == 0)
|
||||
{
|
||||
rab = (
|
||||
from a in db.Rabotniky
|
||||
where a.ChelId == c.Id
|
||||
orderby a.End descending
|
||||
select a
|
||||
).ToArray();
|
||||
}
|
||||
if (rab.Length > 0)
|
||||
rabotnik.Add(rab[0]);
|
||||
}
|
||||
return rabotnik.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Rabotnik[] RabotnikListByChelId(int chelId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var rabotnik = (
|
||||
from a in db.Rabotniky
|
||||
where a.ChelId == chelId
|
||||
orderby a.Start
|
||||
select a
|
||||
);
|
||||
return rabotnik.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static string[][] RabotnikTableMain(string filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
return RabotnikTableMain(RabotnikListLast(filter));
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] RabotnikTableMain(Rabotnik[] data)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var result = new List<string[]>();
|
||||
foreach (var rabotnik in data)
|
||||
{
|
||||
result.Add(
|
||||
new string[]
|
||||
{
|
||||
rabotnik.Id.ToString(),
|
||||
rabotnik.TabNum,
|
||||
ChelGetFIOShortById(rabotnik.ChelId),
|
||||
rabotnik.AnotherWork ?
|
||||
"Иное место" :
|
||||
ShtatGetById(rabotnik.ShtatId.Value).Doljnost
|
||||
}
|
||||
);
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
public static string[][] RabotnikByChelIdTable(int chelId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return RabotnikByChelIdTable(RabotnikListByChelId(chelId));
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] RabotnikByChelIdTable(Rabotnik[] data)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var result = new List<string[]>();
|
||||
foreach (var rabotnik in data)
|
||||
{
|
||||
result.Add(
|
||||
new string[]
|
||||
{
|
||||
rabotnik.Id.ToString(),
|
||||
rabotnik.TabNum,
|
||||
rabotnik.AnotherWork ?
|
||||
"Иное место" :
|
||||
ShtatGetById(rabotnik.ShtatId.Value).Doljnost,
|
||||
rabotnik.Start.ToString("yyyy.MM.dd"),
|
||||
rabotnik.End.HasValue ? rabotnik.End.Value.ToString("yyyy.MM.dd") : "По настоящее время"
|
||||
}
|
||||
);
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static (int year, int month, int day) RabotnikGetTotalTime(Rabotnik obj, DateTime? onDate = null)
|
||||
{
|
||||
if (!onDate.HasValue)
|
||||
onDate = DateTime.Now;
|
||||
var year = 0;
|
||||
var month = 0;
|
||||
var day = 0;
|
||||
|
||||
if (obj == null)
|
||||
return (year, month, day);
|
||||
var cursor =
|
||||
obj.End.HasValue ?
|
||||
obj.End.Value <= onDate ?
|
||||
obj.End.Value :
|
||||
onDate.Value :
|
||||
onDate.Value;
|
||||
var finish = obj.Start;
|
||||
if (cursor <= finish)
|
||||
return (year, month, day);
|
||||
while (finish.Year < cursor.Year)
|
||||
{
|
||||
year++;
|
||||
cursor = cursor.AddYears(-1);
|
||||
}
|
||||
if (finish.Month > cursor.Month)
|
||||
{
|
||||
year--;
|
||||
cursor = cursor.AddYears(1);
|
||||
}
|
||||
while (finish.Month != cursor.Month)
|
||||
{
|
||||
month++;
|
||||
cursor = cursor.AddMonths(-1);
|
||||
}
|
||||
if (finish.Day > cursor.Day)
|
||||
{
|
||||
month--;
|
||||
cursor = cursor.AddMonths(1);
|
||||
}
|
||||
while (finish.Day != cursor.Day)
|
||||
{
|
||||
day++;
|
||||
cursor = cursor.AddDays(-1);
|
||||
}
|
||||
while (day < 0)
|
||||
{
|
||||
day += 30;
|
||||
month--;
|
||||
}
|
||||
|
||||
while (month < 0)
|
||||
{
|
||||
month += 12;
|
||||
year--;
|
||||
}
|
||||
return (year, month, day);
|
||||
}
|
||||
}
|
||||
}
|
188
DataBase/RabotnikTypeStajDB.cs
Normal file
188
DataBase/RabotnikTypeStajDB.cs
Normal file
@ -0,0 +1,188 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class RabotnikTypeStaj
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Rabotnik")]
|
||||
public int RabitnikId { get; set; }
|
||||
[ForeignKey("TypeStaj")]
|
||||
public int TypeStajId { get; set; }
|
||||
}
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void RabotnikTypeStajCheckValid(RabotnikTypeStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
throw new Exception("Ошибка инициализации стажа сотрудника.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static RabotnikTypeStaj RabotnikTypeStajGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.RabotnikTypeStajy
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static RabotnikTypeStaj RabotnikTypeStajGetByTypeStajIdRabotnikId(int typeStajId, int rabotnikId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.RabotnikTypeStajy
|
||||
where a.RabitnikId == rabotnikId &&
|
||||
a.TypeStajId == typeStajId
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void RabotnikTypeStajAdd(RabotnikTypeStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
RabotnikTypeStajCheckValid(obj);
|
||||
if (RabotnikTypeStajGetByTypeStajIdRabotnikId(obj.TypeStajId, obj.RabitnikId) != null )
|
||||
throw new Exception("Тип стажа сотрудника существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.RabotnikTypeStajy.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void RabotnikTypeStajDelete(RabotnikTypeStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = RabotnikTypeStajGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Тип стажа сотрудника не существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.RabotnikTypeStajy.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static RabotnikTypeStaj[] RabotnikTypeStajList(int rabId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (
|
||||
from a in db.RabotnikTypeStajy
|
||||
where a.RabitnikId == rabId
|
||||
select a
|
||||
).ToList();
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] RabotnikTypeStajListString(int rabId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var rts = RabotnikTypeStajList(rabId);
|
||||
var res = new List<string[]>();
|
||||
foreach (var r in rts)
|
||||
{
|
||||
res.Add(
|
||||
new string[]
|
||||
{
|
||||
r.Id.ToString(),
|
||||
TypeStajGetById(r.TypeStajId).Name
|
||||
}
|
||||
);
|
||||
}
|
||||
return res.ToArray();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static RabotnikTypeStaj[] RabotnikTypeStajListByTypeStaj(int typeStaj)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (
|
||||
from a in db.RabotnikTypeStajy
|
||||
where a.TypeStajId == typeStaj
|
||||
select a
|
||||
).ToList();
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
310
DataBase/ShtatDB.cs
Normal file
310
DataBase/ShtatDB.cs
Normal file
@ -0,0 +1,310 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class Shtat
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string Doljnost { get; set; }
|
||||
public int Size { get; set; }
|
||||
public bool Active { get; set; }
|
||||
public List<Rabotnik> Rabotniky { get; set; }
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void ShtatCheckValid(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
throw new Exception("Ошибка инициализации должности.");
|
||||
if (string.IsNullOrEmpty(obj.Doljnost))
|
||||
throw new Exception("Пустая должность.");
|
||||
if (obj.Size <= 0)
|
||||
throw new Exception("Количество мест <= 0.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
private static void ShtatClear()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var shtat = (
|
||||
from a in db.Shtat
|
||||
where !a.Active
|
||||
select a).ToArray();
|
||||
for (var i = 0; i < shtat.Length; i++)
|
||||
if(ShtatFreeSpaceByShtat(shtat[i]) == shtat[i].Size)
|
||||
{
|
||||
db.Shtat.Remove(shtat[i]);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static Shtat ShtatGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Shtat
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static Shtat ShtatGetByDoljnost(string doljnost)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var chkDolj =
|
||||
from a in db.Shtat
|
||||
where a.Doljnost == doljnost && a.Active
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return chkDolj.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static int ShtatFreeSpaceById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
return
|
||||
ShtatFreeSpaceByShtat(
|
||||
ShtatGetById(id)
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static int ShtatFreeSpaceByShtat(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ShtatCheckValid(obj);
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
var res = (
|
||||
from a in db.Rabotniky
|
||||
where
|
||||
a.ShtatId == obj.Id
|
||||
&&
|
||||
(
|
||||
!a.End.HasValue
|
||||
||
|
||||
(
|
||||
now >= a.Start
|
||||
&&
|
||||
now <= a.End.Value
|
||||
)
|
||||
)
|
||||
select a).Count();
|
||||
return obj.Size - res;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShtatAdd(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ShtatCheckValid(obj);
|
||||
if (ShtatGetByDoljnost(obj.Doljnost) != null)
|
||||
throw new Exception("Должность существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
obj.Active = true;
|
||||
db.Shtat.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void ShtatChange(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
ShtatCheckValid(obj);
|
||||
var localObjById = ShtatGetById(obj.Id);
|
||||
var localObjByDoljnost = ShtatGetByDoljnost(obj.Doljnost);
|
||||
if (localObjById == null)
|
||||
throw new Exception("Должность не существует.");
|
||||
if (localObjByDoljnost != null &&
|
||||
localObjByDoljnost != localObjById)
|
||||
throw new Exception("Должность существует.");
|
||||
if (localObjById.Size - ShtatFreeSpaceByShtat(localObjById) > obj.Size )
|
||||
throw new Exception("Занятых мест больше > указанных.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Shtat.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void ShtatDelete(Shtat obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = ShtatGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Должность не существует.");
|
||||
if (ShtatFreeSpaceByShtat(localObj) != localObj.Size)
|
||||
throw new Exception("Есть занятые места.");
|
||||
localObj.Active = false;
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Shtat.Update(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
ShtatClear();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static (Shtat shtat, int free)[] ShtatList(string filter = null, bool isActual = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var shtat = (
|
||||
from a in db.Shtat
|
||||
where a.Active
|
||||
select a
|
||||
).ToList();
|
||||
var res = new List<(Shtat shtat, int free)>();
|
||||
for (var i = 0; i < shtat.Count; i++)
|
||||
{
|
||||
var free = ShtatFreeSpaceByShtat(shtat[i]);
|
||||
if (isActual && free <= 0)
|
||||
continue;
|
||||
res.Add((
|
||||
shtat[i],
|
||||
free
|
||||
));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(filter))
|
||||
return res.ToArray();
|
||||
|
||||
filter = filter.ToLower();
|
||||
for (var i = 0; i < res.Count;)
|
||||
{
|
||||
var dolj = res[i].shtat.Doljnost.ToLower();
|
||||
if (!dolj.Contains(filter))
|
||||
res.RemoveAt(i);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] ShtatListTableMain(string filter = null, bool isActual = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ShtatListTableMain(ShtatList(filter, isActual));
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] ShtatListTableMain((Shtat shtat, int free)[] data)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = new List<string[]>();
|
||||
foreach (var (shtat, free) in data)
|
||||
result.Add(
|
||||
new string[]
|
||||
{
|
||||
shtat.Id.ToString(),
|
||||
shtat.Doljnost,
|
||||
shtat.Size.ToString(),
|
||||
free.ToString()
|
||||
}
|
||||
);
|
||||
return result.ToArray();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
194
DataBase/TypeStajDB.cs
Normal file
194
DataBase/TypeStajDB.cs
Normal file
@ -0,0 +1,194 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class TypeStaj
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public List<CorrStaj> CorrStajy { get; set; }
|
||||
public List<RabotnikTypeStaj> RabotnikTypeStajy { get; set; }
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void TypeStajCheckValid(TypeStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
throw new Exception("Ошибка инициализации стажа.");
|
||||
if (string.IsNullOrEmpty(obj.Name))
|
||||
throw new Exception("Пустой стаж.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static TypeStaj TypeStajGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.TypeStajy
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static TypeStaj TypeStajGetByName(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var chkTypeStaj =
|
||||
from a in db.TypeStajy
|
||||
where a.Name == name
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return chkTypeStaj.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void TypeStajAdd(TypeStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
TypeStajCheckValid(obj);
|
||||
if (TypeStajGetByName(obj.Name) != null)
|
||||
throw new Exception("Тип стажа существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.TypeStajy.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void TypeStajChange(TypeStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
TypeStajCheckValid(obj);
|
||||
var localObjById = TypeStajGetById(obj.Id);
|
||||
var localObjByName = TypeStajGetByName(obj.Name);
|
||||
if (localObjById == null)
|
||||
throw new Exception("Тип стажа не существует.");
|
||||
if (localObjByName != null &&
|
||||
localObjByName != localObjById)
|
||||
throw new Exception("Тип стажа существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.TypeStajy.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void TypeStajDelete(TypeStaj obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = TypeStajGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Тип стажа не существует.");
|
||||
if (RabotnikTypeStajListByTypeStaj(localObj.Id).Length > 0)
|
||||
throw new Exception("Тип стажа используется.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.TypeStajy.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static TypeStaj[] TypeStajList(int[] filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (
|
||||
from a in db.TypeStajy
|
||||
where filter == null || filter.Contains(a.Id)
|
||||
select a
|
||||
).ToList();
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[] TypeStajListString(int[] filter = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res = (
|
||||
from a in db.TypeStajy
|
||||
where filter == null || filter.Contains(a.Id)
|
||||
select a.Name
|
||||
).ToList();
|
||||
res.Remove("Общий");
|
||||
return res.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
209
DataBase/UserDB.cs
Normal file
209
DataBase/UserDB.cs
Normal file
@ -0,0 +1,209 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Diplom_O.DataBase
|
||||
{
|
||||
public class User
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string Login { get; set; }
|
||||
public string Pass { get; set; }
|
||||
public bool Hide { get; set; }
|
||||
public int Default { get; set; }
|
||||
public List<Access> Accessy { get; set; }
|
||||
}
|
||||
|
||||
public static partial class FuncDB
|
||||
{
|
||||
public static void UserCheckValid(User obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null) throw new Exception("Ошибка инициализации.");
|
||||
if (string.IsNullOrEmpty(obj.Login)) throw new Exception("Логин не указан.");
|
||||
if (string.IsNullOrEmpty(obj.Pass)) throw new Exception("Пароль не указан.");
|
||||
if (obj.Default < 0 || obj.Default > 7) throw new Exception("Форма не существует.");
|
||||
}
|
||||
catch { throw; }
|
||||
}
|
||||
public static User UserGetById(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Usery
|
||||
where a.Id == id
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static User UserGetByLogin(string login)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var res =
|
||||
from a in db.Usery
|
||||
where a.Login == login
|
||||
select a;
|
||||
try
|
||||
{
|
||||
return res.Single();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
public static void UserAdd(User obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
UserCheckValid(obj);
|
||||
if (UserGetByLogin(obj.Login) != null)
|
||||
throw new Exception("Пользователь существует.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Usery.Add(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
var user = UserGetByLogin(obj.Login);
|
||||
for (var i = 0; i < FormArray.formAccess.Length; i++)
|
||||
{
|
||||
var access = new Access()
|
||||
{
|
||||
UserId = user.Id,
|
||||
FormId = user.Default,
|
||||
FormatAccess = i
|
||||
};
|
||||
AccessAdd(access);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void UserChange(User obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
UserCheckValid(obj);
|
||||
var localObj = UserGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Пользователь не указан.");
|
||||
var localObjByLogin = UserGetByLogin(obj.Login);
|
||||
if (localObjByLogin != null &&
|
||||
localObjByLogin.Id != localObj.Id)
|
||||
throw new Exception("Логин существует.");
|
||||
if (AccessGetByUserIdFormIdAccessId(localObj.Id, obj.Default, 0) == null)
|
||||
throw new Exception("Сначала нужен доступ к форме.");
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Usery.Update(obj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static void UserDelete(User obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (obj == null)
|
||||
return;
|
||||
var localObj = UserGetById(obj.Id);
|
||||
if (localObj == null)
|
||||
throw new Exception("Пользователь не существует.");
|
||||
var acessy = AccessList(localObj.Id);
|
||||
foreach (var a in acessy)
|
||||
AccessDelete(a);
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
db.Usery.Remove(localObj);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static User[] UserList(bool showHide = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var user = (
|
||||
from a in db.Usery
|
||||
where (showHide || !a.Hide)
|
||||
select a
|
||||
).ToArray();
|
||||
return user;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string[][] UserListTable(bool showHide = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var db = new MainDB())
|
||||
{
|
||||
var list = UserList(showHide);
|
||||
var subres = new List<string[]>();
|
||||
foreach (var r in list)
|
||||
{
|
||||
subres.Add(
|
||||
new string[]{
|
||||
r.Login
|
||||
});
|
||||
}
|
||||
return subres.ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
147
Diplom O.csproj
147
Diplom O.csproj
@ -14,6 +14,21 @@
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@ -255,6 +270,18 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DataBase\AccessDB.cs" />
|
||||
<Compile Include="DataBase\UserDB.cs" />
|
||||
<Compile Include="DataBase\FreeDB.cs" />
|
||||
<Compile Include="DataBase\LearnDB.cs" />
|
||||
<Compile Include="DataBase\ChelDB.cs" />
|
||||
<Compile Include="DataBase\ChildDB.cs" />
|
||||
<Compile Include="DataBase\RabotinkDB.cs" />
|
||||
<Compile Include="DataBase\RabotnikTypeStajDB.cs" />
|
||||
<Compile Include="DataBase\CorrStajDB.cs" />
|
||||
<Compile Include="DataBase\TypeStajDB.cs" />
|
||||
<Compile Include="GlobalFormFunc.cs" />
|
||||
<Compile Include="DataBase\ShtatDB.cs" />
|
||||
<Compile Include="MainForms\ChelForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -262,13 +289,42 @@
|
||||
<DependentUpon>ChelForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DataBase\ConnectDB.cs" />
|
||||
<Compile Include="DataBase\FuncDB.cs" />
|
||||
<Compile Include="MainForms\LoginForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\LoginForm.Designer.cs">
|
||||
<DependentUpon>LoginForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\SettingsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\SettingsForm.Designer.cs">
|
||||
<DependentUpon>SettingsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\OtpForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\OtpForm.Designer.cs">
|
||||
<DependentUpon>OtpForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\LearnForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\LearnForm.Designer.cs">
|
||||
<DependentUpon>LearnForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\StajForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\StajForm.Designer.cs">
|
||||
<DependentUpon>StajForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\ChildForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\ChildForm.Designer.cs">
|
||||
<DependentUpon>ChildForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForms\RabForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -283,11 +339,35 @@
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SupportForms\SelectChelForm.cs">
|
||||
<Compile Include="SupportForms\LoginForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\SelectChelForm.Designer.cs">
|
||||
<DependentUpon>SelectChelForm.cs</DependentUpon>
|
||||
<Compile Include="SupportForms\LoginForm.Designer.cs">
|
||||
<DependentUpon>LoginForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\ChildForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\ChildForm.Designer.cs">
|
||||
<DependentUpon>ChildForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\OptForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\OptForm.Designer.cs">
|
||||
<DependentUpon>OptForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\LearnForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\LearnForm.Designer.cs">
|
||||
<DependentUpon>LearnForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\WorkerForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\WorkerForm.Designer.cs">
|
||||
<DependentUpon>WorkerForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SupportForms\WorkChelForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
@ -304,6 +384,27 @@
|
||||
<EmbeddedResource Include="MainForms\ChelForm.resx">
|
||||
<DependentUpon>ChelForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForms\LoginForm.resx">
|
||||
<DependentUpon>LoginForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForms\SettingsForm.resx">
|
||||
<DependentUpon>SettingsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForms\OtpForm.resx">
|
||||
<DependentUpon>OtpForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForms\LearnForm.resx">
|
||||
<DependentUpon>LearnForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForms\StajForm.resx">
|
||||
<DependentUpon>StajForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForms\ChildForm.resx">
|
||||
<DependentUpon>ChildForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForms\RabForm.resx">
|
||||
<DependentUpon>RabForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForms\ShtatForm.resx">
|
||||
<DependentUpon>ShtatForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@ -316,8 +417,20 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="SupportForms\SelectChelForm.resx">
|
||||
<DependentUpon>SelectChelForm.cs</DependentUpon>
|
||||
<EmbeddedResource Include="SupportForms\LoginForm.resx">
|
||||
<DependentUpon>LoginForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SupportForms\ChildForm.resx">
|
||||
<DependentUpon>ChildForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SupportForms\OptForm.resx">
|
||||
<DependentUpon>OptForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SupportForms\LearnForm.resx">
|
||||
<DependentUpon>LearnForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SupportForms\WorkerForm.resx">
|
||||
<DependentUpon>WorkerForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SupportForms\WorkChelForm.resx">
|
||||
<DependentUpon>WorkChelForm.cs</DependentUpon>
|
||||
@ -325,6 +438,16 @@
|
||||
<EmbeddedResource Include="SupportForms\WorkShtatForm.resx">
|
||||
<DependentUpon>WorkShtatForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="DC\CD_DB.cd" />
|
||||
<None Include="DC\CD_M_1.cd" />
|
||||
<None Include="DC\CD_DB_2.cd" />
|
||||
<None Include="DC\CD_M_7.cd" />
|
||||
<None Include="DC\CD_M_6.cd" />
|
||||
<None Include="DC\CD_M_5.cd" />
|
||||
<None Include="DC\CD_M_4.cd" />
|
||||
<None Include="DC\CD_M_3.cd" />
|
||||
<None Include="DC\CD_M_2.cd" />
|
||||
<None Include="DC\ClassDiagram2.cd" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
@ -339,6 +462,18 @@
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 и x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="packages\SQLitePCLRaw.lib.e_sqlite3.2.0.4\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets" Condition="Exists('packages\SQLitePCLRaw.lib.e_sqlite3.2.0.4\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets')" />
|
||||
|
13
Diplom O.csproj.user
Normal file
13
Diplom O.csproj.user
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishUrlHistory />
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<BootstrapperUrlHistory />
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>ru-RU</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.31424.327
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Diplom O", "Diplom O.csproj", "{4AC6A26F-1F0F-40E0-AE87-AD533985C10D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestFunctons", "..\TestFunctons\TestFunctons.csproj", "{E484630E-D0A0-4DA8-B7D0-EB9E9A57CEAC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -15,6 +17,10 @@ Global
|
||||
{4AC6A26F-1F0F-40E0-AE87-AD533985C10D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4AC6A26F-1F0F-40E0-AE87-AD533985C10D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4AC6A26F-1F0F-40E0-AE87-AD533985C10D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E484630E-D0A0-4DA8-B7D0-EB9E9A57CEAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E484630E-D0A0-4DA8-B7D0-EB9E9A57CEAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E484630E-D0A0-4DA8-B7D0-EB9E9A57CEAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E484630E-D0A0-4DA8-B7D0-EB9E9A57CEAC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
283
GlobalFormFunc.cs
Normal file
283
GlobalFormFunc.cs
Normal file
@ -0,0 +1,283 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public static class FormExtention
|
||||
{
|
||||
public static User user = null;
|
||||
public static User GetUser(this Form form)
|
||||
{
|
||||
return user;
|
||||
}
|
||||
public static void SetUser(this Form form, User usr)
|
||||
{
|
||||
user = usr;
|
||||
}
|
||||
|
||||
public static int nextForm = -1;
|
||||
public static int GetNextForm(this Form form)
|
||||
{
|
||||
return nextForm;
|
||||
}
|
||||
public static void SetNextForm(this Form form, int value)
|
||||
{
|
||||
nextForm = value;
|
||||
}
|
||||
|
||||
public static void correctUpperMenu(this Form form, MenuStrip upMenu, int value)
|
||||
{
|
||||
var items = upMenu.Items;
|
||||
for (var i = 0; i < items.Count; i++)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
items[i].Enabled = false;
|
||||
continue;
|
||||
}
|
||||
var access = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, i, 0);
|
||||
if (access == null)
|
||||
{
|
||||
items[i].Enabled = false;
|
||||
continue;
|
||||
}
|
||||
items[i].Enabled = (i != value);
|
||||
}
|
||||
}
|
||||
public static void upperMenuClicked(this Form form, MenuStrip upMenu)
|
||||
{
|
||||
var menuItems = upMenu.Items;
|
||||
for (var i = 0; i < menuItems.Count; i++)
|
||||
if (menuItems[i].Selected)
|
||||
nextForm = i;
|
||||
}
|
||||
|
||||
private static int countErr = 0;
|
||||
private static int currTurnErr = 0;
|
||||
private static bool flagfollow = false;
|
||||
public static async void ShowError(this Form form, ToolStripStatusLabel errorLabel, string msg = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
int ticket = countErr;
|
||||
countErr = (countErr == int.MaxValue) ? 0 : countErr + 1;
|
||||
while (flagfollow && (currTurnErr != ticket))
|
||||
await Task.Delay(1000);
|
||||
Action func = () =>
|
||||
{
|
||||
errorLabel.Text = string.IsNullOrEmpty(msg) ? "Неизвестная ошибка." : msg;
|
||||
errorLabel.Visible = true;
|
||||
};
|
||||
if (form.InvokeRequired)
|
||||
form.Invoke(func);
|
||||
else
|
||||
func.Invoke();
|
||||
await Task.Delay(5000);
|
||||
func = () =>
|
||||
{
|
||||
errorLabel.Visible = false;
|
||||
};
|
||||
if (currTurnErr == ticket)
|
||||
if (form.InvokeRequired)
|
||||
form.Invoke(func);
|
||||
else
|
||||
func.Invoke();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
finally
|
||||
{
|
||||
currTurnErr = (currTurnErr == int.MaxValue) ? 0 : currTurnErr + 1;
|
||||
}
|
||||
}
|
||||
|
||||
private static int countFind = 0;
|
||||
public delegate void resetTableFind();
|
||||
public static async void FindOnChanged(this Form form, resetTableFind func)
|
||||
{
|
||||
var flag = ++countFind;
|
||||
await Task.Delay(1000);
|
||||
Action lFunc = () =>
|
||||
{
|
||||
func?.Invoke();
|
||||
};
|
||||
if (flag == countFind)
|
||||
if (form.InvokeRequired)
|
||||
form.Invoke(lFunc);
|
||||
else
|
||||
lFunc.Invoke();
|
||||
}
|
||||
|
||||
public static async void ResetTable(this Form form, DataGridView table, ColumnConf[] columns, string[][] data)
|
||||
{
|
||||
try
|
||||
{
|
||||
var currSelected = new List<(int col, int row)>();
|
||||
var tmpCells = table.SelectedCells;
|
||||
for (var i = 0; i < tmpCells.Count; i++)
|
||||
currSelected.Add((
|
||||
tmpCells[i].ColumnIndex,
|
||||
tmpCells[i].RowIndex
|
||||
));
|
||||
ClearTable(form, table, columns);
|
||||
FillTable(form, table, data);
|
||||
for (var i = currSelected.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var col = currSelected[i].col;
|
||||
var row = currSelected[i].row;
|
||||
if (row >= 0 && row < table.Rows.Count && col >= 0 && col < table.Columns.Count)
|
||||
table[col, row].Selected = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
}
|
||||
public static async void ClearTable(this Form form, DataGridView table, ColumnConf[] columns)
|
||||
{
|
||||
Action func = () =>
|
||||
{
|
||||
table.Rows.Clear();
|
||||
table.Columns.Clear();
|
||||
var c = table.Columns;
|
||||
for (var i = 0; i < columns.Length; i++)
|
||||
{
|
||||
c.Add(columns[i].name, columns[i].name);
|
||||
c[i].Width = columns[i].size;
|
||||
if (columns[i].warp)
|
||||
c[i].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
|
||||
}
|
||||
};
|
||||
if (form.InvokeRequired)
|
||||
form.Invoke(func);
|
||||
else
|
||||
func.Invoke();
|
||||
return;
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
public static async void FillTable(this Form form, DataGridView table, string[][] data)
|
||||
{
|
||||
if (data == null || data.Length == 0)
|
||||
return;
|
||||
try
|
||||
{
|
||||
if (table.Columns.Count != data[0].Length)
|
||||
throw new Exception("Количество элементов данных (" + data[0].Length +
|
||||
") не соответствует колчиству столбцов (" + table.Columns.Count + ")");
|
||||
foreach (var lRow in data)
|
||||
table.Rows.Add(lRow);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public static class FormArray
|
||||
{
|
||||
public static readonly string[] formName = {
|
||||
"Актуальные вакансии",
|
||||
"Люди",
|
||||
"Сотрудники",
|
||||
"Стаж",
|
||||
"Образование",
|
||||
"Отпуск/Больничный",
|
||||
"Дети",
|
||||
"Настройки"
|
||||
};
|
||||
public static readonly string[] formAccess = {
|
||||
"Чтение",
|
||||
"Удаление",
|
||||
"Изменение",
|
||||
"Добавление"
|
||||
};
|
||||
|
||||
public static int GetNameInt(string name)
|
||||
{
|
||||
var result = -1;
|
||||
for (var i = 0; i < formName.Length; i++)
|
||||
if (name.CompareTo(formName[i]) == 0)
|
||||
result = i;
|
||||
return result;
|
||||
}
|
||||
public static string GetNameString(int id)
|
||||
{
|
||||
var result = "Ошибка";
|
||||
if (id >= 0 && id < formName.Length)
|
||||
result = formName[id];
|
||||
return result;
|
||||
}
|
||||
public static int GetAccessInt(string name)
|
||||
{
|
||||
var result = -1;
|
||||
for (var i = 0; i < formAccess.Length; i++)
|
||||
if (name.CompareTo(formAccess[i]) == 0)
|
||||
result = i;
|
||||
return result;
|
||||
}
|
||||
public static string GetAccessString(int id)
|
||||
{
|
||||
var result = "Ошибка";
|
||||
if (id >= 0 && id < formAccess.Length)
|
||||
result = formAccess[id];
|
||||
return result;
|
||||
}
|
||||
}
|
||||
public static class TableColumnssss
|
||||
{
|
||||
public static readonly ColumnConf Id = new ColumnConf(name: "№");
|
||||
public static readonly ColumnConf Free = new ColumnConf(name: "Своб.");
|
||||
public static readonly ColumnConf KolVo = new ColumnConf(name: "Кол-во");
|
||||
public static readonly ColumnConf Male = new ColumnConf(name: "Пол");
|
||||
|
||||
public static readonly ColumnConf TabNum = new ColumnConf(name: "Таб. №", size: 80);
|
||||
public static readonly ColumnConf BDay = new ColumnConf(name: "Дата рождения", size: 80);
|
||||
public static readonly ColumnConf INN = new ColumnConf(name: "ИНН", size: 100);
|
||||
public static readonly ColumnConf SNILS = new ColumnConf(name: "СНИЛС", size: 100);
|
||||
public static readonly ColumnConf Dolj = new ColumnConf(name: "Должность", size: 140);
|
||||
public static readonly ColumnConf TypeStaj = new ColumnConf(name: "Тип стажа", size: 140);
|
||||
public static readonly ColumnConf FIO = new ColumnConf(name: "Фамилия И.О.", size: 140);
|
||||
|
||||
public static readonly ColumnConf Adress = new ColumnConf(name: "Адрес", size: 140, warp: true);
|
||||
public static readonly ColumnConf Pasport = new ColumnConf(name: "Паспорт", size: 140, warp: true);
|
||||
|
||||
}
|
||||
|
||||
public struct ColumnConf
|
||||
{
|
||||
public string name;
|
||||
public int size;
|
||||
public bool warp;
|
||||
public ColumnConf(string name = "ErNO", int size = 60, bool warp = false)
|
||||
{
|
||||
this.name = name;
|
||||
this.size = size;
|
||||
this.warp = warp;
|
||||
}
|
||||
}
|
||||
|
||||
public struct CopyOfColumnConf
|
||||
{
|
||||
public string name;
|
||||
public int size;
|
||||
public bool warp;
|
||||
public CopyOfColumnConf(string name = "ErNO", int size = 60, bool warp = false)
|
||||
{
|
||||
this.name = name;
|
||||
this.size = size;
|
||||
this.warp = warp;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
204
MainForms/ChelForm.Designer.cs
generated
204
MainForms/ChelForm.Designer.cs
generated
@ -31,17 +31,15 @@ namespace Diplom_O
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stajMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.learnMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.настройкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.rodGridView = new System.Windows.Forms.DataGridView();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.chelRodLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.delRodButton = new System.Windows.Forms.Button();
|
||||
this.addRodButton = new System.Windows.Forms.Button();
|
||||
this.chelGridView = new System.Windows.Forms.DataGridView();
|
||||
this.delButton = new System.Windows.Forms.Button();
|
||||
this.changeButton = new System.Windows.Forms.Button();
|
||||
@ -50,10 +48,9 @@ namespace Diplom_O
|
||||
this.dropFindButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.findBox = new System.Windows.Forms.TextBox();
|
||||
this.selectButton = new System.Windows.Forms.Button();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.rodGridView)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chelGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@ -61,26 +58,49 @@ namespace Diplom_O
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.chelRodMI,
|
||||
this.rabitnikiMI,
|
||||
this.stajMI,
|
||||
this.learnMI,
|
||||
this.otpBolMI,
|
||||
this.chelRodMI});
|
||||
this.детиToolStripMenuItem,
|
||||
this.настройкиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(1186, 24);
|
||||
this.menuStrip.Size = new System.Drawing.Size(1328, 24);
|
||||
this.menuStrip.TabIndex = 1;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(46, 20);
|
||||
this.shtatMI.Text = "Штат";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(78, 20);
|
||||
this.rabitnikiMI.Text = "Работники";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(85, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудники";
|
||||
//
|
||||
// stajMI
|
||||
//
|
||||
this.stajMI.Name = "stajMI";
|
||||
this.stajMI.Size = new System.Drawing.Size(47, 20);
|
||||
this.stajMI.Text = "Стаж";
|
||||
//
|
||||
// learnMI
|
||||
//
|
||||
this.learnMI.Name = "learnMI";
|
||||
this.learnMI.Size = new System.Drawing.Size(92, 20);
|
||||
this.learnMI.Text = "Образование";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
@ -88,11 +108,17 @@ namespace Diplom_O
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// chelRodMI
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(95, 20);
|
||||
this.chelRodMI.Text = "Люди/Родств.";
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// настройкиToolStripMenuItem
|
||||
//
|
||||
this.настройкиToolStripMenuItem.Name = "настройкиToolStripMenuItem";
|
||||
this.настройкиToolStripMenuItem.Size = new System.Drawing.Size(79, 20);
|
||||
this.настройкиToolStripMenuItem.Text = "Настройки";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
@ -107,85 +133,12 @@ namespace Diplom_O
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 386);
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 772);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(1186, 22);
|
||||
this.statusStrip1.Size = new System.Drawing.Size(1328, 22);
|
||||
this.statusStrip1.TabIndex = 16;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox1.Controls.Add(this.rodGridView);
|
||||
this.groupBox1.Controls.Add(this.comboBox1);
|
||||
this.groupBox1.Controls.Add(this.chelRodLabel);
|
||||
this.groupBox1.Controls.Add(this.delRodButton);
|
||||
this.groupBox1.Controls.Add(this.addRodButton);
|
||||
this.groupBox1.Location = new System.Drawing.Point(844, 27);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(330, 356);
|
||||
this.groupBox1.TabIndex = 26;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Родственники";
|
||||
//
|
||||
// rodGridView
|
||||
//
|
||||
this.rodGridView.AllowUserToAddRows = false;
|
||||
this.rodGridView.AllowUserToDeleteRows = false;
|
||||
this.rodGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.rodGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.rodGridView.Location = new System.Drawing.Point(6, 85);
|
||||
this.rodGridView.MultiSelect = false;
|
||||
this.rodGridView.Name = "rodGridView";
|
||||
this.rodGridView.ReadOnly = true;
|
||||
this.rodGridView.RowHeadersVisible = false;
|
||||
this.rodGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.rodGridView.Size = new System.Drawing.Size(318, 265);
|
||||
this.rodGridView.TabIndex = 12;
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Items.AddRange(new object[] {
|
||||
"Родственная связь"});
|
||||
this.comboBox1.Location = new System.Drawing.Point(168, 21);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(156, 21);
|
||||
this.comboBox1.TabIndex = 7;
|
||||
//
|
||||
// chelRodLabel
|
||||
//
|
||||
this.chelRodLabel.AutoSize = true;
|
||||
this.chelRodLabel.Location = new System.Drawing.Point(6, 24);
|
||||
this.chelRodLabel.Name = "chelRodLabel";
|
||||
this.chelRodLabel.Size = new System.Drawing.Size(81, 13);
|
||||
this.chelRodLabel.TabIndex = 6;
|
||||
this.chelRodLabel.TabStop = true;
|
||||
this.chelRodLabel.Text = "Фамилия И.О.";
|
||||
this.chelRodLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.chelRodLabel_Clicked);
|
||||
//
|
||||
// delRodButton
|
||||
//
|
||||
this.delRodButton.Location = new System.Drawing.Point(87, 56);
|
||||
this.delRodButton.Name = "delRodButton";
|
||||
this.delRodButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delRodButton.TabIndex = 10;
|
||||
this.delRodButton.Text = "Удалить";
|
||||
this.delRodButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// addRodButton
|
||||
//
|
||||
this.addRodButton.Location = new System.Drawing.Point(6, 56);
|
||||
this.addRodButton.Name = "addRodButton";
|
||||
this.addRodButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addRodButton.TabIndex = 8;
|
||||
this.addRodButton.Text = "Добавить";
|
||||
this.addRodButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chelGridView
|
||||
//
|
||||
this.chelGridView.AllowUserToAddRows = false;
|
||||
@ -200,12 +153,13 @@ namespace Diplom_O
|
||||
this.chelGridView.ReadOnly = true;
|
||||
this.chelGridView.RowHeadersVisible = false;
|
||||
this.chelGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.chelGridView.Size = new System.Drawing.Size(826, 298);
|
||||
this.chelGridView.Size = new System.Drawing.Size(1304, 684);
|
||||
this.chelGridView.TabIndex = 11;
|
||||
//
|
||||
// delButton
|
||||
//
|
||||
this.delButton.Location = new System.Drawing.Point(174, 27);
|
||||
this.delButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.delButton.Location = new System.Drawing.Point(1241, 27);
|
||||
this.delButton.Name = "delButton";
|
||||
this.delButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delButton.TabIndex = 2;
|
||||
@ -215,7 +169,8 @@ namespace Diplom_O
|
||||
//
|
||||
// changeButton
|
||||
//
|
||||
this.changeButton.Location = new System.Drawing.Point(93, 27);
|
||||
this.changeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.changeButton.Location = new System.Drawing.Point(1160, 27);
|
||||
this.changeButton.Name = "changeButton";
|
||||
this.changeButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.changeButton.TabIndex = 1;
|
||||
@ -225,7 +180,8 @@ namespace Diplom_O
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.Location = new System.Drawing.Point(12, 27);
|
||||
this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addButton.Location = new System.Drawing.Point(1079, 27);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addButton.TabIndex = 0;
|
||||
@ -238,18 +194,18 @@ namespace Diplom_O
|
||||
this.showWorkerCheckBox.AutoSize = true;
|
||||
this.showWorkerCheckBox.Checked = true;
|
||||
this.showWorkerCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.showWorkerCheckBox.Location = new System.Drawing.Point(255, 31);
|
||||
this.showWorkerCheckBox.Location = new System.Drawing.Point(15, 31);
|
||||
this.showWorkerCheckBox.Name = "showWorkerCheckBox";
|
||||
this.showWorkerCheckBox.Size = new System.Drawing.Size(204, 17);
|
||||
this.showWorkerCheckBox.Size = new System.Drawing.Size(165, 17);
|
||||
this.showWorkerCheckBox.TabIndex = 3;
|
||||
this.showWorkerCheckBox.Text = "Поrазать/скрыть трудоустроенных";
|
||||
this.showWorkerCheckBox.Text = "Показать трудоустроенных";
|
||||
this.showWorkerCheckBox.UseVisualStyleBackColor = true;
|
||||
this.showWorkerCheckBox.CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
|
||||
this.showWorkerCheckBox.CheckedChanged += new System.EventHandler(this.showWorker_CheckedChanged);
|
||||
//
|
||||
// dropFindButton
|
||||
//
|
||||
this.dropFindButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dropFindButton.Location = new System.Drawing.Point(763, 360);
|
||||
this.dropFindButton.Location = new System.Drawing.Point(1241, 746);
|
||||
this.dropFindButton.Name = "dropFindButton";
|
||||
this.dropFindButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.dropFindButton.TabIndex = 5;
|
||||
@ -261,7 +217,7 @@ namespace Diplom_O
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 365);
|
||||
this.label1.Location = new System.Drawing.Point(12, 751);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(39, 13);
|
||||
this.label1.TabIndex = 28;
|
||||
@ -271,17 +227,29 @@ namespace Diplom_O
|
||||
//
|
||||
this.findBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.findBox.Location = new System.Drawing.Point(57, 362);
|
||||
this.findBox.Location = new System.Drawing.Point(57, 748);
|
||||
this.findBox.Name = "findBox";
|
||||
this.findBox.Size = new System.Drawing.Size(700, 20);
|
||||
this.findBox.Size = new System.Drawing.Size(1178, 20);
|
||||
this.findBox.TabIndex = 4;
|
||||
this.findBox.TextChanged += new System.EventHandler(this.findBox_TextChanged);
|
||||
//
|
||||
// selectButton
|
||||
//
|
||||
this.selectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.selectButton.Location = new System.Drawing.Point(998, 27);
|
||||
this.selectButton.Name = "selectButton";
|
||||
this.selectButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.selectButton.TabIndex = 29;
|
||||
this.selectButton.Text = "Выбрать";
|
||||
this.selectButton.UseVisualStyleBackColor = true;
|
||||
this.selectButton.Click += new System.EventHandler(this.selectButton_Click);
|
||||
//
|
||||
// ChelForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1186, 408);
|
||||
this.ClientSize = new System.Drawing.Size(1328, 794);
|
||||
this.Controls.Add(this.selectButton);
|
||||
this.Controls.Add(this.chelGridView);
|
||||
this.Controls.Add(this.delButton);
|
||||
this.Controls.Add(this.changeButton);
|
||||
@ -290,18 +258,15 @@ namespace Diplom_O
|
||||
this.Controls.Add(this.dropFindButton);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.findBox);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Name = "ChelForm";
|
||||
this.Text = "Люди / Родственники";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Люди";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.rodGridView)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chelGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
@ -317,12 +282,6 @@ namespace Diplom_O
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.DataGridView rodGridView;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.LinkLabel chelRodLabel;
|
||||
private System.Windows.Forms.Button delRodButton;
|
||||
private System.Windows.Forms.Button addRodButton;
|
||||
private System.Windows.Forms.DataGridView chelGridView;
|
||||
private System.Windows.Forms.Button delButton;
|
||||
private System.Windows.Forms.Button changeButton;
|
||||
@ -331,5 +290,10 @@ namespace Diplom_O
|
||||
private System.Windows.Forms.Button dropFindButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox findBox;
|
||||
}
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.Button selectButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem stajMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem learnMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem настройкиToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -13,113 +13,86 @@ namespace Diplom_O
|
||||
{
|
||||
public partial class ChelForm : Form
|
||||
{
|
||||
private Task errDrop;
|
||||
private void ShowError(string msg = null)
|
||||
{
|
||||
errorLabel.Text = string.IsNullOrEmpty(msg) ? "Неизвестная ошибка." : msg;
|
||||
errorLabel.Visible = true;
|
||||
errDrop = new Task(() =>
|
||||
{
|
||||
var fd = errDrop.Id;
|
||||
Task.Delay(5000).Wait();
|
||||
if (errDrop.Id == fd)
|
||||
if (InvokeRequired) Invoke((Action)(() => { errorLabel.Visible = false; }));
|
||||
else errorLabel.Visible = false;
|
||||
});
|
||||
errDrop.Start();
|
||||
}
|
||||
|
||||
private Task filterDrop;
|
||||
private readonly ColumnConf[] tableColumns = {
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf("Фамилия", 140),
|
||||
new ColumnConf("Имя", 140),
|
||||
new ColumnConf("Отчество", 140),
|
||||
new ColumnConf(name: "Пол"),
|
||||
new ColumnConf(name: "Дата рождения", size: 80),
|
||||
new ColumnConf(name: "Адрес", size: 140, warp: true),
|
||||
new ColumnConf(name: "Телефон", size: 100),
|
||||
new ColumnConf(name: "ИНН", size: 100),
|
||||
new ColumnConf(name: "СНИЛС", size: 100),
|
||||
new ColumnConf(name: "Паспорт", size: 140, warp: true),
|
||||
new ColumnConf(name: "Пенсионер", size: 100)
|
||||
};
|
||||
private void findBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
filterDrop = new Task(() =>
|
||||
{
|
||||
var fd = filterDrop.Id;
|
||||
Task.Delay(1000).Wait();
|
||||
if (filterDrop.Id == fd)
|
||||
if (InvokeRequired) Invoke((Action)(() => { resetChelTable(); }));
|
||||
else resetChelTable();
|
||||
});
|
||||
filterDrop.Start();
|
||||
this.FindOnChanged(resetChelTable);
|
||||
}
|
||||
private void dropFindButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
findBox.Text = "";
|
||||
filterDrop = new Task(() => { return; });
|
||||
this.FindOnChanged(null);
|
||||
resetChelTable();
|
||||
}
|
||||
private void resetChelTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
chelGridView.Rows.Clear();
|
||||
chelGridView.Columns.Clear();
|
||||
var c = chelGridView.Columns;
|
||||
c.Add("Id", "№");
|
||||
c.Add("FIO", "Фамилия И.О.");
|
||||
c.Add("Male", "Пол");
|
||||
c.Add("Birthday", "Дата рождения");
|
||||
c.Add("Adress", "Адрес");
|
||||
c.Add("INN", "ИНН");
|
||||
c.Add("SNILS", "СНИЛС");
|
||||
c.Add("Pasport", "Паспорт");
|
||||
c[0].Width = 40;
|
||||
c[1].Width = 120;
|
||||
c[2].Width = 40;
|
||||
c[3].Width = 80;
|
||||
c[4].Width = 140;
|
||||
c[5].Width = 90;
|
||||
c[6].Width = 100;
|
||||
c[7].Width = 140;
|
||||
c[4].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
|
||||
c[7].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
|
||||
}
|
||||
{
|
||||
var arr = FuncDB.ListChel(findBox.Text);
|
||||
var r = chelGridView.Rows;
|
||||
foreach (var chel in arr)
|
||||
if (showWorkerCheckBox.Checked || !FuncDB.HaveChelRabotnik(chel.Id))
|
||||
r.Add(new object[] {
|
||||
chel.Id,
|
||||
chel.FName +
|
||||
(string.IsNullOrEmpty(chel.SName) ? "" : (" " + chel.SName[0] + ".")) +
|
||||
(string.IsNullOrEmpty(chel.TName) ? "" : (" " + chel.TName[0] + ".")),
|
||||
chel.Male ? "Муж" : "Жен",
|
||||
chel.Birthday.ToString("yyyy.MM.dd"),
|
||||
chel.Address,
|
||||
chel.INN,
|
||||
chel.SNILS,
|
||||
chel.Pasport
|
||||
});
|
||||
}
|
||||
if (chelGridView.Rows.Count > 0)
|
||||
chelGridView.Rows[0].Selected = true;
|
||||
var tmp = FuncDB.ChelListTableMain(findBox.Text, showWorkerCheckBox.Checked);
|
||||
var res = new List<string[]>();
|
||||
this.ResetTable(
|
||||
chelGridView,
|
||||
tableColumns,
|
||||
tmp
|
||||
);
|
||||
}
|
||||
catch (Exception e) { ShowError(e.Message); }
|
||||
catch (Exception e) { this.ShowError(errorLabel, e.Message); }
|
||||
}
|
||||
private Chel selectedChel()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (chelGridView.SelectedRows.Count != 1) throw new Exception("Человек не выбран.");
|
||||
var chel = FuncDB.GetChel((int)chelGridView.SelectedRows[0].Cells[0].Value);
|
||||
return chel;
|
||||
if (chelGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Человек не выбран.");
|
||||
if (int.TryParse((string)chelGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.ChelGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
catch (Exception e) { ShowError(e.Message); return null; }
|
||||
}
|
||||
|
||||
public ChelForm()
|
||||
public bool isCanceled = true;
|
||||
public Chel formResult = null;
|
||||
public ChelForm(bool select = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitializeComponent();
|
||||
chelRodMI.Enabled = false;
|
||||
selectButton.Visible = select;
|
||||
menuStrip.Enabled = !select;
|
||||
this.correctUpperMenu(menuStrip, 1);
|
||||
resetChelTable();
|
||||
|
||||
addButton.Enabled =
|
||||
changeButton.Enabled =
|
||||
delButton.Enabled = false;
|
||||
var user = this.GetUser();
|
||||
if (user == null)
|
||||
return;
|
||||
delButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 1, 1) != null;
|
||||
changeButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 1, 2) != null;
|
||||
addButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 1, 3) != null;
|
||||
|
||||
}
|
||||
catch { this.Close(); }
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var res = new SupportForms.WorkChelForm();
|
||||
@ -130,7 +103,8 @@ namespace Diplom_O
|
||||
private void changeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var chel = selectedChel();
|
||||
if (chel == null) { ShowError("Человек не выбран."); return; }
|
||||
if (chel == null)
|
||||
return;
|
||||
var res = new SupportForms.WorkChelForm(chel);
|
||||
res.ShowDialog();
|
||||
if (!res.isCanceled)
|
||||
@ -139,49 +113,35 @@ namespace Diplom_O
|
||||
private void delButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var chel = selectedChel();
|
||||
if (chel == null) { ShowError("Человек не выбран."); return; }
|
||||
if (FuncDB.HaveChelToChel(chel.Id)) { ShowError("Человек есть в таблице родственников."); return; }
|
||||
if (chel == null)
|
||||
return;
|
||||
try
|
||||
{
|
||||
FuncDB.DelChel(chel);
|
||||
FuncDB.ChelDelete(chel);
|
||||
resetChelTable();
|
||||
}
|
||||
catch (Exception ex) { ShowError(ex.Message); }
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
public void MI_Click(object sender, EventArgs e)
|
||||
private void selectButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
object form = null;
|
||||
var idxMenu = -1;
|
||||
try { idxMenu = menuStrip.Items.IndexOf((ToolStripMenuItem)sender); }
|
||||
catch { };
|
||||
switch (idxMenu)
|
||||
{
|
||||
case 0: form = new ShtatForm(); break;
|
||||
case 1: form = new RabForm(); break;
|
||||
case 2: form = new OtpForm(); break;
|
||||
case 3: form = new ChelForm(); break;
|
||||
}
|
||||
if (form != null)
|
||||
{
|
||||
this.Hide();
|
||||
((Form)form).Closed += (s, args) => this.Close();
|
||||
((Form)form).Show();
|
||||
return;
|
||||
}
|
||||
ShowError("Ошибка перехода на новую форму.");
|
||||
formResult = selectedChel();
|
||||
isCanceled = false;
|
||||
this.Close();
|
||||
}
|
||||
private void checkBox_CheckedChanged(object sender, EventArgs e)
|
||||
private void showWorker_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
resetChelTable();
|
||||
}
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
|
||||
private Chel chelRod = null;
|
||||
private void chelRodLabel_Clicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var chelForm = new SupportForms.SelectChelForm();
|
||||
chelForm.ShowDialog();
|
||||
if(chelForm.isCanceled)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
393
MainForms/ChildForm.Designer.cs
generated
Normal file
393
MainForms/ChildForm.Designer.cs
generated
Normal file
@ -0,0 +1,393 @@
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
partial class ChildForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stajMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.learnMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.childGridView = new System.Windows.Forms.DataGridView();
|
||||
this.addButton = new System.Windows.Forms.Button();
|
||||
this.dropFindButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.findBox = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.changeButton = new System.Windows.Forms.Button();
|
||||
this.delButton = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.lableChildCountFemale = new System.Windows.Forms.Label();
|
||||
this.lableChildCountMale = new System.Windows.Forms.Label();
|
||||
this.lableChildCount = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.настройкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.childGridView)).BeginInit();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.rabitnikiMI,
|
||||
this.stajMI,
|
||||
this.learnMI,
|
||||
this.otpBolMI,
|
||||
this.chelRodMI,
|
||||
this.детиToolStripMenuItem,
|
||||
this.настройкиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(1059, 24);
|
||||
this.menuStrip.TabIndex = 30;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(85, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудники";
|
||||
//
|
||||
// stajMI
|
||||
//
|
||||
this.stajMI.Name = "stajMI";
|
||||
this.stajMI.Size = new System.Drawing.Size(47, 20);
|
||||
this.stajMI.Text = "Стаж";
|
||||
//
|
||||
// learnMI
|
||||
//
|
||||
this.learnMI.Name = "learnMI";
|
||||
this.learnMI.Size = new System.Drawing.Size(92, 20);
|
||||
this.learnMI.Text = "Образование";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(137, 17);
|
||||
this.errorLabel.Text = "Отображение ошибки";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// childGridView
|
||||
//
|
||||
this.childGridView.AllowUserToAddRows = false;
|
||||
this.childGridView.AllowUserToDeleteRows = false;
|
||||
this.childGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.childGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.childGridView.Location = new System.Drawing.Point(12, 56);
|
||||
this.childGridView.MultiSelect = false;
|
||||
this.childGridView.Name = "childGridView";
|
||||
this.childGridView.ReadOnly = true;
|
||||
this.childGridView.RowHeadersVisible = false;
|
||||
this.childGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.childGridView.Size = new System.Drawing.Size(688, 376);
|
||||
this.childGridView.TabIndex = 36;
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addButton.Location = new System.Drawing.Point(463, 27);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addButton.TabIndex = 29;
|
||||
this.addButton.Text = "Добавить";
|
||||
this.addButton.UseVisualStyleBackColor = true;
|
||||
this.addButton.Click += new System.EventHandler(this.addButton_Click);
|
||||
//
|
||||
// dropFindButton
|
||||
//
|
||||
this.dropFindButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dropFindButton.Location = new System.Drawing.Point(625, 438);
|
||||
this.dropFindButton.Name = "dropFindButton";
|
||||
this.dropFindButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.dropFindButton.TabIndex = 35;
|
||||
this.dropFindButton.Text = "Сбросить";
|
||||
this.dropFindButton.UseVisualStyleBackColor = true;
|
||||
this.dropFindButton.Click += new System.EventHandler(this.dropFindButton_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 443);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(39, 13);
|
||||
this.label1.TabIndex = 38;
|
||||
this.label1.Text = "Поиск";
|
||||
//
|
||||
// findBox
|
||||
//
|
||||
this.findBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.findBox.Location = new System.Drawing.Point(57, 440);
|
||||
this.findBox.Name = "findBox";
|
||||
this.findBox.Size = new System.Drawing.Size(562, 20);
|
||||
this.findBox.TabIndex = 34;
|
||||
this.findBox.TextChanged += new System.EventHandler(this.findBox_TextChanged);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 464);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(1059, 22);
|
||||
this.statusStrip1.TabIndex = 37;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// changeButton
|
||||
//
|
||||
this.changeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.changeButton.Location = new System.Drawing.Point(544, 27);
|
||||
this.changeButton.Name = "changeButton";
|
||||
this.changeButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.changeButton.TabIndex = 39;
|
||||
this.changeButton.Text = "Изменить";
|
||||
this.changeButton.UseVisualStyleBackColor = true;
|
||||
this.changeButton.Click += new System.EventHandler(this.changeButton_Click);
|
||||
//
|
||||
// delButton
|
||||
//
|
||||
this.delButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.delButton.Location = new System.Drawing.Point(625, 27);
|
||||
this.delButton.Name = "delButton";
|
||||
this.delButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delButton.TabIndex = 40;
|
||||
this.delButton.Text = "Удалить";
|
||||
this.delButton.UseVisualStyleBackColor = true;
|
||||
this.delButton.Click += new System.EventHandler(this.delButton_Click);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox1.Controls.Add(this.lableChildCountFemale);
|
||||
this.groupBox1.Controls.Add(this.lableChildCountMale);
|
||||
this.groupBox1.Controls.Add(this.lableChildCount);
|
||||
this.groupBox1.Controls.Add(this.button1);
|
||||
this.groupBox1.Controls.Add(this.dateTimePicker1);
|
||||
this.groupBox1.Controls.Add(this.label5);
|
||||
this.groupBox1.Controls.Add(this.label4);
|
||||
this.groupBox1.Controls.Add(this.label3);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Location = new System.Drawing.Point(706, 27);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(341, 433);
|
||||
this.groupBox1.TabIndex = 41;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Расчет";
|
||||
//
|
||||
// lableChildCountFemale
|
||||
//
|
||||
this.lableChildCountFemale.AutoSize = true;
|
||||
this.lableChildCountFemale.Location = new System.Drawing.Point(122, 100);
|
||||
this.lableChildCountFemale.Name = "lableChildCountFemale";
|
||||
this.lableChildCountFemale.Size = new System.Drawing.Size(13, 13);
|
||||
this.lableChildCountFemale.TabIndex = 20;
|
||||
this.lableChildCountFemale.Text = "0";
|
||||
//
|
||||
// lableChildCountMale
|
||||
//
|
||||
this.lableChildCountMale.AutoSize = true;
|
||||
this.lableChildCountMale.Location = new System.Drawing.Point(122, 74);
|
||||
this.lableChildCountMale.Name = "lableChildCountMale";
|
||||
this.lableChildCountMale.Size = new System.Drawing.Size(13, 13);
|
||||
this.lableChildCountMale.TabIndex = 19;
|
||||
this.lableChildCountMale.Text = "0";
|
||||
//
|
||||
// lableChildCount
|
||||
//
|
||||
this.lableChildCount.AutoSize = true;
|
||||
this.lableChildCount.Location = new System.Drawing.Point(122, 48);
|
||||
this.lableChildCount.Name = "lableChildCount";
|
||||
this.lableChildCount.Size = new System.Drawing.Size(13, 13);
|
||||
this.lableChildCount.TabIndex = 18;
|
||||
this.lableChildCount.Text = "0";
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(270, 17);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(65, 23);
|
||||
this.button1.TabIndex = 17;
|
||||
this.button1.Text = "Расчет";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(125, 19);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(139, 20);
|
||||
this.dateTimePicker1.TabIndex = 16;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(65, 100);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(54, 13);
|
||||
this.label5.TabIndex = 15;
|
||||
this.label5.Text = "Девочек:";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(53, 74);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(66, 13);
|
||||
this.label4.TabIndex = 14;
|
||||
this.label4.Text = "Мальчиков:";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(6, 48);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(113, 13);
|
||||
this.label3.TabIndex = 13;
|
||||
this.label3.Text = "Общее кол-во детей:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(34, 22);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(85, 13);
|
||||
this.label2.TabIndex = 12;
|
||||
this.label2.Text = "Расчет на дату:";
|
||||
//
|
||||
// настройкиToolStripMenuItem
|
||||
//
|
||||
this.настройкиToolStripMenuItem.Name = "настройкиToolStripMenuItem";
|
||||
this.настройкиToolStripMenuItem.Size = new System.Drawing.Size(79, 20);
|
||||
this.настройкиToolStripMenuItem.Text = "Настройки";
|
||||
//
|
||||
// ChildForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1059, 486);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.delButton);
|
||||
this.Controls.Add(this.changeButton);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Controls.Add(this.childGridView);
|
||||
this.Controls.Add(this.addButton);
|
||||
this.Controls.Add(this.dropFindButton);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.findBox);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Name = "ChildForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Дети";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.childGridView)).EndInit();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.DataGridView childGridView;
|
||||
private System.Windows.Forms.Button addButton;
|
||||
private System.Windows.Forms.Button dropFindButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox findBox;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.Button changeButton;
|
||||
private System.Windows.Forms.Button delButton;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label lableChildCountFemale;
|
||||
private System.Windows.Forms.Label lableChildCountMale;
|
||||
private System.Windows.Forms.Label lableChildCount;
|
||||
private System.Windows.Forms.ToolStripMenuItem stajMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem learnMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem настройкиToolStripMenuItem;
|
||||
}
|
||||
}
|
162
MainForms/ChildForm.cs
Normal file
162
MainForms/ChildForm.cs
Normal file
@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public partial class ChildForm : Form
|
||||
{
|
||||
private readonly ColumnConf[] tableMainColumns = {
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Фамилия И.О.", size: 140),
|
||||
new ColumnConf(name: "Пол", size: 80),
|
||||
new ColumnConf(name: "Дата рождения", size: 80),
|
||||
new ColumnConf(name: "Род 1", size: 140),
|
||||
new ColumnConf(name: "Род 2", size: 140)
|
||||
};
|
||||
|
||||
private void resetChildTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = FuncDB.ChildTableMain(findBox.Text);
|
||||
this.ResetTable(
|
||||
childGridView,
|
||||
tableMainColumns,
|
||||
res
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private Child selectedChildTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (childGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Ребонок не выбран.");
|
||||
if (int.TryParse((string)childGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.ChildGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void resetChildCount()
|
||||
{
|
||||
try
|
||||
{
|
||||
lableChildCount.Text = FuncDB.ChildCount(dateTimePicker1.Value).ToString();
|
||||
lableChildCountMale.Text = FuncDB.ChildCount(dateTimePicker1.Value, true).ToString();
|
||||
lableChildCountFemale.Text = FuncDB.ChildCount(dateTimePicker1.Value, false).ToString();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ChildForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.correctUpperMenu(menuStrip, 6);
|
||||
resetChildTable();
|
||||
dateTimePicker1.Value = DateTime.Now;
|
||||
resetChildCount();
|
||||
|
||||
addButton.Enabled =
|
||||
changeButton.Enabled =
|
||||
delButton.Enabled = false;
|
||||
|
||||
var user = this.GetUser();
|
||||
if (user == null)
|
||||
return;
|
||||
delButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 6, 1) != null;
|
||||
changeButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 6, 2) != null;
|
||||
addButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 6, 3) != null;
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var form = new SupportForms.ChildForm();
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetChildTable();
|
||||
resetChildCount();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void changeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var form = new SupportForms.ChildForm(selectedChildTable());
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetChildTable();
|
||||
resetChildCount();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void delButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = selectedChildTable();
|
||||
FuncDB.ChildDelete(res);
|
||||
resetChildTable();
|
||||
resetChildCount();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetChildCount();
|
||||
}
|
||||
private void findBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.FindOnChanged(resetChildTable);
|
||||
}
|
||||
private void dropFindButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
findBox.Text = "";
|
||||
this.FindOnChanged(null);
|
||||
resetChildTable();
|
||||
}
|
||||
}
|
||||
}
|
126
MainForms/ChildForm.resx
Normal file
126
MainForms/ChildForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>364, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>472, 17</value>
|
||||
</metadata>
|
||||
</root>
|
210
MainForms/ChildrenForm.Designer.cs
generated
Normal file
210
MainForms/ChildrenForm.Designer.cs
generated
Normal file
@ -0,0 +1,210 @@
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
partial class ChildrenForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.workerGridView = new System.Windows.Forms.DataGridView();
|
||||
this.addWorkerButton = new System.Windows.Forms.Button();
|
||||
this.dropFindButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.findBox = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.menuStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.workerGridView)).BeginInit();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.rabitnikiMI,
|
||||
this.otpBolMI,
|
||||
this.chelRodMI,
|
||||
this.детиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(983, 24);
|
||||
this.menuStrip.TabIndex = 30;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(78, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудник";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(137, 17);
|
||||
this.errorLabel.Text = "Отображение ошибки";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// workerGridView
|
||||
//
|
||||
this.workerGridView.AllowUserToAddRows = false;
|
||||
this.workerGridView.AllowUserToDeleteRows = false;
|
||||
this.workerGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.workerGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.workerGridView.Location = new System.Drawing.Point(12, 56);
|
||||
this.workerGridView.MultiSelect = false;
|
||||
this.workerGridView.Name = "workerGridView";
|
||||
this.workerGridView.ReadOnly = true;
|
||||
this.workerGridView.RowHeadersVisible = false;
|
||||
this.workerGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.workerGridView.Size = new System.Drawing.Size(459, 694);
|
||||
this.workerGridView.TabIndex = 36;
|
||||
this.workerGridView.SelectionChanged += new System.EventHandler(this.workerGridView_SelectionChanged);
|
||||
//
|
||||
// addWorkerButton
|
||||
//
|
||||
this.addWorkerButton.Location = new System.Drawing.Point(396, 27);
|
||||
this.addWorkerButton.Name = "addWorkerButton";
|
||||
this.addWorkerButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addWorkerButton.TabIndex = 29;
|
||||
this.addWorkerButton.Text = "Добавить";
|
||||
this.addWorkerButton.UseVisualStyleBackColor = true;
|
||||
this.addWorkerButton.Click += new System.EventHandler(this.addWorkerButton_Click);
|
||||
//
|
||||
// dropFindButton
|
||||
//
|
||||
this.dropFindButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.dropFindButton.Location = new System.Drawing.Point(396, 756);
|
||||
this.dropFindButton.Name = "dropFindButton";
|
||||
this.dropFindButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.dropFindButton.TabIndex = 35;
|
||||
this.dropFindButton.Text = "Сбросить";
|
||||
this.dropFindButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 761);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(39, 13);
|
||||
this.label1.TabIndex = 38;
|
||||
this.label1.Text = "Поиск";
|
||||
//
|
||||
// findBox
|
||||
//
|
||||
this.findBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.findBox.Location = new System.Drawing.Point(57, 758);
|
||||
this.findBox.Name = "findBox";
|
||||
this.findBox.Size = new System.Drawing.Size(333, 20);
|
||||
this.findBox.TabIndex = 34;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 782);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(983, 22);
|
||||
this.statusStrip1.TabIndex = 37;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// ChildrenForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(983, 804);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Controls.Add(this.workerGridView);
|
||||
this.Controls.Add(this.addWorkerButton);
|
||||
this.Controls.Add(this.dropFindButton);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.findBox);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Name = "ChildrenForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "ChildrenForm";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.workerGridView)).EndInit();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.DataGridView workerGridView;
|
||||
private System.Windows.Forms.Button addWorkerButton;
|
||||
private System.Windows.Forms.Button dropFindButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox findBox;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
}
|
||||
}
|
237
MainForms/ChildrenForm.cs
Normal file
237
MainForms/ChildrenForm.cs
Normal file
@ -0,0 +1,237 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public partial class ChildrenForm : Form
|
||||
{
|
||||
private readonly ColumnConf[] tableMainColumns = {
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Таб. №", size: 80),
|
||||
new ColumnConf(name: "Фамилия И.О.", size: 140),
|
||||
new ColumnConf(name: "Должность", size: 140)
|
||||
};
|
||||
private readonly ColumnConf[] tableHistoryColumns =
|
||||
{
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Таб. №", size: 80),
|
||||
new ColumnConf(name: "Должность", size: 140),
|
||||
new ColumnConf(name: "Дата начала", size: 80),
|
||||
new ColumnConf(name: "Дата конца", size: 80)
|
||||
};
|
||||
private readonly ColumnConf[] tableStajColumns =
|
||||
{
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Тип стажа", size: 120),
|
||||
};
|
||||
|
||||
private void resetRabotnikTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = FuncDB.RabotnikTableMain(findBox.Text);
|
||||
this.ResetTable(
|
||||
workerGridView,
|
||||
tableMainColumns,
|
||||
res
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private Rabotnik selectedRabotnikTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (workerGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Человек не выбран.");
|
||||
if (int.TryParse((string)workerGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.RabotnikGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private void workerGridView_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
resetHistoryWorkTable();
|
||||
}
|
||||
|
||||
private void resetHistoryWorkTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var rabotnik = selectedRabotnikTable();
|
||||
var res = (rabotnik == null) ? Array.Empty<string[]>() : FuncDB.RabotnikByChelIdTable(rabotnik.ChelId);
|
||||
this.ResetTable(
|
||||
historyWorkGridView,
|
||||
tableHistoryColumns,
|
||||
res
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private Rabotnik selectedHistoryWorkTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (historyWorkGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Человек не выбран.");
|
||||
if (int.TryParse((string)historyWorkGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.RabotnikGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private void historyWorkGridView_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
resetRabotnikStajTable();
|
||||
}
|
||||
|
||||
private void resetRabotnikStajTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var rabotnik = selectedHistoryWorkTable();
|
||||
var res = (rabotnik == null) ? Array.Empty<string[]>() :
|
||||
FuncDB.RabotnikTypeStajListString(rabotnik.Id);
|
||||
this.ResetTable(
|
||||
stajGridView,
|
||||
tableStajColumns,
|
||||
res
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private RabotnikTypeStaj selectedRabotnikStajTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (stajGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Стаж сотрудника не выбран.");
|
||||
if (int.TryParse((string)stajGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.RabotnikTypeStajGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void resetTypeStajComboBox()
|
||||
{
|
||||
try
|
||||
{
|
||||
var list = FuncDB.TypeStajListString();
|
||||
comboBox1.Items.Clear();
|
||||
comboBox1.Items.AddRange(list);
|
||||
comboBox1.SelectedIndex = -1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public RabForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.correctUpperMenu(menuStrip, 1);
|
||||
resetRabotnikTable();
|
||||
resetTypeStajComboBox();
|
||||
}
|
||||
|
||||
private void addWorkerButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new SupportForms.WorkerForm();
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetRabotnikTable();
|
||||
}
|
||||
private void addWorkPlaceButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new SupportForms.WorkerForm(selectedHistoryWorkTable(), true);
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetRabotnikTable();
|
||||
}
|
||||
private void addTypeStajButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var typestaj = FuncDB.TypeStajGetByName(comboBox1.Text);
|
||||
if (typestaj == null)
|
||||
{
|
||||
FuncDB.TypeStajAdd(new TypeStaj() { Name = comboBox1.Text });
|
||||
typestaj = FuncDB.TypeStajGetByName(comboBox1.Text);
|
||||
}
|
||||
var rabotnik = selectedHistoryWorkTable();
|
||||
if (rabotnik == null)
|
||||
throw new Exception("Не выбран сотрудник");
|
||||
FuncDB.RabotnikTypeStajAdd(new RabotnikTypeStaj() { RabitnikId = rabotnik.Id, TypeStajId = typestaj.Id });
|
||||
resetTypeStajComboBox();
|
||||
resetRabotnikStajTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void changeWorkPlaceButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new SupportForms.WorkerForm(selectedHistoryWorkTable());
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetRabotnikTable();
|
||||
}
|
||||
private void delWorkPlaceButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var res = selectedHistoryWorkTable();
|
||||
FuncDB.RabotnikDelete(res);
|
||||
resetHistoryWorkTable();
|
||||
}
|
||||
private void delTypeStajButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var res = selectedRabotnikStajTable();
|
||||
FuncDB.RabotnikTypeStajDelete(res);
|
||||
resetRabotnikStajTable();
|
||||
}
|
||||
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
126
MainForms/ChildrenForm.resx
Normal file
126
MainForms/ChildrenForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>364, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>472, 17</value>
|
||||
</metadata>
|
||||
</root>
|
269
MainForms/LearnForm.Designer.cs
generated
Normal file
269
MainForms/LearnForm.Designer.cs
generated
Normal file
@ -0,0 +1,269 @@
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
partial class LearnForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stajMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.learnMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.group = new System.Windows.Forms.GroupBox();
|
||||
this.learnGridView = new System.Windows.Forms.DataGridView();
|
||||
this.linkRabLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.addButton = new System.Windows.Forms.Button();
|
||||
this.changeButton = new System.Windows.Forms.Button();
|
||||
this.delButton = new System.Windows.Forms.Button();
|
||||
this.настройкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.group.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.learnGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.chelRodMI,
|
||||
this.rabitnikiMI,
|
||||
this.stajMI,
|
||||
this.learnMI,
|
||||
this.otpBolMI,
|
||||
this.детиToolStripMenuItem,
|
||||
this.настройкиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(918, 24);
|
||||
this.menuStrip.TabIndex = 30;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(78, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудник";
|
||||
//
|
||||
// stajMI
|
||||
//
|
||||
this.stajMI.Name = "stajMI";
|
||||
this.stajMI.Size = new System.Drawing.Size(47, 20);
|
||||
this.stajMI.Text = "Стаж";
|
||||
//
|
||||
// learnMI
|
||||
//
|
||||
this.learnMI.Name = "learnMI";
|
||||
this.learnMI.Size = new System.Drawing.Size(92, 20);
|
||||
this.learnMI.Text = "Образование";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(137, 17);
|
||||
this.errorLabel.Text = "Отображение ошибки";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 423);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(918, 22);
|
||||
this.statusStrip1.TabIndex = 37;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// group
|
||||
//
|
||||
this.group.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.group.Controls.Add(this.learnGridView);
|
||||
this.group.Location = new System.Drawing.Point(15, 56);
|
||||
this.group.Name = "group";
|
||||
this.group.Size = new System.Drawing.Size(891, 364);
|
||||
this.group.TabIndex = 39;
|
||||
this.group.TabStop = false;
|
||||
this.group.Text = "Образование";
|
||||
//
|
||||
// learnGridView
|
||||
//
|
||||
this.learnGridView.AllowUserToAddRows = false;
|
||||
this.learnGridView.AllowUserToDeleteRows = false;
|
||||
this.learnGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.learnGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.learnGridView.Location = new System.Drawing.Point(6, 19);
|
||||
this.learnGridView.MultiSelect = false;
|
||||
this.learnGridView.Name = "learnGridView";
|
||||
this.learnGridView.ReadOnly = true;
|
||||
this.learnGridView.RowHeadersVisible = false;
|
||||
this.learnGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.learnGridView.Size = new System.Drawing.Size(879, 339);
|
||||
this.learnGridView.TabIndex = 37;
|
||||
//
|
||||
// linkRabLabel
|
||||
//
|
||||
this.linkRabLabel.AutoSize = true;
|
||||
this.linkRabLabel.Location = new System.Drawing.Point(76, 32);
|
||||
this.linkRabLabel.Name = "linkRabLabel";
|
||||
this.linkRabLabel.Size = new System.Drawing.Size(121, 13);
|
||||
this.linkRabLabel.TabIndex = 41;
|
||||
this.linkRabLabel.TabStop = true;
|
||||
this.linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
this.linkRabLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkRabLabel_LinkClicked);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 32);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(63, 13);
|
||||
this.label2.TabIndex = 42;
|
||||
this.label2.Text = "Сотрудник:";
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.Location = new System.Drawing.Point(669, 27);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addButton.TabIndex = 43;
|
||||
this.addButton.Text = "Добавить";
|
||||
this.addButton.UseVisualStyleBackColor = true;
|
||||
this.addButton.Click += new System.EventHandler(this.addButton_Click);
|
||||
//
|
||||
// changeButton
|
||||
//
|
||||
this.changeButton.Location = new System.Drawing.Point(750, 27);
|
||||
this.changeButton.Name = "changeButton";
|
||||
this.changeButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.changeButton.TabIndex = 44;
|
||||
this.changeButton.Text = "Изменить";
|
||||
this.changeButton.UseVisualStyleBackColor = true;
|
||||
this.changeButton.Click += new System.EventHandler(this.changeButton_Click);
|
||||
//
|
||||
// delButton
|
||||
//
|
||||
this.delButton.Location = new System.Drawing.Point(831, 27);
|
||||
this.delButton.Name = "delButton";
|
||||
this.delButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delButton.TabIndex = 45;
|
||||
this.delButton.Text = "Удалить";
|
||||
this.delButton.UseVisualStyleBackColor = true;
|
||||
this.delButton.Click += new System.EventHandler(this.delButton_Click);
|
||||
//
|
||||
// настройкиToolStripMenuItem
|
||||
//
|
||||
this.настройкиToolStripMenuItem.Name = "настройкиToolStripMenuItem";
|
||||
this.настройкиToolStripMenuItem.Size = new System.Drawing.Size(79, 20);
|
||||
this.настройкиToolStripMenuItem.Text = "Настройки";
|
||||
//
|
||||
// LearnForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(918, 445);
|
||||
this.Controls.Add(this.delButton);
|
||||
this.Controls.Add(this.changeButton);
|
||||
this.Controls.Add(this.addButton);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.linkRabLabel);
|
||||
this.Controls.Add(this.group);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Name = "LearnForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Образование";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.group.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.learnGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem stajMI;
|
||||
private System.Windows.Forms.GroupBox group;
|
||||
private System.Windows.Forms.DataGridView learnGridView;
|
||||
private System.Windows.Forms.LinkLabel linkRabLabel;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button addButton;
|
||||
private System.Windows.Forms.Button changeButton;
|
||||
private System.Windows.Forms.Button delButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem learnMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem настройкиToolStripMenuItem;
|
||||
}
|
||||
}
|
165
MainForms/LearnForm.cs
Normal file
165
MainForms/LearnForm.cs
Normal file
@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public partial class LearnForm : Form
|
||||
{
|
||||
private readonly ColumnConf[] tableMainColumns = {
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Название обр. учр.", size: 140, warp: true),
|
||||
new ColumnConf(name: "Уровень", size: 140),
|
||||
new ColumnConf(name: "Специальность", size: 140),
|
||||
new ColumnConf(name: "Дата окончания", size: 80),
|
||||
new ColumnConf(name: "Курсы", size: 140, warp: true),
|
||||
new ColumnConf(name: "Проф. переподготовка", size: 140, warp: true)
|
||||
};
|
||||
|
||||
private Rabotnik rabotnik = null;
|
||||
private void linkRabLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var form = new RabForm(true);
|
||||
form.ShowDialog();
|
||||
if (form.isCanceled)
|
||||
rabotnik = null;
|
||||
else
|
||||
rabotnik = form.formResult;
|
||||
ResetLinkRabotnik();
|
||||
resetLearnTable();
|
||||
}
|
||||
private void ResetLinkRabotnik()
|
||||
{
|
||||
if (rabotnik == null)
|
||||
{
|
||||
linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
return;
|
||||
}
|
||||
var chel = FuncDB.ChelGetById(rabotnik.ChelId);
|
||||
if (chel == null)
|
||||
{
|
||||
linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
return;
|
||||
}
|
||||
var res = chel.FName.ToString() + " " +
|
||||
chel.SName[0].ToString() + "." +
|
||||
((!string.IsNullOrEmpty(chel.TName)) ?
|
||||
chel.TName[0].ToString() + "." : "");
|
||||
linkRabLabel.Text = res;
|
||||
}
|
||||
|
||||
private void resetLearnTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = rabotnik == null ? Array.Empty<string[]>() : FuncDB.LearnListTableMain(rabotnik.ChelId);
|
||||
this.ResetTable(
|
||||
learnGridView,
|
||||
tableMainColumns,
|
||||
res
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private Learn selectedLearnTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (learnGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Образование не выбрано.");
|
||||
if (int.TryParse((string)learnGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.LearnGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public LearnForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.correctUpperMenu(menuStrip, 4);
|
||||
ResetLinkRabotnik();
|
||||
resetLearnTable();
|
||||
|
||||
linkRabLabel.Enabled =
|
||||
addButton.Enabled =
|
||||
changeButton.Enabled =
|
||||
delButton.Enabled = false;
|
||||
|
||||
var user = this.GetUser();
|
||||
if (user == null)
|
||||
return;
|
||||
linkRabLabel.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 4, 0) != null;
|
||||
delButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 4, 1) != null;
|
||||
changeButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 4, 2) != null;
|
||||
addButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 4, 3) != null;
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (rabotnik == null)
|
||||
throw new Exception("Не выбран сотрудник.");
|
||||
var form = new SupportForms.LearnForm(chelId: rabotnik.ChelId);
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
{
|
||||
resetLearnTable();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void changeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var form = new SupportForms.LearnForm(selectedLearnTable());
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetLearnTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void delButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
FuncDB.LearnDelete(selectedLearnTable());
|
||||
resetLearnTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
126
MainForms/LearnForm.resx
Normal file
126
MainForms/LearnForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>364, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>472, 17</value>
|
||||
</metadata>
|
||||
</root>
|
151
MainForms/LoginForm.Designer.cs
generated
Normal file
151
MainForms/LoginForm.Designer.cs
generated
Normal file
@ -0,0 +1,151 @@
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
partial class LoginForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.workButton = new System.Windows.Forms.Button();
|
||||
this.canceledButton = new System.Windows.Forms.Button();
|
||||
this.loginBox = new System.Windows.Forms.ComboBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 98);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(332, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(57, 17);
|
||||
this.errorLabel.Text = "Ошибка.";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(245, 65);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 9;
|
||||
this.workButton.Text = "Войти";
|
||||
this.workButton.UseVisualStyleBackColor = true;
|
||||
this.workButton.Click += new System.EventHandler(this.workButton_Click);
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(164, 65);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 10;
|
||||
this.canceledButton.Text = "Отмена";
|
||||
this.canceledButton.UseVisualStyleBackColor = true;
|
||||
this.canceledButton.Click += new System.EventHandler(this.canceledButton_Click);
|
||||
//
|
||||
// loginBox
|
||||
//
|
||||
this.loginBox.FormattingEnabled = true;
|
||||
this.loginBox.Location = new System.Drawing.Point(66, 12);
|
||||
this.loginBox.Name = "loginBox";
|
||||
this.loginBox.Size = new System.Drawing.Size(254, 21);
|
||||
this.loginBox.TabIndex = 11;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(66, 39);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(254, 20);
|
||||
this.textBox1.TabIndex = 12;
|
||||
this.textBox1.UseSystemPasswordChar = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(19, 15);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(41, 13);
|
||||
this.label1.TabIndex = 13;
|
||||
this.label1.Text = "Логин:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 42);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(48, 13);
|
||||
this.label2.TabIndex = 14;
|
||||
this.label2.Text = "Пароль:";
|
||||
//
|
||||
// LoginForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(332, 120);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.loginBox);
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "LoginForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Вход";
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.Button workButton;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
private System.Windows.Forms.ComboBox loginBox;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
}
|
||||
}
|
64
MainForms/LoginForm.cs
Normal file
64
MainForms/LoginForm.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public partial class LoginForm : Form
|
||||
{
|
||||
public bool isCanceled = false;
|
||||
public LoginForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
try
|
||||
{
|
||||
loginBox.Items.Clear();
|
||||
var userList = FuncDB.UserList();
|
||||
foreach (var usr in userList)
|
||||
loginBox.Items.Add(usr.Login);
|
||||
if (loginBox.Items.Count > 0)
|
||||
loginBox.SelectedIndex = 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
workButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void workButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var _user = FuncDB.UserGetByLogin((string)loginBox.Text);
|
||||
if (_user == null)
|
||||
throw new Exception("Пользователя не существует.");
|
||||
if (_user.Pass != textBox1.Text)
|
||||
throw new Exception("Не верный пароль.");
|
||||
byte[] pass_bytes = Encoding.ASCII.GetBytes(textBox1.Text);
|
||||
var pass_hash_bytes = new MD5CryptoServiceProvider().ComputeHash(pass_bytes);
|
||||
_user.Pass = Encoding.ASCII.GetString(pass_hash_bytes);
|
||||
this.SetUser(_user);
|
||||
this.SetNextForm(_user.Default);
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
isCanceled = true;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
466
MainForms/OtpForm.Designer.cs
generated
466
MainForms/OtpForm.Designer.cs
generated
@ -1,40 +1,442 @@
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
partial class OtpForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
partial class OtpForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "OtpForm";
|
||||
}
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stajMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.learnMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.group = new System.Windows.Forms.GroupBox();
|
||||
this.freeGridView = new System.Windows.Forms.DataGridView();
|
||||
this.linkRabLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.addButton = new System.Windows.Forms.Button();
|
||||
this.changeButton = new System.Windows.Forms.Button();
|
||||
this.delButton = new System.Windows.Forms.Button();
|
||||
this.groupBox = new System.Windows.Forms.GroupBox();
|
||||
this.otherDaysLabel = new System.Windows.Forms.Label();
|
||||
this.bolDaysLabel = new System.Windows.Forms.Label();
|
||||
this.otpDaysLabel = new System.Windows.Forms.Label();
|
||||
this.totalDaysLabel = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
|
||||
this.updateButton = new System.Windows.Forms.Button();
|
||||
this.настройкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.group.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.freeGridView)).BeginInit();
|
||||
this.groupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.chelRodMI,
|
||||
this.rabitnikiMI,
|
||||
this.stajMI,
|
||||
this.learnMI,
|
||||
this.otpBolMI,
|
||||
this.детиToolStripMenuItem,
|
||||
this.настройкиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(918, 24);
|
||||
this.menuStrip.TabIndex = 30;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(85, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудники";
|
||||
//
|
||||
// stajMI
|
||||
//
|
||||
this.stajMI.Name = "stajMI";
|
||||
this.stajMI.Size = new System.Drawing.Size(47, 20);
|
||||
this.stajMI.Text = "Стаж";
|
||||
//
|
||||
// learnMI
|
||||
//
|
||||
this.learnMI.Name = "learnMI";
|
||||
this.learnMI.Size = new System.Drawing.Size(92, 20);
|
||||
this.learnMI.Text = "Образование";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(137, 17);
|
||||
this.errorLabel.Text = "Отображение ошибки";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 462);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(918, 22);
|
||||
this.statusStrip1.TabIndex = 37;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// group
|
||||
//
|
||||
this.group.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.group.Controls.Add(this.freeGridView);
|
||||
this.group.Location = new System.Drawing.Point(15, 82);
|
||||
this.group.Name = "group";
|
||||
this.group.Size = new System.Drawing.Size(478, 377);
|
||||
this.group.TabIndex = 39;
|
||||
this.group.TabStop = false;
|
||||
this.group.Text = "Образование";
|
||||
//
|
||||
// freeGridView
|
||||
//
|
||||
this.freeGridView.AllowUserToAddRows = false;
|
||||
this.freeGridView.AllowUserToDeleteRows = false;
|
||||
this.freeGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.freeGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.freeGridView.Location = new System.Drawing.Point(6, 19);
|
||||
this.freeGridView.MultiSelect = false;
|
||||
this.freeGridView.Name = "freeGridView";
|
||||
this.freeGridView.ReadOnly = true;
|
||||
this.freeGridView.RowHeadersVisible = false;
|
||||
this.freeGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.freeGridView.Size = new System.Drawing.Size(466, 352);
|
||||
this.freeGridView.TabIndex = 37;
|
||||
//
|
||||
// linkRabLabel
|
||||
//
|
||||
this.linkRabLabel.AutoSize = true;
|
||||
this.linkRabLabel.Location = new System.Drawing.Point(76, 32);
|
||||
this.linkRabLabel.Name = "linkRabLabel";
|
||||
this.linkRabLabel.Size = new System.Drawing.Size(121, 13);
|
||||
this.linkRabLabel.TabIndex = 41;
|
||||
this.linkRabLabel.TabStop = true;
|
||||
this.linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
this.linkRabLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkRabLabel_LinkClicked);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 32);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(63, 13);
|
||||
this.label2.TabIndex = 42;
|
||||
this.label2.Text = "Сотрудник:";
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addButton.Location = new System.Drawing.Point(669, 27);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addButton.TabIndex = 43;
|
||||
this.addButton.Text = "Добавить";
|
||||
this.addButton.UseVisualStyleBackColor = true;
|
||||
this.addButton.Click += new System.EventHandler(this.addButton_Click);
|
||||
//
|
||||
// changeButton
|
||||
//
|
||||
this.changeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.changeButton.Location = new System.Drawing.Point(750, 27);
|
||||
this.changeButton.Name = "changeButton";
|
||||
this.changeButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.changeButton.TabIndex = 44;
|
||||
this.changeButton.Text = "Изменить";
|
||||
this.changeButton.UseVisualStyleBackColor = true;
|
||||
this.changeButton.Click += new System.EventHandler(this.changeButton_Click);
|
||||
//
|
||||
// delButton
|
||||
//
|
||||
this.delButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.delButton.Location = new System.Drawing.Point(831, 27);
|
||||
this.delButton.Name = "delButton";
|
||||
this.delButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delButton.TabIndex = 45;
|
||||
this.delButton.Text = "Удалить";
|
||||
this.delButton.UseVisualStyleBackColor = true;
|
||||
this.delButton.Click += new System.EventHandler(this.delButton_Click);
|
||||
//
|
||||
// groupBox
|
||||
//
|
||||
this.groupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox.Controls.Add(this.otherDaysLabel);
|
||||
this.groupBox.Controls.Add(this.bolDaysLabel);
|
||||
this.groupBox.Controls.Add(this.otpDaysLabel);
|
||||
this.groupBox.Controls.Add(this.totalDaysLabel);
|
||||
this.groupBox.Controls.Add(this.label7);
|
||||
this.groupBox.Controls.Add(this.label6);
|
||||
this.groupBox.Controls.Add(this.label5);
|
||||
this.groupBox.Controls.Add(this.label4);
|
||||
this.groupBox.Location = new System.Drawing.Point(499, 82);
|
||||
this.groupBox.Name = "groupBox";
|
||||
this.groupBox.Size = new System.Drawing.Size(407, 371);
|
||||
this.groupBox.TabIndex = 46;
|
||||
this.groupBox.TabStop = false;
|
||||
this.groupBox.Text = "Расчет";
|
||||
//
|
||||
// otherDaysLabel
|
||||
//
|
||||
this.otherDaysLabel.AutoSize = true;
|
||||
this.otherDaysLabel.Location = new System.Drawing.Point(120, 100);
|
||||
this.otherDaysLabel.Name = "otherDaysLabel";
|
||||
this.otherDaysLabel.Size = new System.Drawing.Size(81, 13);
|
||||
this.otherDaysLabel.TabIndex = 23;
|
||||
this.otherDaysLabel.Text = "otherDaysLabel";
|
||||
//
|
||||
// bolDaysLabel
|
||||
//
|
||||
this.bolDaysLabel.AutoSize = true;
|
||||
this.bolDaysLabel.Location = new System.Drawing.Point(120, 74);
|
||||
this.bolDaysLabel.Name = "bolDaysLabel";
|
||||
this.bolDaysLabel.Size = new System.Drawing.Size(71, 13);
|
||||
this.bolDaysLabel.TabIndex = 22;
|
||||
this.bolDaysLabel.Text = "bolDaysLabel";
|
||||
//
|
||||
// otpDaysLabel
|
||||
//
|
||||
this.otpDaysLabel.AutoSize = true;
|
||||
this.otpDaysLabel.Location = new System.Drawing.Point(120, 48);
|
||||
this.otpDaysLabel.Name = "otpDaysLabel";
|
||||
this.otpDaysLabel.Size = new System.Drawing.Size(72, 13);
|
||||
this.otpDaysLabel.TabIndex = 21;
|
||||
this.otpDaysLabel.Text = "otpDaysLabel";
|
||||
//
|
||||
// totalDaysLabel
|
||||
//
|
||||
this.totalDaysLabel.AutoSize = true;
|
||||
this.totalDaysLabel.Location = new System.Drawing.Point(120, 22);
|
||||
this.totalDaysLabel.Name = "totalDaysLabel";
|
||||
this.totalDaysLabel.Size = new System.Drawing.Size(77, 13);
|
||||
this.totalDaysLabel.TabIndex = 20;
|
||||
this.totalDaysLabel.Text = "totalDaysLabel";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(78, 100);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(36, 13);
|
||||
this.label7.TabIndex = 17;
|
||||
this.label7.Text = "Иное:";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(42, 74);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(72, 13);
|
||||
this.label6.TabIndex = 16;
|
||||
this.label6.Text = "Больничный:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(68, 48);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(46, 13);
|
||||
this.label5.TabIndex = 15;
|
||||
this.label5.Text = "Отпуск:";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(6, 22);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(108, 13);
|
||||
this.label4.TabIndex = 14;
|
||||
this.label4.Text = "Общее кол-во дней:";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 59);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(74, 13);
|
||||
this.label1.TabIndex = 12;
|
||||
this.label1.Text = "Дата начала:";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(245, 59);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(69, 13);
|
||||
this.label3.TabIndex = 13;
|
||||
this.label3.Text = "Дата конца:";
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(92, 56);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(147, 20);
|
||||
this.dateTimePicker1.TabIndex = 18;
|
||||
//
|
||||
// dateTimePicker2
|
||||
//
|
||||
this.dateTimePicker2.Location = new System.Drawing.Point(320, 56);
|
||||
this.dateTimePicker2.Name = "dateTimePicker2";
|
||||
this.dateTimePicker2.Size = new System.Drawing.Size(147, 20);
|
||||
this.dateTimePicker2.TabIndex = 19;
|
||||
//
|
||||
// updateButton
|
||||
//
|
||||
this.updateButton.Location = new System.Drawing.Point(473, 54);
|
||||
this.updateButton.Name = "updateButton";
|
||||
this.updateButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.updateButton.TabIndex = 47;
|
||||
this.updateButton.Text = "Обновить";
|
||||
this.updateButton.UseVisualStyleBackColor = true;
|
||||
this.updateButton.Click += new System.EventHandler(this.updateButton_Click);
|
||||
//
|
||||
// настройкиToolStripMenuItem
|
||||
//
|
||||
this.настройкиToolStripMenuItem.Name = "настройкиToolStripMenuItem";
|
||||
this.настройкиToolStripMenuItem.Size = new System.Drawing.Size(79, 20);
|
||||
this.настройкиToolStripMenuItem.Text = "Настройки";
|
||||
//
|
||||
// OtpForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(918, 484);
|
||||
this.Controls.Add(this.updateButton);
|
||||
this.Controls.Add(this.groupBox);
|
||||
this.Controls.Add(this.delButton);
|
||||
this.Controls.Add(this.changeButton);
|
||||
this.Controls.Add(this.dateTimePicker2);
|
||||
this.Controls.Add(this.addButton);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.linkRabLabel);
|
||||
this.Controls.Add(this.group);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "OtpForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Отпуск/Больничный";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.group.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.freeGridView)).EndInit();
|
||||
this.groupBox.ResumeLayout(false);
|
||||
this.groupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem stajMI;
|
||||
private System.Windows.Forms.GroupBox group;
|
||||
private System.Windows.Forms.DataGridView freeGridView;
|
||||
private System.Windows.Forms.LinkLabel linkRabLabel;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button addButton;
|
||||
private System.Windows.Forms.Button changeButton;
|
||||
private System.Windows.Forms.Button delButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem learnMI;
|
||||
private System.Windows.Forms.GroupBox groupBox;
|
||||
private System.Windows.Forms.Label otherDaysLabel;
|
||||
private System.Windows.Forms.Label bolDaysLabel;
|
||||
private System.Windows.Forms.Label otpDaysLabel;
|
||||
private System.Windows.Forms.Label totalDaysLabel;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker2;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button updateButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem настройкиToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -7,14 +7,201 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public partial class OtpForm : Form
|
||||
{
|
||||
private readonly ColumnConf[] tableMainColumns = {
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Тип", size: 140, warp: true),
|
||||
new ColumnConf(name: "Дата начала", size: 80),
|
||||
new ColumnConf(name: "Дата конца", size: 80),
|
||||
new ColumnConf(name: "Общее кол-во дней", size: 100)
|
||||
};
|
||||
|
||||
private Rabotnik rabotnik = null;
|
||||
private void linkRabLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var form = new RabForm(true);
|
||||
form.ShowDialog();
|
||||
if (form.isCanceled)
|
||||
rabotnik = null;
|
||||
else
|
||||
rabotnik = form.formResult;
|
||||
ResetLinkRabotnik();
|
||||
resetFreeTable();
|
||||
resetFreeDays();
|
||||
}
|
||||
private void ResetLinkRabotnik()
|
||||
{
|
||||
if (rabotnik == null)
|
||||
{
|
||||
linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
return;
|
||||
}
|
||||
var chel = FuncDB.ChelGetById(rabotnik.ChelId);
|
||||
if (chel == null)
|
||||
{
|
||||
linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
return;
|
||||
}
|
||||
var res = chel.FName.ToString() + " " +
|
||||
chel.SName[0].ToString() + "." +
|
||||
((!string.IsNullOrEmpty(chel.TName)) ?
|
||||
chel.TName[0].ToString() + "." : "");
|
||||
linkRabLabel.Text = res;
|
||||
}
|
||||
|
||||
private void resetFreeTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = rabotnik == null ? Array.Empty<string[]>() : FuncDB.FreeListTable(rabotnik.ChelId, dateTimePicker1.Value, dateTimePicker2.Value);
|
||||
this.ResetTable(
|
||||
freeGridView,
|
||||
tableMainColumns,
|
||||
res
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private void resetFreeDays()
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = rabotnik == null ? new Dictionary<string, int>() : FuncDB.FreeListDays(rabotnik.ChelId, dateTimePicker1.Value, dateTimePicker2.Value);
|
||||
if (res.ContainsKey("Общее"))
|
||||
totalDaysLabel.Text = res["Общее"].ToString();
|
||||
else
|
||||
totalDaysLabel.Text = "0";
|
||||
if (res.ContainsKey("Отпуск"))
|
||||
otpDaysLabel.Text = res["Отпуск"].ToString();
|
||||
else
|
||||
otpDaysLabel.Text = "0";
|
||||
if (res.ContainsKey("Больничный"))
|
||||
bolDaysLabel.Text = res["Больничный"].ToString();
|
||||
else
|
||||
bolDaysLabel.Text = "0";
|
||||
if (res.ContainsKey("Иное"))
|
||||
otherDaysLabel.Text = res["Иное"].ToString();
|
||||
else
|
||||
otherDaysLabel.Text = "0";
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private Free selectedFreeTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (freeGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Отстранение не выбрано.");
|
||||
if (int.TryParse((string)freeGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.FreeGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public OtpForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.correctUpperMenu(menuStrip, 5);
|
||||
DateTime d = DateTime.Now;
|
||||
dateTimePicker1.Value = new DateTime(d.Year, 1, 1, 0, 0, 0);
|
||||
dateTimePicker2.Value = new DateTime(d.Year + 1, 1, 1, 0, 0, 0);
|
||||
ResetLinkRabotnik();
|
||||
resetFreeTable();
|
||||
resetFreeDays();
|
||||
|
||||
linkRabLabel.Enabled =
|
||||
addButton.Enabled =
|
||||
changeButton.Enabled =
|
||||
delButton.Enabled = false;
|
||||
|
||||
var user = this.GetUser();
|
||||
if (user == null)
|
||||
return;
|
||||
linkRabLabel.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 5, 0) != null;
|
||||
delButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 5, 1) != null;
|
||||
changeButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 5, 2) != null;
|
||||
addButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 5, 3) != null;
|
||||
}
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (rabotnik == null)
|
||||
throw new Exception("Не выбран сотрудник.");
|
||||
var form = new SupportForms.OptForm(chelId: rabotnik.ChelId);
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
{
|
||||
resetFreeTable();
|
||||
resetFreeDays();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void changeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var form = new SupportForms.OptForm(selectedFreeTable());
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
{
|
||||
resetFreeTable();
|
||||
resetFreeDays();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void delButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
FuncDB.FreeDelete(selectedFreeTable());
|
||||
resetFreeTable();
|
||||
resetFreeDays();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
|
||||
private void updateButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetFreeTable();
|
||||
resetFreeDays();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
126
MainForms/OtpForm.resx
Normal file
126
MainForms/OtpForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>364, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>472, 17</value>
|
||||
</metadata>
|
||||
</root>
|
398
MainForms/RabForm.Designer.cs
generated
398
MainForms/RabForm.Designer.cs
generated
@ -29,12 +29,398 @@ namespace Diplom_O
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "RabForm";
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stajMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.learnMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.workerGridView = new System.Windows.Forms.DataGridView();
|
||||
this.addWorkerButton = new System.Windows.Forms.Button();
|
||||
this.dropFindButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.findBox = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.addWorkPlaceButton = new System.Windows.Forms.Button();
|
||||
this.historyWorkGridView = new System.Windows.Forms.DataGridView();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.stajGridView = new System.Windows.Forms.DataGridView();
|
||||
this.addTypeStajButton = new System.Windows.Forms.Button();
|
||||
this.delTypeStajButton = new System.Windows.Forms.Button();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.changeWorkPlaceButton = new System.Windows.Forms.Button();
|
||||
this.delWorkPlaceButton = new System.Windows.Forms.Button();
|
||||
this.fioLabel = new System.Windows.Forms.Label();
|
||||
this.selectButton = new System.Windows.Forms.Button();
|
||||
this.настройкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.workerGridView)).BeginInit();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.historyWorkGridView)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.stajGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.chelRodMI,
|
||||
this.rabitnikiMI,
|
||||
this.stajMI,
|
||||
this.learnMI,
|
||||
this.otpBolMI,
|
||||
this.детиToolStripMenuItem,
|
||||
this.настройкиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(983, 24);
|
||||
this.menuStrip.TabIndex = 30;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(85, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудники";
|
||||
//
|
||||
// stajMI
|
||||
//
|
||||
this.stajMI.Name = "stajMI";
|
||||
this.stajMI.Size = new System.Drawing.Size(47, 20);
|
||||
this.stajMI.Text = "Стаж";
|
||||
//
|
||||
// learnMI
|
||||
//
|
||||
this.learnMI.Name = "learnMI";
|
||||
this.learnMI.Size = new System.Drawing.Size(92, 20);
|
||||
this.learnMI.Text = "Образование";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(137, 17);
|
||||
this.errorLabel.Text = "Отображение ошибки";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// workerGridView
|
||||
//
|
||||
this.workerGridView.AllowUserToAddRows = false;
|
||||
this.workerGridView.AllowUserToDeleteRows = false;
|
||||
this.workerGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.workerGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.workerGridView.Location = new System.Drawing.Point(12, 56);
|
||||
this.workerGridView.MultiSelect = false;
|
||||
this.workerGridView.Name = "workerGridView";
|
||||
this.workerGridView.ReadOnly = true;
|
||||
this.workerGridView.RowHeadersVisible = false;
|
||||
this.workerGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.workerGridView.Size = new System.Drawing.Size(459, 694);
|
||||
this.workerGridView.TabIndex = 36;
|
||||
this.workerGridView.SelectionChanged += new System.EventHandler(this.workerGridView_SelectionChanged);
|
||||
//
|
||||
// addWorkerButton
|
||||
//
|
||||
this.addWorkerButton.Location = new System.Drawing.Point(396, 27);
|
||||
this.addWorkerButton.Name = "addWorkerButton";
|
||||
this.addWorkerButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addWorkerButton.TabIndex = 29;
|
||||
this.addWorkerButton.Text = "Добавить";
|
||||
this.addWorkerButton.UseVisualStyleBackColor = true;
|
||||
this.addWorkerButton.Click += new System.EventHandler(this.addWorkerButton_Click);
|
||||
//
|
||||
// dropFindButton
|
||||
//
|
||||
this.dropFindButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.dropFindButton.Location = new System.Drawing.Point(396, 756);
|
||||
this.dropFindButton.Name = "dropFindButton";
|
||||
this.dropFindButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.dropFindButton.TabIndex = 35;
|
||||
this.dropFindButton.Text = "Сбросить";
|
||||
this.dropFindButton.UseVisualStyleBackColor = true;
|
||||
this.dropFindButton.TextChanged += new System.EventHandler(this.dropFindButton_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 761);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(39, 13);
|
||||
this.label1.TabIndex = 38;
|
||||
this.label1.Text = "Поиск";
|
||||
//
|
||||
// findBox
|
||||
//
|
||||
this.findBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.findBox.Location = new System.Drawing.Point(57, 758);
|
||||
this.findBox.Name = "findBox";
|
||||
this.findBox.Size = new System.Drawing.Size(333, 20);
|
||||
this.findBox.TabIndex = 34;
|
||||
this.findBox.TextChanged += new System.EventHandler(this.findBox_TextChanged);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 782);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(983, 22);
|
||||
this.statusStrip1.TabIndex = 37;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox1.Controls.Add(this.addWorkPlaceButton);
|
||||
this.groupBox1.Controls.Add(this.historyWorkGridView);
|
||||
this.groupBox1.Controls.Add(this.groupBox2);
|
||||
this.groupBox1.Controls.Add(this.changeWorkPlaceButton);
|
||||
this.groupBox1.Controls.Add(this.delWorkPlaceButton);
|
||||
this.groupBox1.Controls.Add(this.fioLabel);
|
||||
this.groupBox1.Location = new System.Drawing.Point(477, 31);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(494, 747);
|
||||
this.groupBox1.TabIndex = 39;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "История";
|
||||
//
|
||||
// addWorkPlaceButton
|
||||
//
|
||||
this.addWorkPlaceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addWorkPlaceButton.Location = new System.Drawing.Point(251, 19);
|
||||
this.addWorkPlaceButton.Name = "addWorkPlaceButton";
|
||||
this.addWorkPlaceButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addWorkPlaceButton.TabIndex = 43;
|
||||
this.addWorkPlaceButton.Text = "Добавить";
|
||||
this.addWorkPlaceButton.UseVisualStyleBackColor = true;
|
||||
this.addWorkPlaceButton.Click += new System.EventHandler(this.addWorkPlaceButton_Click);
|
||||
//
|
||||
// historyWorkGridView
|
||||
//
|
||||
this.historyWorkGridView.AllowUserToAddRows = false;
|
||||
this.historyWorkGridView.AllowUserToDeleteRows = false;
|
||||
this.historyWorkGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.historyWorkGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.historyWorkGridView.Location = new System.Drawing.Point(9, 48);
|
||||
this.historyWorkGridView.MultiSelect = false;
|
||||
this.historyWorkGridView.Name = "historyWorkGridView";
|
||||
this.historyWorkGridView.ReadOnly = true;
|
||||
this.historyWorkGridView.RowHeadersVisible = false;
|
||||
this.historyWorkGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.historyWorkGridView.Size = new System.Drawing.Size(479, 332);
|
||||
this.historyWorkGridView.TabIndex = 42;
|
||||
this.historyWorkGridView.SelectionChanged += new System.EventHandler(this.historyWorkGridView_SelectionChanged);
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox2.Controls.Add(this.stajGridView);
|
||||
this.groupBox2.Controls.Add(this.addTypeStajButton);
|
||||
this.groupBox2.Controls.Add(this.delTypeStajButton);
|
||||
this.groupBox2.Controls.Add(this.comboBox1);
|
||||
this.groupBox2.Location = new System.Drawing.Point(9, 386);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(479, 355);
|
||||
this.groupBox2.TabIndex = 41;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Типы стажа";
|
||||
//
|
||||
// stajGridView
|
||||
//
|
||||
this.stajGridView.AllowUserToAddRows = false;
|
||||
this.stajGridView.AllowUserToDeleteRows = false;
|
||||
this.stajGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.stajGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.stajGridView.Location = new System.Drawing.Point(6, 48);
|
||||
this.stajGridView.MultiSelect = false;
|
||||
this.stajGridView.Name = "stajGridView";
|
||||
this.stajGridView.ReadOnly = true;
|
||||
this.stajGridView.RowHeadersVisible = false;
|
||||
this.stajGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.stajGridView.Size = new System.Drawing.Size(467, 301);
|
||||
this.stajGridView.TabIndex = 37;
|
||||
//
|
||||
// addTypeStajButton
|
||||
//
|
||||
this.addTypeStajButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addTypeStajButton.Location = new System.Drawing.Point(317, 19);
|
||||
this.addTypeStajButton.Name = "addTypeStajButton";
|
||||
this.addTypeStajButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addTypeStajButton.TabIndex = 2;
|
||||
this.addTypeStajButton.Text = "Добавить";
|
||||
this.addTypeStajButton.UseVisualStyleBackColor = true;
|
||||
this.addTypeStajButton.Click += new System.EventHandler(this.addTypeStajButton_Click);
|
||||
//
|
||||
// delTypeStajButton
|
||||
//
|
||||
this.delTypeStajButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.delTypeStajButton.Location = new System.Drawing.Point(398, 19);
|
||||
this.delTypeStajButton.Name = "delTypeStajButton";
|
||||
this.delTypeStajButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delTypeStajButton.TabIndex = 1;
|
||||
this.delTypeStajButton.Text = "Удалить";
|
||||
this.delTypeStajButton.UseVisualStyleBackColor = true;
|
||||
this.delTypeStajButton.Click += new System.EventHandler(this.delTypeStajButton_Click);
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(6, 21);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(305, 21);
|
||||
this.comboBox1.TabIndex = 0;
|
||||
//
|
||||
// changeWorkPlaceButton
|
||||
//
|
||||
this.changeWorkPlaceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.changeWorkPlaceButton.Location = new System.Drawing.Point(332, 19);
|
||||
this.changeWorkPlaceButton.Name = "changeWorkPlaceButton";
|
||||
this.changeWorkPlaceButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.changeWorkPlaceButton.TabIndex = 3;
|
||||
this.changeWorkPlaceButton.Text = "Изменить";
|
||||
this.changeWorkPlaceButton.UseVisualStyleBackColor = true;
|
||||
this.changeWorkPlaceButton.Click += new System.EventHandler(this.changeWorkPlaceButton_Click);
|
||||
//
|
||||
// delWorkPlaceButton
|
||||
//
|
||||
this.delWorkPlaceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.delWorkPlaceButton.Location = new System.Drawing.Point(413, 19);
|
||||
this.delWorkPlaceButton.Name = "delWorkPlaceButton";
|
||||
this.delWorkPlaceButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delWorkPlaceButton.TabIndex = 1;
|
||||
this.delWorkPlaceButton.Text = "Удалить";
|
||||
this.delWorkPlaceButton.UseVisualStyleBackColor = true;
|
||||
this.delWorkPlaceButton.Click += new System.EventHandler(this.delWorkPlaceButton_Click);
|
||||
//
|
||||
// fioLabel
|
||||
//
|
||||
this.fioLabel.AutoSize = true;
|
||||
this.fioLabel.Location = new System.Drawing.Point(6, 24);
|
||||
this.fioLabel.Name = "fioLabel";
|
||||
this.fioLabel.Size = new System.Drawing.Size(114, 13);
|
||||
this.fioLabel.TabIndex = 0;
|
||||
this.fioLabel.Text = "Таб№ Фамилия И.О.";
|
||||
//
|
||||
// selectButton
|
||||
//
|
||||
this.selectButton.Location = new System.Drawing.Point(315, 27);
|
||||
this.selectButton.Name = "selectButton";
|
||||
this.selectButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.selectButton.TabIndex = 40;
|
||||
this.selectButton.Text = "Выбрать";
|
||||
this.selectButton.UseVisualStyleBackColor = true;
|
||||
this.selectButton.Click += new System.EventHandler(this.selectButton_Click);
|
||||
//
|
||||
// настройкиToolStripMenuItem
|
||||
//
|
||||
this.настройкиToolStripMenuItem.Name = "настройкиToolStripMenuItem";
|
||||
this.настройкиToolStripMenuItem.Size = new System.Drawing.Size(79, 20);
|
||||
this.настройкиToolStripMenuItem.Text = "Настройки";
|
||||
//
|
||||
// RabForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(983, 804);
|
||||
this.Controls.Add(this.selectButton);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Controls.Add(this.workerGridView);
|
||||
this.Controls.Add(this.addWorkerButton);
|
||||
this.Controls.Add(this.dropFindButton);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.findBox);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Name = "RabForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Сотрудники";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.workerGridView)).EndInit();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.historyWorkGridView)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.stajGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.DataGridView workerGridView;
|
||||
private System.Windows.Forms.Button addWorkerButton;
|
||||
private System.Windows.Forms.Button dropFindButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox findBox;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.Button changeWorkPlaceButton;
|
||||
private System.Windows.Forms.Button delWorkPlaceButton;
|
||||
private System.Windows.Forms.Label fioLabel;
|
||||
private System.Windows.Forms.DataGridView historyWorkGridView;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.DataGridView stajGridView;
|
||||
private System.Windows.Forms.Button addTypeStajButton;
|
||||
private System.Windows.Forms.Button delTypeStajButton;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.Button addWorkPlaceButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem stajMI;
|
||||
private System.Windows.Forms.Button selectButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem learnMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem настройкиToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -7,14 +7,286 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public partial class RabForm : Form
|
||||
{
|
||||
public RabForm()
|
||||
private readonly ColumnConf[] tableMainColumns = {
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Таб. №", size: 80),
|
||||
new ColumnConf(name: "Фамилия И.О.", size: 140),
|
||||
new ColumnConf(name: "Должность", size: 140)
|
||||
};
|
||||
private readonly ColumnConf[] tableHistoryColumns =
|
||||
{
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Таб. №", size: 80),
|
||||
new ColumnConf(name: "Должность", size: 140),
|
||||
new ColumnConf(name: "Дата начала", size: 80),
|
||||
new ColumnConf(name: "Дата конца", size: 80)
|
||||
};
|
||||
private readonly ColumnConf[] tableStajColumns =
|
||||
{
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Тип стажа", size: 120),
|
||||
};
|
||||
|
||||
private void resetRabotnikTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var rab = FuncDB.RabotnikTableMain(findBox.Text);
|
||||
var res = new List<string[]>();
|
||||
foreach (var r in rab)
|
||||
{
|
||||
bool flag_add = false;
|
||||
foreach (var a in r)
|
||||
if (a.Contains(findBox.Text) && !flag_add)
|
||||
{
|
||||
res.Add(r);
|
||||
flag_add = true;
|
||||
}
|
||||
}
|
||||
this.ResetTable(
|
||||
workerGridView,
|
||||
tableMainColumns,
|
||||
res.ToArray()
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private Rabotnik selectedRabotnikTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (workerGridView.RowCount == 0)
|
||||
return null;
|
||||
if (workerGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Человек не выбран.");
|
||||
if (int.TryParse((string)workerGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.RabotnikGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private void workerGridView_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
resetHistoryWorkTable();
|
||||
}
|
||||
|
||||
private void resetHistoryWorkTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var rabotnik = selectedRabotnikTable();
|
||||
var res = (rabotnik == null) ? Array.Empty<string[]>() : FuncDB.RabotnikByChelIdTable(rabotnik.ChelId);
|
||||
this.ResetTable(
|
||||
historyWorkGridView,
|
||||
tableHistoryColumns,
|
||||
res
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private Rabotnik selectedHistoryWorkTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (historyWorkGridView.RowCount == 0)
|
||||
return null;
|
||||
if (historyWorkGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Человек не выбран.");
|
||||
if (int.TryParse((string)historyWorkGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.RabotnikGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private void historyWorkGridView_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
resetRabotnikStajTable();
|
||||
}
|
||||
|
||||
private void resetRabotnikStajTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var rabotnik = selectedHistoryWorkTable();
|
||||
var res = (rabotnik == null) ? Array.Empty<string[]>() :
|
||||
FuncDB.RabotnikTypeStajListString(rabotnik.Id);
|
||||
this.ResetTable(
|
||||
stajGridView,
|
||||
tableStajColumns,
|
||||
res
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private RabotnikTypeStaj selectedRabotnikStajTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (stajGridView.SelectedRows.Count != 1)
|
||||
throw new Exception("Стаж сотрудника не выбран.");
|
||||
if (int.TryParse((string)stajGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.RabotnikTypeStajGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void resetTypeStajComboBox()
|
||||
{
|
||||
try
|
||||
{
|
||||
var list = FuncDB.TypeStajListString();
|
||||
comboBox1.Items.Clear();
|
||||
comboBox1.Items.AddRange(list);
|
||||
comboBox1.SelectedIndex = -1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public bool isCanceled = true;
|
||||
public Rabotnik formResult = null;
|
||||
public RabForm(bool select = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
selectButton.Visible = select;
|
||||
menuStrip.Enabled = !select;
|
||||
this.correctUpperMenu(menuStrip, 2);
|
||||
resetRabotnikTable();
|
||||
resetTypeStajComboBox();
|
||||
|
||||
addTypeStajButton.Enabled =
|
||||
delTypeStajButton.Enabled =
|
||||
delWorkPlaceButton.Enabled =
|
||||
changeWorkPlaceButton.Enabled =
|
||||
addWorkPlaceButton.Enabled =
|
||||
addWorkerButton.Enabled = false;
|
||||
var user = this.GetUser();
|
||||
if (user == null)
|
||||
return;
|
||||
|
||||
delWorkPlaceButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 2, 1) != null;
|
||||
changeWorkPlaceButton.Enabled =
|
||||
delTypeStajButton.Enabled =
|
||||
addTypeStajButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 2, 2) != null;
|
||||
addWorkerButton.Enabled =
|
||||
addWorkPlaceButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 2, 3) != null;
|
||||
|
||||
}
|
||||
|
||||
private void addWorkerButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new SupportForms.WorkerForm();
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetRabotnikTable();
|
||||
}
|
||||
private void addWorkPlaceButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new SupportForms.WorkerForm(selectedHistoryWorkTable(), true);
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetRabotnikTable();
|
||||
}
|
||||
private void addTypeStajButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var typestaj = FuncDB.TypeStajGetByName(comboBox1.Text);
|
||||
if (typestaj == null)
|
||||
{
|
||||
FuncDB.TypeStajAdd(new TypeStaj() { Name = comboBox1.Text });
|
||||
typestaj = FuncDB.TypeStajGetByName(comboBox1.Text);
|
||||
}
|
||||
var rabotnik = selectedHistoryWorkTable();
|
||||
if (rabotnik == null)
|
||||
throw new Exception("Не выбран сотрудник");
|
||||
FuncDB.RabotnikTypeStajAdd(new RabotnikTypeStaj() { RabitnikId = rabotnik.Id, TypeStajId = typestaj.Id });
|
||||
resetTypeStajComboBox();
|
||||
resetRabotnikStajTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void changeWorkPlaceButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new SupportForms.WorkerForm(selectedHistoryWorkTable());
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetRabotnikTable();
|
||||
}
|
||||
private void delWorkPlaceButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var res = selectedHistoryWorkTable();
|
||||
FuncDB.RabotnikDelete(res);
|
||||
resetHistoryWorkTable();
|
||||
}
|
||||
private void delTypeStajButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var res = selectedRabotnikStajTable();
|
||||
FuncDB.RabotnikTypeStajDelete(res);
|
||||
resetRabotnikStajTable();
|
||||
}
|
||||
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
|
||||
private void selectButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
formResult = selectedRabotnikTable();
|
||||
isCanceled = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void findBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.FindOnChanged(resetRabotnikTable);
|
||||
}
|
||||
private void dropFindButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
findBox.Text = "";
|
||||
this.FindOnChanged(null);
|
||||
resetRabotnikTable();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
126
MainForms/RabForm.resx
Normal file
126
MainForms/RabForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>364, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>472, 17</value>
|
||||
</metadata>
|
||||
</root>
|
378
MainForms/SettingsForm.Designer.cs
generated
Normal file
378
MainForms/SettingsForm.Designer.cs
generated
Normal file
@ -0,0 +1,378 @@
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
partial class SettingsForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stajMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.learnMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.настройкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.group = new System.Windows.Forms.GroupBox();
|
||||
this.userGridView = new System.Windows.Forms.DataGridView();
|
||||
this.delUserButton = new System.Windows.Forms.Button();
|
||||
this.addUserButton = new System.Windows.Forms.Button();
|
||||
this.changeUserButton = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.accessGridView = new System.Windows.Forms.DataGridView();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.typeStajGridView = new System.Windows.Forms.DataGridView();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.group.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.userGridView)).BeginInit();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.accessGridView)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.typeStajGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.chelRodMI,
|
||||
this.rabitnikiMI,
|
||||
this.stajMI,
|
||||
this.learnMI,
|
||||
this.otpBolMI,
|
||||
this.детиToolStripMenuItem,
|
||||
this.настройкиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(1079, 24);
|
||||
this.menuStrip.TabIndex = 30;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(85, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудники";
|
||||
//
|
||||
// stajMI
|
||||
//
|
||||
this.stajMI.Name = "stajMI";
|
||||
this.stajMI.Size = new System.Drawing.Size(47, 20);
|
||||
this.stajMI.Text = "Стаж";
|
||||
//
|
||||
// learnMI
|
||||
//
|
||||
this.learnMI.Name = "learnMI";
|
||||
this.learnMI.Size = new System.Drawing.Size(92, 20);
|
||||
this.learnMI.Text = "Образование";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// настройкиToolStripMenuItem
|
||||
//
|
||||
this.настройкиToolStripMenuItem.Name = "настройкиToolStripMenuItem";
|
||||
this.настройкиToolStripMenuItem.Size = new System.Drawing.Size(79, 20);
|
||||
this.настройкиToolStripMenuItem.Text = "Настройки";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(137, 17);
|
||||
this.errorLabel.Text = "Отображение ошибки";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 421);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(1079, 22);
|
||||
this.statusStrip1.TabIndex = 37;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// group
|
||||
//
|
||||
this.group.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.group.Controls.Add(this.userGridView);
|
||||
this.group.Controls.Add(this.delUserButton);
|
||||
this.group.Controls.Add(this.addUserButton);
|
||||
this.group.Controls.Add(this.changeUserButton);
|
||||
this.group.Location = new System.Drawing.Point(267, 27);
|
||||
this.group.Name = "group";
|
||||
this.group.Size = new System.Drawing.Size(249, 391);
|
||||
this.group.TabIndex = 39;
|
||||
this.group.TabStop = false;
|
||||
this.group.Text = "Пользователи";
|
||||
//
|
||||
// userGridView
|
||||
//
|
||||
this.userGridView.AllowUserToAddRows = false;
|
||||
this.userGridView.AllowUserToDeleteRows = false;
|
||||
this.userGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.userGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.userGridView.Location = new System.Drawing.Point(6, 50);
|
||||
this.userGridView.MultiSelect = false;
|
||||
this.userGridView.Name = "userGridView";
|
||||
this.userGridView.ReadOnly = true;
|
||||
this.userGridView.RowHeadersVisible = false;
|
||||
this.userGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.userGridView.Size = new System.Drawing.Size(237, 335);
|
||||
this.userGridView.TabIndex = 37;
|
||||
this.userGridView.SelectionChanged += new System.EventHandler(this.userGridView_SelectionChanged);
|
||||
//
|
||||
// delUserButton
|
||||
//
|
||||
this.delUserButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.delUserButton.Location = new System.Drawing.Point(168, 21);
|
||||
this.delUserButton.Name = "delUserButton";
|
||||
this.delUserButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delUserButton.TabIndex = 45;
|
||||
this.delUserButton.Text = "Удалить";
|
||||
this.delUserButton.UseVisualStyleBackColor = true;
|
||||
this.delUserButton.Click += new System.EventHandler(this.delUserButton_Click);
|
||||
//
|
||||
// addUserButton
|
||||
//
|
||||
this.addUserButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addUserButton.Location = new System.Drawing.Point(6, 21);
|
||||
this.addUserButton.Name = "addUserButton";
|
||||
this.addUserButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addUserButton.TabIndex = 43;
|
||||
this.addUserButton.Text = "Добавить";
|
||||
this.addUserButton.UseVisualStyleBackColor = true;
|
||||
this.addUserButton.Click += new System.EventHandler(this.addUserButton_Click);
|
||||
//
|
||||
// changeUserButton
|
||||
//
|
||||
this.changeUserButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.changeUserButton.Location = new System.Drawing.Point(87, 21);
|
||||
this.changeUserButton.Name = "changeUserButton";
|
||||
this.changeUserButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.changeUserButton.TabIndex = 44;
|
||||
this.changeUserButton.Text = "Изменить";
|
||||
this.changeUserButton.UseVisualStyleBackColor = true;
|
||||
this.changeUserButton.Click += new System.EventHandler(this.changeUserButton_Click);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox1.Controls.Add(this.accessGridView);
|
||||
this.groupBox1.Location = new System.Drawing.Point(522, 26);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(545, 391);
|
||||
this.groupBox1.TabIndex = 40;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Доступ";
|
||||
//
|
||||
// accessGridView
|
||||
//
|
||||
this.accessGridView.AllowUserToAddRows = false;
|
||||
this.accessGridView.AllowUserToDeleteRows = false;
|
||||
this.accessGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.accessGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.accessGridView.Location = new System.Drawing.Point(6, 22);
|
||||
this.accessGridView.MultiSelect = false;
|
||||
this.accessGridView.Name = "accessGridView";
|
||||
this.accessGridView.ReadOnly = true;
|
||||
this.accessGridView.RowHeadersVisible = false;
|
||||
this.accessGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
|
||||
this.accessGridView.Size = new System.Drawing.Size(533, 363);
|
||||
this.accessGridView.TabIndex = 37;
|
||||
this.accessGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.accessGridView_CellClick);
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.groupBox2.Controls.Add(this.textBox1);
|
||||
this.groupBox2.Controls.Add(this.typeStajGridView);
|
||||
this.groupBox2.Controls.Add(this.button1);
|
||||
this.groupBox2.Controls.Add(this.button2);
|
||||
this.groupBox2.Controls.Add(this.button3);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 27);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(249, 391);
|
||||
this.groupBox2.TabIndex = 41;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Типы стажа";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(6, 48);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(237, 20);
|
||||
this.textBox1.TabIndex = 46;
|
||||
//
|
||||
// typeStajGridView
|
||||
//
|
||||
this.typeStajGridView.AllowUserToAddRows = false;
|
||||
this.typeStajGridView.AllowUserToDeleteRows = false;
|
||||
this.typeStajGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.typeStajGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.typeStajGridView.Location = new System.Drawing.Point(6, 74);
|
||||
this.typeStajGridView.MultiSelect = false;
|
||||
this.typeStajGridView.Name = "typeStajGridView";
|
||||
this.typeStajGridView.ReadOnly = true;
|
||||
this.typeStajGridView.RowHeadersVisible = false;
|
||||
this.typeStajGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.typeStajGridView.Size = new System.Drawing.Size(237, 311);
|
||||
this.typeStajGridView.TabIndex = 37;
|
||||
this.typeStajGridView.SelectionChanged += new System.EventHandler(this.typeStajGridView_SelectionChanged);
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.Location = new System.Drawing.Point(168, 19);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 45;
|
||||
this.button1.Text = "Удалить";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.delTypeButton_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button2.Location = new System.Drawing.Point(6, 19);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 43;
|
||||
this.button2.Text = "Добавить";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.addTypeStajButton_Click);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button3.Location = new System.Drawing.Point(87, 19);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(75, 23);
|
||||
this.button3.TabIndex = 44;
|
||||
this.button3.Text = "Изменить";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.changeTypeStajButton_Click);
|
||||
//
|
||||
// SettingsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1079, 443);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.group);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Name = "SettingsForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Отпуск/Больничный";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.group.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.userGridView)).EndInit();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.accessGridView)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.typeStajGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem stajMI;
|
||||
private System.Windows.Forms.GroupBox group;
|
||||
private System.Windows.Forms.DataGridView userGridView;
|
||||
private System.Windows.Forms.Button addUserButton;
|
||||
private System.Windows.Forms.Button changeUserButton;
|
||||
private System.Windows.Forms.Button delUserButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem learnMI;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.DataGridView accessGridView;
|
||||
private System.Windows.Forms.ToolStripMenuItem настройкиToolStripMenuItem;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.DataGridView typeStajGridView;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
}
|
||||
}
|
364
MainForms/SettingsForm.cs
Normal file
364
MainForms/SettingsForm.cs
Normal file
@ -0,0 +1,364 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public partial class SettingsForm : Form
|
||||
{
|
||||
private readonly ColumnConf[] tableUserColumns = {
|
||||
new ColumnConf(name: "Логин", size: 140)
|
||||
};
|
||||
private readonly ColumnConf[] tableAccessColumns = {
|
||||
new ColumnConf(name: "Форма", size: 140),
|
||||
new ColumnConf(name: "Просм.", size: 80),
|
||||
new ColumnConf(name: "Удал.", size: 80),
|
||||
new ColumnConf(name: "Изм.", size: 80),
|
||||
new ColumnConf(name: "Доб.", size: 80)
|
||||
};
|
||||
private readonly ColumnConf[] tableTypeStajColumns = {
|
||||
new ColumnConf(name: "Название", size: 140)
|
||||
};
|
||||
|
||||
private void resetTypeStajTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = new List<string[]>();
|
||||
var subres = FuncDB.TypeStajListString();
|
||||
foreach (var a in subres)
|
||||
res.Add(new string[] { a });
|
||||
this.ResetTable(
|
||||
typeStajGridView,
|
||||
tableTypeStajColumns,
|
||||
res.ToArray()
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private TypeStaj selectedTypeStajTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (typeStajGridView.SelectedRows.Count != 1)
|
||||
return null;
|
||||
return FuncDB.TypeStajGetByName((string)typeStajGridView.SelectedRows[0].Cells[0].Value);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private void typeStajGridView_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
var type_staj = selectedTypeStajTable();
|
||||
textBox1.Text = type_staj == null ? "" : type_staj.Name;
|
||||
}
|
||||
|
||||
private void resetUserTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.ResetTable(
|
||||
userGridView,
|
||||
tableUserColumns,
|
||||
FuncDB.UserListTable(true)
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
private User selectedUserTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (userGridView.SelectedRows.Count != 1)
|
||||
return null;
|
||||
return FuncDB.UserGetByLogin((string)userGridView.SelectedRows[0].Cells[0].Value);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
private void userGridView_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
resetAccessTable();
|
||||
}
|
||||
|
||||
private void initAccessTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
accessGridView.Rows.Clear();
|
||||
accessGridView.Columns.Clear();
|
||||
var c = accessGridView.Columns;
|
||||
for (var i = 0; i < tableAccessColumns.Length; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
c.Add(new DataGridViewCheckBoxColumn()
|
||||
{
|
||||
FalseValue = false,
|
||||
TrueValue = true,
|
||||
HeaderText = tableAccessColumns[i].name
|
||||
});
|
||||
else
|
||||
c.Add(tableAccessColumns[i].name, tableAccessColumns[i].name);
|
||||
c[i].Width = tableAccessColumns[i].size;
|
||||
if (tableAccessColumns[i].warp)
|
||||
c[i].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
|
||||
}
|
||||
foreach (var formName in FormArray.formName)
|
||||
{
|
||||
accessGridView.Rows.Add();
|
||||
var row = accessGridView.Rows[accessGridView.Rows.Count - 1];
|
||||
row.Cells[0].Value = formName;
|
||||
for (var i = 0; i < FormArray.formAccess.Length; i++)
|
||||
((DataGridViewCheckBoxCell)row.Cells[i + 1]).Value = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void accessGridView_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (accessGridView.SelectedCells.Count != 1)
|
||||
return;
|
||||
var cell = accessGridView.SelectedCells[0];
|
||||
var accessId = cell.ColumnIndex;
|
||||
if (accessId == 0)
|
||||
return;
|
||||
else
|
||||
accessId--;
|
||||
var formId = cell.RowIndex;
|
||||
((DataGridViewCheckBoxCell)accessGridView.SelectedCells[0]).Value =
|
||||
!(bool)((DataGridViewCheckBoxCell)accessGridView.SelectedCells[0]).Value;
|
||||
var user = selectedUserTable();
|
||||
if (user == null)
|
||||
throw new Exception("Пользователь не выбран.");
|
||||
|
||||
var access = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, formId, accessId);
|
||||
if (
|
||||
(access == null && !(bool)cell.Value) ||
|
||||
(access != null && (bool)cell.Value)
|
||||
)
|
||||
return;
|
||||
if ((bool)cell.Value)
|
||||
{
|
||||
if (FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, formId, 0) == null)
|
||||
FuncDB.AccessAdd(new Access()
|
||||
{
|
||||
UserId = user.Id,
|
||||
FormId = formId,
|
||||
FormatAccess = 0
|
||||
});
|
||||
FuncDB.AccessAdd(new Access()
|
||||
{
|
||||
UserId = user.Id,
|
||||
FormId = formId,
|
||||
FormatAccess = accessId
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (formId == 7 && FuncDB.AccessToSettingsFullCountWithoutUserId(user) == 0)
|
||||
throw new Exception("Должен хотя бы 1 польз. иметь полн. дост. к настр.");
|
||||
if (formId == user.Default && accessId == 0)
|
||||
throw new Exception("Нельзя снять разрешение для окна по умолчанию.");
|
||||
if (accessId == 0)
|
||||
{
|
||||
var list = FuncDB.AccessGetByUserIdFormId(user.Id, formId);
|
||||
foreach (var l in list)
|
||||
FuncDB.AccessDelete(l);
|
||||
}
|
||||
else
|
||||
{
|
||||
FuncDB.AccessDelete(access);
|
||||
}
|
||||
}
|
||||
resetAccessTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
resetAccessTable();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void resetAccessTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
var user = selectedUserTable();
|
||||
var res = new bool[FormArray.formName.Length, FormArray.formAccess.Length];
|
||||
if (user != null)
|
||||
res = FuncDB.AccessListTable(user.Id);
|
||||
for (var i = 0; i < FormArray.formName.Length; i++)
|
||||
for (var j = 0; j < FormArray.formAccess.Length; j++)
|
||||
((DataGridViewCheckBoxCell)accessGridView.Rows[i].Cells[j + 1]).Value = res[i, j];
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public SettingsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.correctUpperMenu(menuStrip, 7);
|
||||
initAccessTable();
|
||||
resetTypeStajTable();
|
||||
resetUserTable();
|
||||
|
||||
addUserButton.Enabled =
|
||||
changeUserButton.Enabled =
|
||||
delUserButton.Enabled =
|
||||
accessGridView.Enabled =
|
||||
button2.Enabled =
|
||||
button1.Enabled =
|
||||
button3.Enabled =
|
||||
false;
|
||||
var user = this.GetUser();
|
||||
if (user == null)
|
||||
return;
|
||||
accessGridView.Enabled =
|
||||
FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 7, 2) != null ||
|
||||
FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 7, 3) != null;
|
||||
|
||||
delUserButton.Enabled =
|
||||
button1.Enabled =
|
||||
FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 7, 1) != null;
|
||||
changeUserButton.Enabled =
|
||||
button3.Enabled =
|
||||
FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 7, 2) != null;
|
||||
addUserButton.Enabled =
|
||||
button2.Enabled =
|
||||
FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 7, 3) != null;
|
||||
}
|
||||
|
||||
private void addTypeStajButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var type = new TypeStaj()
|
||||
{
|
||||
Name = textBox1.Text
|
||||
};
|
||||
FuncDB.TypeStajAdd(type);
|
||||
resetTypeStajTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void changeTypeStajButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var type = selectedTypeStajTable();
|
||||
if (type == null)
|
||||
throw new Exception("Не вбран тип стажа.");
|
||||
type.Name = textBox1.Text;
|
||||
FuncDB.TypeStajChange(type);
|
||||
resetTypeStajTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void delTypeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var type = selectedTypeStajTable();
|
||||
if (type == null)
|
||||
throw new Exception("Не вбран тип стажа.");
|
||||
FuncDB.TypeStajDelete(type);
|
||||
resetTypeStajTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void addUserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var form = new SupportForms.LoginForm();
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetUserTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void changeUserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (selectedUserTable() == null)
|
||||
throw new Exception("Не выбран пользователь.");
|
||||
var form = new SupportForms.LoginForm(selectedUserTable());
|
||||
form.ShowDialog();
|
||||
if (!form.isCanceled)
|
||||
resetUserTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void delUserButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var user = selectedUserTable();
|
||||
if (user == null)
|
||||
throw new Exception("Не выбран пользователь.");
|
||||
if (FuncDB.AccessToSettingsFullCountWithoutUserId(user) == 0)
|
||||
throw new Exception("Должен хотя бы 1 польз. иметь полн. дост. к настр.");
|
||||
FuncDB.UserDelete(selectedUserTable());
|
||||
resetUserTable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
126
MainForms/SettingsForm.resx
Normal file
126
MainForms/SettingsForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>364, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>472, 17</value>
|
||||
</metadata>
|
||||
</root>
|
259
MainForms/ShtatForm.Designer.cs
generated
259
MainForms/ShtatForm.Designer.cs
generated
@ -29,75 +29,38 @@ namespace Diplom_O
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.findBox = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.dropFindButton = new System.Windows.Forms.Button();
|
||||
this.freeShtatCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.addButton = new System.Windows.Forms.Button();
|
||||
this.changeButton = new System.Windows.Forms.Button();
|
||||
this.delButton = new System.Windows.Forms.Button();
|
||||
this.selectButton = new System.Windows.Forms.Button();
|
||||
this.shtatGridView = new System.Windows.Forms.DataGridView();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stajMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.learnMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.delButton = new System.Windows.Forms.Button();
|
||||
this.changeButton = new System.Windows.Forms.Button();
|
||||
this.addButton = new System.Windows.Forms.Button();
|
||||
this.настройкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
((System.ComponentModel.ISupportInitialize)(this.shtatGridView)).BeginInit();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.rabitnikiMI,
|
||||
this.otpBolMI,
|
||||
this.chelRodMI});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(342, 24);
|
||||
this.menuStrip.TabIndex = 8;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(46, 20);
|
||||
this.shtatMI.Text = "Штат";
|
||||
this.shtatMI.Click += new System.EventHandler(this.MI_Click);
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(78, 20);
|
||||
this.rabitnikiMI.Text = "Работники";
|
||||
this.rabitnikiMI.Click += new System.EventHandler(this.MI_Click);
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
this.otpBolMI.Click += new System.EventHandler(this.MI_Click);
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(95, 20);
|
||||
this.chelRodMI.Text = "Люди/Родств.";
|
||||
this.chelRodMI.Click += new System.EventHandler(this.MI_Click);
|
||||
//
|
||||
// findBox
|
||||
//
|
||||
this.findBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.findBox.Location = new System.Drawing.Point(57, 490);
|
||||
this.findBox.Location = new System.Drawing.Point(57, 613);
|
||||
this.findBox.Name = "findBox";
|
||||
this.findBox.Size = new System.Drawing.Size(192, 20);
|
||||
this.findBox.Size = new System.Drawing.Size(505, 20);
|
||||
this.findBox.TabIndex = 5;
|
||||
this.findBox.TextChanged += new System.EventHandler(this.findBox_TextChanged);
|
||||
//
|
||||
@ -105,7 +68,7 @@ namespace Diplom_O
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 493);
|
||||
this.label1.Location = new System.Drawing.Point(12, 616);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(39, 13);
|
||||
this.label1.TabIndex = 3;
|
||||
@ -114,66 +77,39 @@ namespace Diplom_O
|
||||
// dropFindButton
|
||||
//
|
||||
this.dropFindButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dropFindButton.Location = new System.Drawing.Point(255, 488);
|
||||
this.dropFindButton.Location = new System.Drawing.Point(568, 611);
|
||||
this.dropFindButton.Name = "dropFindButton";
|
||||
this.dropFindButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.dropFindButton.TabIndex = 6;
|
||||
this.dropFindButton.Text = "Сбросить";
|
||||
this.dropFindButton.UseVisualStyleBackColor = true;
|
||||
this.dropFindButton.TextChanged += new System.EventHandler(this.dropFindButton_Click);
|
||||
this.dropFindButton.Click += new System.EventHandler(this.dropFindButton_Click);
|
||||
//
|
||||
// freeShtatCheckBox
|
||||
//
|
||||
this.freeShtatCheckBox.AutoSize = true;
|
||||
this.freeShtatCheckBox.Checked = true;
|
||||
this.freeShtatCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.freeShtatCheckBox.Location = new System.Drawing.Point(12, 56);
|
||||
this.freeShtatCheckBox.Location = new System.Drawing.Point(12, 31);
|
||||
this.freeShtatCheckBox.Name = "freeShtatCheckBox";
|
||||
this.freeShtatCheckBox.Size = new System.Drawing.Size(218, 17);
|
||||
this.freeShtatCheckBox.Size = new System.Drawing.Size(177, 17);
|
||||
this.freeShtatCheckBox.TabIndex = 4;
|
||||
this.freeShtatCheckBox.Text = "Поrазать/скрыть занятые должности";
|
||||
this.freeShtatCheckBox.Text = "Только актуальные вакансии";
|
||||
this.freeShtatCheckBox.UseVisualStyleBackColor = true;
|
||||
this.freeShtatCheckBox.CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.Location = new System.Drawing.Point(93, 27);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addButton.TabIndex = 1;
|
||||
this.addButton.Text = "Добавить";
|
||||
this.addButton.UseVisualStyleBackColor = true;
|
||||
this.addButton.Click += new System.EventHandler(this.addButton_Click);
|
||||
//
|
||||
// changeButton
|
||||
//
|
||||
this.changeButton.Location = new System.Drawing.Point(174, 27);
|
||||
this.changeButton.Name = "changeButton";
|
||||
this.changeButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.changeButton.TabIndex = 2;
|
||||
this.changeButton.Text = "Изменить";
|
||||
this.changeButton.UseVisualStyleBackColor = true;
|
||||
this.changeButton.Click += new System.EventHandler(this.changeButton_Click);
|
||||
//
|
||||
// delButton
|
||||
//
|
||||
this.delButton.Location = new System.Drawing.Point(255, 27);
|
||||
this.delButton.Name = "delButton";
|
||||
this.delButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delButton.TabIndex = 3;
|
||||
this.delButton.Text = "Удалить";
|
||||
this.delButton.UseVisualStyleBackColor = true;
|
||||
this.delButton.Click += new System.EventHandler(this.delButton_Click);
|
||||
//
|
||||
// selectButton
|
||||
//
|
||||
this.selectButton.Location = new System.Drawing.Point(12, 27);
|
||||
this.selectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.selectButton.Location = new System.Drawing.Point(325, 27);
|
||||
this.selectButton.Name = "selectButton";
|
||||
this.selectButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.selectButton.TabIndex = 0;
|
||||
this.selectButton.Text = "Выбрать";
|
||||
this.selectButton.UseVisualStyleBackColor = true;
|
||||
this.selectButton.Visible = false;
|
||||
this.selectButton.Click += new System.EventHandler(this.selectButton_Click);
|
||||
//
|
||||
// shtatGridView
|
||||
//
|
||||
@ -183,22 +119,22 @@ namespace Diplom_O
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.shtatGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.shtatGridView.Location = new System.Drawing.Point(12, 79);
|
||||
this.shtatGridView.Location = new System.Drawing.Point(12, 56);
|
||||
this.shtatGridView.MultiSelect = false;
|
||||
this.shtatGridView.Name = "shtatGridView";
|
||||
this.shtatGridView.ReadOnly = true;
|
||||
this.shtatGridView.RowHeadersVisible = false;
|
||||
this.shtatGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.shtatGridView.Size = new System.Drawing.Size(318, 403);
|
||||
this.shtatGridView.Size = new System.Drawing.Size(631, 549);
|
||||
this.shtatGridView.TabIndex = 7;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 514);
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 637);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(342, 22);
|
||||
this.statusStrip1.Size = new System.Drawing.Size(655, 22);
|
||||
this.statusStrip1.TabIndex = 15;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
@ -211,54 +147,155 @@ namespace Diplom_O
|
||||
this.errorLabel.Text = "Отображение ошибки";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.chelRodMI,
|
||||
this.rabitnikiMI,
|
||||
this.stajMI,
|
||||
this.learnMI,
|
||||
this.otpBolMI,
|
||||
this.детиToolStripMenuItem,
|
||||
this.настройкиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(655, 24);
|
||||
this.menuStrip.TabIndex = 16;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(85, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудники";
|
||||
//
|
||||
// stajMI
|
||||
//
|
||||
this.stajMI.Name = "stajMI";
|
||||
this.stajMI.Size = new System.Drawing.Size(47, 20);
|
||||
this.stajMI.Text = "Стаж";
|
||||
//
|
||||
// learnMI
|
||||
//
|
||||
this.learnMI.Name = "learnMI";
|
||||
this.learnMI.Size = new System.Drawing.Size(92, 20);
|
||||
this.learnMI.Text = "Образование";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// delButton
|
||||
//
|
||||
this.delButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.delButton.Location = new System.Drawing.Point(568, 27);
|
||||
this.delButton.Name = "delButton";
|
||||
this.delButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.delButton.TabIndex = 17;
|
||||
this.delButton.Text = "Удалить";
|
||||
this.delButton.UseVisualStyleBackColor = true;
|
||||
this.delButton.Click += new System.EventHandler(this.delButton_Click);
|
||||
//
|
||||
// changeButton
|
||||
//
|
||||
this.changeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.changeButton.Location = new System.Drawing.Point(487, 27);
|
||||
this.changeButton.Name = "changeButton";
|
||||
this.changeButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.changeButton.TabIndex = 18;
|
||||
this.changeButton.Text = "Изменить";
|
||||
this.changeButton.UseVisualStyleBackColor = true;
|
||||
this.changeButton.Click += new System.EventHandler(this.changeButton_Click);
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addButton.Location = new System.Drawing.Point(406, 27);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.addButton.TabIndex = 19;
|
||||
this.addButton.Text = "Добавить";
|
||||
this.addButton.UseVisualStyleBackColor = true;
|
||||
this.addButton.Click += new System.EventHandler(this.addButton_Click);
|
||||
//
|
||||
// настройкиToolStripMenuItem
|
||||
//
|
||||
this.настройкиToolStripMenuItem.Name = "настройкиToolStripMenuItem";
|
||||
this.настройкиToolStripMenuItem.Size = new System.Drawing.Size(79, 20);
|
||||
this.настройкиToolStripMenuItem.Text = "Настройки";
|
||||
//
|
||||
// ShtatForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(342, 536);
|
||||
this.ClientSize = new System.Drawing.Size(655, 659);
|
||||
this.Controls.Add(this.addButton);
|
||||
this.Controls.Add(this.changeButton);
|
||||
this.Controls.Add(this.delButton);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.shtatGridView);
|
||||
this.Controls.Add(this.selectButton);
|
||||
this.Controls.Add(this.delButton);
|
||||
this.Controls.Add(this.changeButton);
|
||||
this.Controls.Add(this.addButton);
|
||||
this.Controls.Add(this.freeShtatCheckBox);
|
||||
this.Controls.Add(this.dropFindButton);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.findBox);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.MainMenuStrip = this.menuStrip;
|
||||
this.Name = "ShtatForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Штат";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
this.Text = "Вакансии";
|
||||
((System.ComponentModel.ISupportInitialize)(this.shtatGridView)).EndInit();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.TextBox findBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button dropFindButton;
|
||||
private System.Windows.Forms.CheckBox freeShtatCheckBox;
|
||||
private System.Windows.Forms.Button addButton;
|
||||
private System.Windows.Forms.Button changeButton;
|
||||
private System.Windows.Forms.Button delButton;
|
||||
private System.Windows.Forms.Button selectButton;
|
||||
private System.Windows.Forms.DataGridView shtatGridView;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
}
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.Button delButton;
|
||||
private System.Windows.Forms.Button changeButton;
|
||||
private System.Windows.Forms.Button addButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem stajMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem learnMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem настройкиToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,39 +13,22 @@ namespace Diplom_O
|
||||
{
|
||||
public partial class ShtatForm : Form
|
||||
{
|
||||
private Task errDrop;
|
||||
private void ShowError(string msg = null)
|
||||
private readonly ColumnConf[] tableColumns =
|
||||
{
|
||||
errorLabel.Text = string.IsNullOrEmpty(msg) ? "Неизвестная ошибка." : msg;
|
||||
errorLabel.Visible = true;
|
||||
errDrop = new Task(() =>
|
||||
{
|
||||
var fd = errDrop.Id;
|
||||
Task.Delay(5000).Wait();
|
||||
if (errDrop.Id == fd)
|
||||
if (InvokeRequired) Invoke((Action)(() => { errorLabel.Visible = false; }));
|
||||
else errorLabel.Visible = false;
|
||||
});
|
||||
errDrop.Start();
|
||||
}
|
||||
new ColumnConf("№"),
|
||||
new ColumnConf("Должность", 140),
|
||||
new ColumnConf(name: "Кол-во"),
|
||||
new ColumnConf(name: "Своб.")
|
||||
};
|
||||
|
||||
private Task filterDrop;
|
||||
private void findBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
filterDrop = new Task(() =>
|
||||
{
|
||||
var fd = filterDrop.Id;
|
||||
Task.Delay(1000).Wait();
|
||||
if (filterDrop.Id == fd)
|
||||
if (InvokeRequired) Invoke((Action)(() => { resetShatTable(); }));
|
||||
else resetShatTable();
|
||||
});
|
||||
filterDrop.Start();
|
||||
this.FindOnChanged(resetShatTable);
|
||||
}
|
||||
private void dropFindButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
findBox.Text = "";
|
||||
filterDrop = new Task(() => { return; });
|
||||
this.FindOnChanged(null);
|
||||
resetShatTable();
|
||||
}
|
||||
|
||||
@ -53,63 +36,67 @@ namespace Diplom_O
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
shtatGridView.Rows.Clear();
|
||||
shtatGridView.Columns.Clear();
|
||||
var c = shtatGridView.Columns;
|
||||
c.Add("Id", "№");
|
||||
c.Add("Dolj", "Должность");
|
||||
c.Add("Kolvo", "Кол-во");
|
||||
c.Add("Free", "Своб.");
|
||||
c[0].Width = 40;
|
||||
c[1].Width = 120;
|
||||
c[2].Width = 40;
|
||||
c[3].Width = 40;
|
||||
}
|
||||
{
|
||||
var arr = FuncDB.ListShtat(findBox.Text);
|
||||
var r = shtatGridView.Rows;
|
||||
foreach (var shtat in arr)
|
||||
if (shtat.ost != 0)
|
||||
r.Add(new object[] {
|
||||
shtat.shtat.Id,
|
||||
shtat.shtat.Doljnost,
|
||||
shtat.shtat.Size,
|
||||
shtat.ost
|
||||
});
|
||||
}
|
||||
if (shtatGridView.Rows.Count > 0)
|
||||
shtatGridView.Rows[0].Selected = true;
|
||||
var tmp = FuncDB.ShtatListTableMain(findBox.Text, freeShtatCheckBox.Checked);
|
||||
var res = new List<string[]>();
|
||||
foreach (var i in tmp)
|
||||
if (int.TryParse(i[0], out int t) && t != 0)
|
||||
res.Add(i);
|
||||
this.ResetTable(
|
||||
shtatGridView,
|
||||
tableColumns,
|
||||
freeShtatCheckBox.Checked ?
|
||||
tmp :
|
||||
res.ToArray()
|
||||
);
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
this.ShowError( errorLabel, e.Message );
|
||||
}
|
||||
catch (Exception e) { ShowError(e.Message); }
|
||||
}
|
||||
private Shtat selectedShtat()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (shtatGridView.SelectedRows.Count != 1) throw new Exception("Должность не выбрана.");
|
||||
var shtat = FuncDB.GetShtat((int)shtatGridView.SelectedRows[0].Cells[0].Value);
|
||||
return shtat;
|
||||
if ( shtatGridView.SelectedRows.Count != 1 )
|
||||
throw new Exception("Должность не выбрана.");
|
||||
if (int.TryParse((string)shtatGridView.SelectedRows[0].Cells[0].Value, out int value))
|
||||
return FuncDB.ShtatGetById(value);
|
||||
else
|
||||
throw new Exception("Ошибка в таблице.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
return null;
|
||||
}
|
||||
catch (Exception e) { ShowError(e.Message); return null; }
|
||||
}
|
||||
|
||||
public bool isCanceled = true;
|
||||
public Shtat formResult = null;
|
||||
public ShtatForm(bool select = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
InitializeComponent();
|
||||
Init(select);
|
||||
selectButton.Visible = select;
|
||||
shtatMI.Enabled = !select;
|
||||
this.correctUpperMenu(menuStrip, 0);
|
||||
resetShatTable();
|
||||
|
||||
addButton.Enabled =
|
||||
changeButton.Enabled =
|
||||
delButton.Enabled = false;
|
||||
var user = this.GetUser();
|
||||
if (user == null)
|
||||
return;
|
||||
delButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 0, 1) != null;
|
||||
changeButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 0, 2) != null;
|
||||
addButton.Enabled = FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 0, 3) != null;
|
||||
|
||||
}
|
||||
catch { this.Close(); }
|
||||
}
|
||||
public void Init(bool s)
|
||||
{
|
||||
if (s) selectButton.Visible = true;
|
||||
shtatMI.Enabled = false;
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
@ -121,7 +108,8 @@ namespace Diplom_O
|
||||
private void changeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var shtat = selectedShtat();
|
||||
if (shtat == null) { ShowError("Должность не выбрана."); return; }
|
||||
if (shtat == null)
|
||||
return;
|
||||
var res = new SupportForms.WorkShtatForm(shtat);
|
||||
res.ShowDialog();
|
||||
if (!res.isCanceled)
|
||||
@ -130,40 +118,37 @@ namespace Diplom_O
|
||||
private void delButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var shtat = selectedShtat();
|
||||
if (shtat == null) { ShowError("Должность не выбрана."); return; }
|
||||
if (shtat == null)
|
||||
return;
|
||||
try
|
||||
{
|
||||
FuncDB.DelShtat(shtat);
|
||||
FuncDB.ShtatDelete(shtat);
|
||||
resetShatTable();
|
||||
}
|
||||
catch (Exception ex) { ShowError(ex.Message); }
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
public void MI_Click(object sender, EventArgs e)
|
||||
private void selectButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
object form = null;
|
||||
var idxMenu = -1;
|
||||
try { idxMenu = menuStrip.Items.IndexOf((ToolStripMenuItem)sender); }
|
||||
catch { };
|
||||
switch (idxMenu)
|
||||
{
|
||||
case 0: form = new ShtatForm(); break;
|
||||
case 1: form = new RabForm(); break;
|
||||
case 2: form = new OtpForm(); break;
|
||||
case 3: form = new ChelForm(); break;
|
||||
}
|
||||
if (form != null)
|
||||
{
|
||||
this.Hide();
|
||||
((Form)form).Closed += (s, args) => this.Close();
|
||||
((Form)form).Show();
|
||||
return;
|
||||
}
|
||||
ShowError("Ошибка перехода на новую форму.");
|
||||
formResult = selectedShtat();
|
||||
isCanceled = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void checkBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
resetShatTable();
|
||||
}
|
||||
}
|
||||
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -117,10 +117,10 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>132, 17</value>
|
||||
</metadata>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>24, 19</value>
|
||||
</metadata>
|
||||
</root>
|
397
MainForms/StajForm.Designer.cs
generated
Normal file
397
MainForms/StajForm.Designer.cs
generated
Normal file
@ -0,0 +1,397 @@
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
partial class StajForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.shtatMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.chelRodMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rabitnikiMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stajMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.learnMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.otpBolMI = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.детиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.stajGridView = new System.Windows.Forms.DataGridView();
|
||||
this.linkRabLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.addStajButton = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.dayTB = new System.Windows.Forms.TextBox();
|
||||
this.monthTB = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.yearTB = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.addRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.delRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.настройкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.stajGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.shtatMI,
|
||||
this.chelRodMI,
|
||||
this.rabitnikiMI,
|
||||
this.stajMI,
|
||||
this.learnMI,
|
||||
this.otpBolMI,
|
||||
this.детиToolStripMenuItem,
|
||||
this.настройкиToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(705, 24);
|
||||
this.menuStrip.TabIndex = 30;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
this.menuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.upperMenuClicked);
|
||||
//
|
||||
// shtatMI
|
||||
//
|
||||
this.shtatMI.Name = "shtatMI";
|
||||
this.shtatMI.Size = new System.Drawing.Size(139, 20);
|
||||
this.shtatMI.Text = "Актуальные вакансии";
|
||||
//
|
||||
// chelRodMI
|
||||
//
|
||||
this.chelRodMI.Name = "chelRodMI";
|
||||
this.chelRodMI.Size = new System.Drawing.Size(50, 20);
|
||||
this.chelRodMI.Text = "Люди";
|
||||
//
|
||||
// rabitnikiMI
|
||||
//
|
||||
this.rabitnikiMI.Name = "rabitnikiMI";
|
||||
this.rabitnikiMI.Size = new System.Drawing.Size(85, 20);
|
||||
this.rabitnikiMI.Text = "Сотрудники";
|
||||
//
|
||||
// stajMI
|
||||
//
|
||||
this.stajMI.Name = "stajMI";
|
||||
this.stajMI.Size = new System.Drawing.Size(47, 20);
|
||||
this.stajMI.Text = "Стаж";
|
||||
//
|
||||
// learnMI
|
||||
//
|
||||
this.learnMI.Name = "learnMI";
|
||||
this.learnMI.Size = new System.Drawing.Size(92, 20);
|
||||
this.learnMI.Text = "Образование";
|
||||
//
|
||||
// otpBolMI
|
||||
//
|
||||
this.otpBolMI.Name = "otpBolMI";
|
||||
this.otpBolMI.Size = new System.Drawing.Size(100, 20);
|
||||
this.otpBolMI.Text = "Отпуск/Больн.";
|
||||
//
|
||||
// детиToolStripMenuItem
|
||||
//
|
||||
this.детиToolStripMenuItem.Name = "детиToolStripMenuItem";
|
||||
this.детиToolStripMenuItem.Size = new System.Drawing.Size(45, 20);
|
||||
this.детиToolStripMenuItem.Text = "Дети";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(137, 17);
|
||||
this.errorLabel.Text = "Отображение ошибки";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 432);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(705, 22);
|
||||
this.statusStrip1.TabIndex = 37;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox2.Controls.Add(this.stajGridView);
|
||||
this.groupBox2.Location = new System.Drawing.Point(13, 113);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(678, 316);
|
||||
this.groupBox2.TabIndex = 40;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Стаж";
|
||||
//
|
||||
// stajGridView
|
||||
//
|
||||
this.stajGridView.AllowUserToAddRows = false;
|
||||
this.stajGridView.AllowUserToDeleteRows = false;
|
||||
this.stajGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.stajGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.stajGridView.Location = new System.Drawing.Point(6, 19);
|
||||
this.stajGridView.MultiSelect = false;
|
||||
this.stajGridView.Name = "stajGridView";
|
||||
this.stajGridView.ReadOnly = true;
|
||||
this.stajGridView.RowHeadersVisible = false;
|
||||
this.stajGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.stajGridView.Size = new System.Drawing.Size(666, 291);
|
||||
this.stajGridView.TabIndex = 37;
|
||||
//
|
||||
// linkRabLabel
|
||||
//
|
||||
this.linkRabLabel.AutoSize = true;
|
||||
this.linkRabLabel.Location = new System.Drawing.Point(76, 32);
|
||||
this.linkRabLabel.Name = "linkRabLabel";
|
||||
this.linkRabLabel.Size = new System.Drawing.Size(121, 13);
|
||||
this.linkRabLabel.TabIndex = 41;
|
||||
this.linkRabLabel.TabStop = true;
|
||||
this.linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
this.linkRabLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkRabLabel_LinkClicked);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 32);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(69, 13);
|
||||
this.label2.TabIndex = 42;
|
||||
this.label2.Text = "Сотрудники:";
|
||||
//
|
||||
// addStajButton
|
||||
//
|
||||
this.addStajButton.Location = new System.Drawing.Point(616, 53);
|
||||
this.addStajButton.Name = "addStajButton";
|
||||
this.addStajButton.Size = new System.Drawing.Size(75, 51);
|
||||
this.addStajButton.TabIndex = 47;
|
||||
this.addStajButton.Text = "Установить";
|
||||
this.addStajButton.UseVisualStyleBackColor = true;
|
||||
this.addStajButton.Click += new System.EventHandler(this.addStajButton_Click);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(10, 60);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(63, 13);
|
||||
this.label3.TabIndex = 48;
|
||||
this.label3.Text = "Тип стажа:";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(79, 57);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(530, 21);
|
||||
this.comboBox1.TabIndex = 49;
|
||||
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.typeStajChanged);
|
||||
this.comboBox1.SelectedValueChanged += new System.EventHandler(this.typeStajChanged);
|
||||
//
|
||||
// dayTB
|
||||
//
|
||||
this.dayTB.Location = new System.Drawing.Point(308, 86);
|
||||
this.dayTB.Name = "dayTB";
|
||||
this.dayTB.Size = new System.Drawing.Size(75, 20);
|
||||
this.dayTB.TabIndex = 50;
|
||||
//
|
||||
// monthTB
|
||||
//
|
||||
this.monthTB.Location = new System.Drawing.Point(187, 86);
|
||||
this.monthTB.Name = "monthTB";
|
||||
this.monthTB.Size = new System.Drawing.Size(75, 20);
|
||||
this.monthTB.TabIndex = 51;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(268, 89);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(37, 13);
|
||||
this.label4.TabIndex = 52;
|
||||
this.label4.Text = "Дней:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(126, 89);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(55, 13);
|
||||
this.label5.TabIndex = 53;
|
||||
this.label5.Text = "Месяцев:";
|
||||
//
|
||||
// yearTB
|
||||
//
|
||||
this.yearTB.Location = new System.Drawing.Point(45, 86);
|
||||
this.yearTB.Name = "yearTB";
|
||||
this.yearTB.Size = new System.Drawing.Size(75, 20);
|
||||
this.yearTB.TabIndex = 54;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(10, 89);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(29, 13);
|
||||
this.label6.TabIndex = 55;
|
||||
this.label6.Text = "Лет:";
|
||||
//
|
||||
// addRadioButton
|
||||
//
|
||||
this.addRadioButton.AutoSize = true;
|
||||
this.addRadioButton.Location = new System.Drawing.Point(389, 87);
|
||||
this.addRadioButton.Name = "addRadioButton";
|
||||
this.addRadioButton.Size = new System.Drawing.Size(80, 17);
|
||||
this.addRadioButton.TabIndex = 56;
|
||||
this.addRadioButton.TabStop = true;
|
||||
this.addRadioButton.Text = "Прибавить";
|
||||
this.addRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// delRadioButton
|
||||
//
|
||||
this.delRadioButton.AutoSize = true;
|
||||
this.delRadioButton.Location = new System.Drawing.Point(475, 87);
|
||||
this.delRadioButton.Name = "delRadioButton";
|
||||
this.delRadioButton.Size = new System.Drawing.Size(68, 17);
|
||||
this.delRadioButton.TabIndex = 57;
|
||||
this.delRadioButton.TabStop = true;
|
||||
this.delRadioButton.Text = "Вычесть";
|
||||
this.delRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(458, 29);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(151, 20);
|
||||
this.dateTimePicker1.TabIndex = 58;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(616, 28);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 59;
|
||||
this.button1.Text = "Расчитать";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(367, 33);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(85, 13);
|
||||
this.label1.TabIndex = 60;
|
||||
this.label1.Text = "Расчет на дату:";
|
||||
//
|
||||
// настройкиToolStripMenuItem
|
||||
//
|
||||
this.настройкиToolStripMenuItem.Name = "настройкиToolStripMenuItem";
|
||||
this.настройкиToolStripMenuItem.Size = new System.Drawing.Size(79, 20);
|
||||
this.настройкиToolStripMenuItem.Text = "Настройки";
|
||||
//
|
||||
// StajForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(705, 454);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.delRadioButton);
|
||||
this.Controls.Add(this.addRadioButton);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.yearTB);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.monthTB);
|
||||
this.Controls.Add(this.dayTB);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.addStajButton);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.linkRabLabel);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.menuStrip);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Name = "StajForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Стаж";
|
||||
this.menuStrip.ResumeLayout(false);
|
||||
this.menuStrip.PerformLayout();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.stajGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem shtatMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem rabitnikiMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem otpBolMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem chelRodMI;
|
||||
private System.Windows.Forms.ToolStripMenuItem детиToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem stajMI;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.DataGridView stajGridView;
|
||||
private System.Windows.Forms.LinkLabel linkRabLabel;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button addStajButton;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.TextBox dayTB;
|
||||
private System.Windows.Forms.TextBox monthTB;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox yearTB;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.RadioButton addRadioButton;
|
||||
private System.Windows.Forms.RadioButton delRadioButton;
|
||||
private System.Windows.Forms.ToolStripMenuItem learnMI;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ToolStripMenuItem настройкиToolStripMenuItem;
|
||||
}
|
||||
}
|
298
MainForms/StajForm.cs
Normal file
298
MainForms/StajForm.cs
Normal file
@ -0,0 +1,298 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
public partial class StajForm : Form
|
||||
{
|
||||
private readonly ColumnConf[] tableStajColumns = {
|
||||
new ColumnConf(name: "№"),
|
||||
new ColumnConf(name: "Названиe", size: 140, warp: true),
|
||||
new ColumnConf(name: "Лет", size: 60),
|
||||
new ColumnConf(name: "Месяцев", size: 60),
|
||||
new ColumnConf(name: "Дней", size: 60)
|
||||
};
|
||||
|
||||
private Rabotnik rabotnik = null;
|
||||
private void linkRabLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var form = new RabForm(true);
|
||||
form.ShowDialog();
|
||||
if (form.isCanceled)
|
||||
rabotnik = null;
|
||||
else
|
||||
rabotnik = form.formResult;
|
||||
ResetLinkRabotnik();
|
||||
resetStajTable();
|
||||
}
|
||||
private void ResetLinkRabotnik()
|
||||
{
|
||||
if (rabotnik == null)
|
||||
{
|
||||
linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
return;
|
||||
}
|
||||
var chel = FuncDB.ChelGetById(rabotnik.ChelId);
|
||||
if (chel == null)
|
||||
{
|
||||
linkRabLabel.Text = "Выбрать сотрудника...";
|
||||
return;
|
||||
}
|
||||
var res = chel.FName.ToString() + " " +
|
||||
chel.SName[0].ToString() + "." +
|
||||
((!string.IsNullOrEmpty(chel.TName)) ?
|
||||
chel.TName[0].ToString() + "." : "");
|
||||
linkRabLabel.Text = res;
|
||||
}
|
||||
private void resetStajTable()
|
||||
{
|
||||
(int year, int month, int day) Sum(
|
||||
(int year, int month, int day) t1,
|
||||
(int year, int month, int day) t2
|
||||
)
|
||||
{
|
||||
var year = t1.year + t2.year;
|
||||
var month = t1.month + t2.month;
|
||||
var day = t1.day + t2.day;
|
||||
|
||||
month += day / 30;
|
||||
day %= 30;
|
||||
year += month / 12;
|
||||
month %= 12;
|
||||
|
||||
return (year, month, day);
|
||||
}
|
||||
(int year, int month, int day) Sub(
|
||||
(int year, int month, int day) t1,
|
||||
(int year, int month, int day) t2
|
||||
)
|
||||
{
|
||||
var year = t1.year - t2.year;
|
||||
var month = t1.month - t2.month;
|
||||
var day = t1.day - t2.day;
|
||||
while (day < 0)
|
||||
{
|
||||
day += 30;
|
||||
month--;
|
||||
}
|
||||
while (month < 0)
|
||||
{
|
||||
month += 12;
|
||||
year--;
|
||||
}
|
||||
month += day / 30;
|
||||
day %= 30;
|
||||
year += month / 12;
|
||||
month %= 12;
|
||||
return (year, month, day);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var res = new List<string[]>();
|
||||
if (rabotnik == null)
|
||||
{
|
||||
this.ResetTable(
|
||||
stajGridView,
|
||||
tableStajColumns,
|
||||
res.ToArray()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
var count = new Dictionary<int, (int year, int month, int day)>();
|
||||
var listRab = FuncDB.RabotnikHistoryByChelId(rabotnik.ChelId);
|
||||
foreach (var rab in listRab)
|
||||
{
|
||||
var size = FuncDB.RabotnikGetTotalTime(rab, dateTimePicker1.Value);
|
||||
var staj = FuncDB.RabotnikTypeStajList(rab.Id);
|
||||
if (count.ContainsKey(-1))
|
||||
count[-1] = Sum(count[-1], size);
|
||||
else
|
||||
count[-1] = size;
|
||||
foreach(var st in staj)
|
||||
if (count.ContainsKey(st.TypeStajId))
|
||||
count[st.TypeStajId] = Sum(count[st.TypeStajId], size);
|
||||
else
|
||||
count[st.TypeStajId] = size;
|
||||
}
|
||||
|
||||
var listCorrStaj = FuncDB.CorrStajList(rabotnik.ChelId);
|
||||
foreach (var corr in listCorrStaj)
|
||||
{
|
||||
var ts = FuncDB.TypeStajGetById(corr.TypeStajId);
|
||||
if (ts != null && ts.Name.CompareTo("Общий") == 0)
|
||||
corr.TypeStajId = -1;
|
||||
var size = (corr.Year, corr.Month, corr.Day);
|
||||
if (!count.ContainsKey(corr.TypeStajId))
|
||||
count[corr.TypeStajId] = (0, 0, 0);
|
||||
if (corr.AddFlag)
|
||||
count[corr.TypeStajId] = Sum(count[corr.TypeStajId], size);
|
||||
else
|
||||
count[corr.TypeStajId] = Sub(count[corr.TypeStajId], size);
|
||||
}
|
||||
|
||||
foreach (var r in count)
|
||||
{
|
||||
if (r.Value.year < 0 || r.Value.year + r.Value.month + r.Value.day == 0)
|
||||
continue;
|
||||
var sr = new List<string>();
|
||||
sr.Add(r.Key.ToString());
|
||||
if (r.Key == -1)
|
||||
sr.Add("Общий");
|
||||
else
|
||||
sr.Add(FuncDB.TypeStajGetById(r.Key).Name);
|
||||
sr.Add(r.Value.year.ToString());
|
||||
sr.Add(r.Value.month.ToString());
|
||||
sr.Add(r.Value.day.ToString());
|
||||
res.Add(sr.ToArray());
|
||||
}
|
||||
|
||||
this.ResetTable(
|
||||
stajGridView,
|
||||
tableStajColumns,
|
||||
res.ToArray()
|
||||
);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public StajForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.correctUpperMenu(menuStrip, 3);
|
||||
dateTimePicker1.Value = DateTime.Now;
|
||||
ResetLinkRabotnik();
|
||||
resetTypeStajComboBox();
|
||||
|
||||
linkRabLabel.Enabled = false;
|
||||
addStajButton.Enabled = false;
|
||||
var user = this.GetUser();
|
||||
if (user == null)
|
||||
return;
|
||||
linkRabLabel.Enabled =
|
||||
FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 3, 0) != null;
|
||||
addStajButton.Enabled =
|
||||
FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 3, 2) != null ||
|
||||
FuncDB.AccessGetByUserIdFormIdAccessId(user.Id, 3, 3) != null;
|
||||
|
||||
}
|
||||
|
||||
private void resetTypeStajComboBox()
|
||||
{
|
||||
try
|
||||
{
|
||||
var list = new List<string>();
|
||||
list.Add("Общий");
|
||||
list.AddRange(FuncDB.TypeStajListString());
|
||||
comboBox1.Items.Clear();
|
||||
comboBox1.Items.AddRange(list.ToArray());
|
||||
comboBox1.SelectedIndex = -1;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void upperMenuClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||
{
|
||||
this.upperMenuClicked((MenuStrip)sender);
|
||||
if (this.GetNextForm() != -1)
|
||||
Close();
|
||||
}
|
||||
|
||||
private void typeStajChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
addRadioButton.Checked = ! (delRadioButton.Checked = false);
|
||||
yearTB.Text = monthTB.Text = dayTB.Text = "";
|
||||
if (rabotnik == null)
|
||||
return;
|
||||
var staj = FuncDB.TypeStajGetByName(comboBox1.Text);
|
||||
if (staj == null)
|
||||
return;
|
||||
var corrStaj = FuncDB.CorrStaj(rabotnik.ChelId, staj.Name);
|
||||
if (corrStaj == null)
|
||||
return;
|
||||
yearTB.Text = corrStaj.Year.ToString();
|
||||
monthTB.Text = corrStaj.Month.ToString();
|
||||
dayTB.Text = corrStaj.Day.ToString();
|
||||
delRadioButton.Checked = !(addRadioButton.Checked = corrStaj.AddFlag);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void addStajButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (rabotnik == null)
|
||||
throw new Exception("Не выбран сотрудник.");
|
||||
if (!int.TryParse(yearTB.Text, out int year) || year < 0)
|
||||
throw new Exception("Не верно указан год.");
|
||||
if (!int.TryParse(monthTB.Text, out int month) || month < 0)
|
||||
throw new Exception("Не верно указан месяц.");
|
||||
if (!int.TryParse(dayTB.Text, out int day) || day < 0)
|
||||
throw new Exception("Не верно указан день.");
|
||||
|
||||
var typeStaj = FuncDB.TypeStajGetByName(comboBox1.Text);
|
||||
if(typeStaj == null)
|
||||
{
|
||||
FuncDB.TypeStajAdd(new TypeStaj() { Name = comboBox1.Text });
|
||||
typeStaj = FuncDB.TypeStajGetByName(comboBox1.Text);
|
||||
}
|
||||
|
||||
var corrStaj = FuncDB.CorrStaj(rabotnik.ChelId, typeStaj.Name);
|
||||
if (corrStaj == null)
|
||||
{
|
||||
FuncDB.CorrStajAdd(new CorrStaj()
|
||||
{
|
||||
Year = year,
|
||||
Month = month,
|
||||
Day = day,
|
||||
ChelId = rabotnik.ChelId,
|
||||
TypeStajId = typeStaj.Id,
|
||||
AddFlag = addRadioButton.Checked
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
corrStaj.ChelId = rabotnik.ChelId;
|
||||
corrStaj.TypeStajId = typeStaj.Id;
|
||||
corrStaj.AddFlag = addRadioButton.Checked;
|
||||
corrStaj.Year = year;
|
||||
corrStaj.Month = month;
|
||||
corrStaj.Day = day;
|
||||
FuncDB.CorrStajChange(corrStaj);
|
||||
}
|
||||
resetStajTable();
|
||||
resetTypeStajComboBox();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetStajTable();
|
||||
}
|
||||
}
|
||||
}
|
126
MainForms/StajForm.resx
Normal file
126
MainForms/StajForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>364, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>472, 17</value>
|
||||
</metadata>
|
||||
</root>
|
85
Program.cs
85
Program.cs
@ -3,11 +3,14 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
public static bool IsDebug = false;
|
||||
|
||||
/// <summary>
|
||||
/// Главная точка входа для приложения.
|
||||
/// </summary>
|
||||
@ -16,7 +19,87 @@ namespace Diplom_O
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new ShtatForm());
|
||||
int nextForm = 0;
|
||||
FuncDB.InitDB();
|
||||
{
|
||||
var form = new LoginForm();
|
||||
Application.Run(form);
|
||||
if (form.isCanceled)
|
||||
return;
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
while (nextForm >= 0 && nextForm < FormArray.formName.Length)
|
||||
{
|
||||
switch (nextForm)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
var form = new ShtatForm();
|
||||
Application.Run(form);
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
var form = new ChelForm();
|
||||
Application.Run(form);
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
var form = new RabForm();
|
||||
Application.Run(form);
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
var form = new StajForm();
|
||||
Application.Run(form);
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
var form = new LearnForm();
|
||||
Application.Run(form);
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
var form = new OtpForm();
|
||||
Application.Run(form);
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
var form = new ChildForm();
|
||||
Application.Run(form);
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
var form = new SettingsForm();
|
||||
Application.Run(form);
|
||||
nextForm = form.GetNextForm();
|
||||
form.SetNextForm(-1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
274
SupportForms/ChildForm.Designer.cs
generated
Normal file
274
SupportForms/ChildForm.Designer.cs
generated
Normal file
@ -0,0 +1,274 @@
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
partial class ChildForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.fNameBox = new System.Windows.Forms.TextBox();
|
||||
this.sNameBox = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.workButton = new System.Windows.Forms.Button();
|
||||
this.canceledButton = new System.Windows.Forms.Button();
|
||||
this.tNameBox = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.maleBox = new System.Windows.Forms.ComboBox();
|
||||
this.birthdayBox = new System.Windows.Forms.DateTimePicker();
|
||||
this.linkRod1 = new System.Windows.Forms.LinkLabel();
|
||||
this.linkRod2 = new System.Windows.Forms.LinkLabel();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// fNameBox
|
||||
//
|
||||
this.fNameBox.Location = new System.Drawing.Point(104, 12);
|
||||
this.fNameBox.Name = "fNameBox";
|
||||
this.fNameBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.fNameBox.TabIndex = 0;
|
||||
//
|
||||
// sNameBox
|
||||
//
|
||||
this.sNameBox.Location = new System.Drawing.Point(104, 38);
|
||||
this.sNameBox.Name = "sNameBox";
|
||||
this.sNameBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.sNameBox.TabIndex = 1;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 225);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(332, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(57, 17);
|
||||
this.errorLabel.Text = "Ошибка.";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(245, 194);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 9;
|
||||
this.workButton.Text = "Добавить";
|
||||
this.workButton.UseVisualStyleBackColor = true;
|
||||
this.workButton.Click += new System.EventHandler(this.workButton_Click);
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(164, 194);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 10;
|
||||
this.canceledButton.Text = "Отмена";
|
||||
this.canceledButton.UseVisualStyleBackColor = true;
|
||||
this.canceledButton.Click += new System.EventHandler(this.canceledButton_Click);
|
||||
//
|
||||
// tNameBox
|
||||
//
|
||||
this.tNameBox.Location = new System.Drawing.Point(104, 64);
|
||||
this.tNameBox.Name = "tNameBox";
|
||||
this.tNameBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.tNameBox.TabIndex = 2;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(42, 15);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(56, 13);
|
||||
this.label1.TabIndex = 29;
|
||||
this.label1.Text = "Фамилия";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(69, 41);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(29, 13);
|
||||
this.label2.TabIndex = 30;
|
||||
this.label2.Text = "Имя";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(44, 67);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(54, 13);
|
||||
this.label3.TabIndex = 31;
|
||||
this.label3.Text = "Отчество";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(71, 93);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(27, 13);
|
||||
this.label4.TabIndex = 32;
|
||||
this.label4.Text = "Пол";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(12, 119);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(86, 13);
|
||||
this.label5.TabIndex = 33;
|
||||
this.label5.Text = "Дата рождения";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(34, 145);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(64, 13);
|
||||
this.label6.TabIndex = 34;
|
||||
this.label6.Text = "Родитель 1";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(34, 171);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(64, 13);
|
||||
this.label7.TabIndex = 35;
|
||||
this.label7.Text = "Родитель 2";
|
||||
//
|
||||
// maleBox
|
||||
//
|
||||
this.maleBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.maleBox.FormattingEnabled = true;
|
||||
this.maleBox.Items.AddRange(new object[] {
|
||||
"Мужчина",
|
||||
"Женщина"});
|
||||
this.maleBox.Location = new System.Drawing.Point(104, 90);
|
||||
this.maleBox.Name = "maleBox";
|
||||
this.maleBox.Size = new System.Drawing.Size(216, 21);
|
||||
this.maleBox.TabIndex = 3;
|
||||
//
|
||||
// birthdayBox
|
||||
//
|
||||
this.birthdayBox.CustomFormat = "yyyy.MM.dd";
|
||||
this.birthdayBox.Location = new System.Drawing.Point(104, 116);
|
||||
this.birthdayBox.Name = "birthdayBox";
|
||||
this.birthdayBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.birthdayBox.TabIndex = 4;
|
||||
//
|
||||
// linkRod1
|
||||
//
|
||||
this.linkRod1.AutoSize = true;
|
||||
this.linkRod1.Location = new System.Drawing.Point(104, 145);
|
||||
this.linkRod1.Name = "linkRod1";
|
||||
this.linkRod1.Size = new System.Drawing.Size(110, 13);
|
||||
this.linkRod1.TabIndex = 40;
|
||||
this.linkRod1.TabStop = true;
|
||||
this.linkRod1.Text = "Выбрать человека...";
|
||||
this.linkRod1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkRod1_LinkClicked);
|
||||
//
|
||||
// linkRod2
|
||||
//
|
||||
this.linkRod2.AutoSize = true;
|
||||
this.linkRod2.Location = new System.Drawing.Point(104, 171);
|
||||
this.linkRod2.Name = "linkRod2";
|
||||
this.linkRod2.Size = new System.Drawing.Size(110, 13);
|
||||
this.linkRod2.TabIndex = 41;
|
||||
this.linkRod2.TabStop = true;
|
||||
this.linkRod2.Text = "Выбрать человека...";
|
||||
this.linkRod2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkRod2_LinkClicked);
|
||||
//
|
||||
// ChildForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(332, 247);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.linkRod2);
|
||||
this.Controls.Add(this.linkRod1);
|
||||
this.Controls.Add(this.birthdayBox);
|
||||
this.Controls.Add(this.maleBox);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.tNameBox);
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.sNameBox);
|
||||
this.Controls.Add(this.fNameBox);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ChildForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Ребенок";
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox fNameBox;
|
||||
private System.Windows.Forms.TextBox sNameBox;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.Button workButton;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
private System.Windows.Forms.TextBox tNameBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.ComboBox maleBox;
|
||||
private System.Windows.Forms.DateTimePicker birthdayBox;
|
||||
private System.Windows.Forms.LinkLabel linkRod1;
|
||||
private System.Windows.Forms.LinkLabel linkRod2;
|
||||
}
|
||||
}
|
120
SupportForms/ChildForm.cs
Normal file
120
SupportForms/ChildForm.cs
Normal file
@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
public partial class ChildForm : Form
|
||||
{
|
||||
private int? rod1Id = null;
|
||||
private void linkRod1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var form = new ChelForm(true);
|
||||
form.ShowDialog();
|
||||
if (form.isCanceled)
|
||||
rod1Id = null;
|
||||
else
|
||||
rod1Id = form.formResult.Id;
|
||||
linkRod1_changeName();
|
||||
}
|
||||
private void linkRod1_changeName()
|
||||
{
|
||||
linkRod1.Text = rod1Id.HasValue ?
|
||||
FuncDB.ChelGetFIOShortById(rod1Id.Value) :
|
||||
"Выбрать человека...";
|
||||
}
|
||||
|
||||
private int? rod2Id = null;
|
||||
private void linkRod2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var form = new ChelForm(true);
|
||||
form.ShowDialog();
|
||||
if (form.isCanceled)
|
||||
rod2Id = null;
|
||||
else
|
||||
rod2Id = form.formResult.Id;
|
||||
linkRod2_changeName();
|
||||
}
|
||||
private void linkRod2_changeName()
|
||||
{
|
||||
linkRod2.Text = rod2Id.HasValue ?
|
||||
FuncDB.ChelGetFIOShortById(rod2Id.Value) :
|
||||
"Выбрать человека...";
|
||||
}
|
||||
|
||||
public bool isCanceled = false;
|
||||
private Child child = null;
|
||||
public ChildForm(Child child = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
maleBox.SelectedIndex = 0;
|
||||
birthdayBox.Value = DateTime.Now;
|
||||
try
|
||||
{
|
||||
if (child != null)
|
||||
{
|
||||
this.child = child;
|
||||
workButton.Text = "Изменить";
|
||||
fNameBox.Text = child.FName;
|
||||
sNameBox.Text = child.SName;
|
||||
tNameBox.Text = child.TName;
|
||||
maleBox.SelectedIndex = child.Male ? 0 : 1;
|
||||
birthdayBox.Value = child.Birthday;
|
||||
rod1Id = child.Parent1Id;
|
||||
rod2Id = child.Parent2Id;
|
||||
linkRod1_changeName();
|
||||
linkRod2_changeName();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
workButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void workButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (maleBox.SelectedIndex == -1)
|
||||
throw new Exception("Пол не указан.");
|
||||
var _child = new Child();
|
||||
_child.FName = fNameBox.Text;
|
||||
_child.SName = sNameBox.Text;
|
||||
_child.TName = tNameBox.Text;
|
||||
_child.Male = maleBox.SelectedIndex == 0;
|
||||
_child.Birthday = birthdayBox.Value;
|
||||
_child.Parent1Id = rod1Id;
|
||||
_child.Parent2Id = rod2Id;
|
||||
|
||||
FuncDB.ChildCheckValid(_child);
|
||||
if (child == null)
|
||||
FuncDB.ChildAdd(_child);
|
||||
else
|
||||
{
|
||||
_child.Id = child.Id;
|
||||
FuncDB.ChildChange(_child);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
isCanceled = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
126
SupportForms/ChildForm.resx
Normal file
126
SupportForms/ChildForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
239
SupportForms/LearnForm.Designer.cs
generated
Normal file
239
SupportForms/LearnForm.Designer.cs
generated
Normal file
@ -0,0 +1,239 @@
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
partial class LearnForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.nameBox = new System.Windows.Forms.TextBox();
|
||||
this.typeBox = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.workButton = new System.Windows.Forms.Button();
|
||||
this.canceledButton = new System.Windows.Forms.Button();
|
||||
this.specBox = new System.Windows.Forms.TextBox();
|
||||
this.label = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.dateBox = new System.Windows.Forms.DateTimePicker();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameBox
|
||||
//
|
||||
this.nameBox.Location = new System.Drawing.Point(104, 12);
|
||||
this.nameBox.Name = "nameBox";
|
||||
this.nameBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.nameBox.TabIndex = 0;
|
||||
//
|
||||
// typeBox
|
||||
//
|
||||
this.typeBox.Location = new System.Drawing.Point(104, 38);
|
||||
this.typeBox.Name = "typeBox";
|
||||
this.typeBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.typeBox.TabIndex = 1;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 202);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(332, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(57, 17);
|
||||
this.errorLabel.Text = "Ошибка.";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(245, 168);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 9;
|
||||
this.workButton.Text = "Добавить";
|
||||
this.workButton.UseVisualStyleBackColor = true;
|
||||
this.workButton.Click += new System.EventHandler(this.workButton_Click);
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(164, 168);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 10;
|
||||
this.canceledButton.Text = "Отмена";
|
||||
this.canceledButton.UseVisualStyleBackColor = true;
|
||||
this.canceledButton.Click += new System.EventHandler(this.canceledButton_Click);
|
||||
//
|
||||
// specBox
|
||||
//
|
||||
this.specBox.Location = new System.Drawing.Point(104, 64);
|
||||
this.specBox.Name = "specBox";
|
||||
this.specBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.specBox.TabIndex = 2;
|
||||
//
|
||||
// label
|
||||
//
|
||||
this.label.AutoSize = true;
|
||||
this.label.Location = new System.Drawing.Point(43, 15);
|
||||
this.label.Name = "label";
|
||||
this.label.Size = new System.Drawing.Size(55, 13);
|
||||
this.label.TabIndex = 29;
|
||||
this.label.Text = "Обр. учр.:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(44, 41);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(54, 13);
|
||||
this.label2.TabIndex = 30;
|
||||
this.label2.Text = "Уровень:";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(60, 67);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(38, 13);
|
||||
this.label3.TabIndex = 31;
|
||||
this.label3.Text = "Спец.:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(6, 145);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(92, 13);
|
||||
this.label5.TabIndex = 33;
|
||||
this.label5.Text = "Дата окончания:";
|
||||
//
|
||||
// dateBox
|
||||
//
|
||||
this.dateBox.CustomFormat = "yyyy.MM.dd";
|
||||
this.dateBox.Location = new System.Drawing.Point(104, 142);
|
||||
this.dateBox.Name = "dateBox";
|
||||
this.dateBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.dateBox.TabIndex = 4;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(104, 90);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(216, 20);
|
||||
this.textBox1.TabIndex = 34;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(104, 116);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(216, 20);
|
||||
this.textBox2.TabIndex = 35;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(64, 93);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(34, 13);
|
||||
this.label1.TabIndex = 36;
|
||||
this.label1.Text = "Курс:";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(21, 119);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(77, 13);
|
||||
this.label4.TabIndex = 37;
|
||||
this.label4.Text = "Проф. переп.:";
|
||||
//
|
||||
// LearnForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(332, 224);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.dateBox);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label);
|
||||
this.Controls.Add(this.specBox);
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.typeBox);
|
||||
this.Controls.Add(this.nameBox);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "LearnForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Образование";
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameBox;
|
||||
private System.Windows.Forms.TextBox typeBox;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.Button workButton;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
private System.Windows.Forms.TextBox specBox;
|
||||
private System.Windows.Forms.Label label;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.DateTimePicker dateBox;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
82
SupportForms/LearnForm.cs
Normal file
82
SupportForms/LearnForm.cs
Normal file
@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
public partial class LearnForm : Form
|
||||
{
|
||||
public bool isCanceled = false;
|
||||
private int chelId = 0;
|
||||
private Learn learn = null;
|
||||
public LearnForm(Learn learn = null, int? chelId = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (learn == null && chelId == null)
|
||||
throw new Exception("Не выбран сотрудник.");
|
||||
dateBox.Value = DateTime.Now;
|
||||
try
|
||||
{
|
||||
if (learn != null)
|
||||
{
|
||||
this.learn = learn;
|
||||
this.chelId = learn.ChelId;
|
||||
nameBox.Text = learn.NameSchool;
|
||||
typeBox.Text = learn.Type;
|
||||
specBox.Text = learn.Spec;
|
||||
dateBox.Value = learn.End;
|
||||
workButton.Text = "Изменить";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.chelId = chelId.Value;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
workButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void workButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var _learn = new Learn();
|
||||
_learn.NameSchool = nameBox.Text;
|
||||
_learn.Type = typeBox.Text;
|
||||
_learn.Spec = specBox.Text;
|
||||
_learn.Curs = textBox1.Text;
|
||||
_learn.ProfPer = textBox2.Text;
|
||||
_learn.ChelId = chelId;
|
||||
_learn.End = dateBox.Value;
|
||||
FuncDB.LearnCheckValid(_learn);
|
||||
if (learn == null)
|
||||
FuncDB.LearnAdd(_learn);
|
||||
else
|
||||
{
|
||||
_learn.Id = learn.Id;
|
||||
FuncDB.LearnChange(_learn);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
isCanceled = true;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
126
SupportForms/LearnForm.resx
Normal file
126
SupportForms/LearnForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
188
SupportForms/LoginForm.Designer.cs
generated
Normal file
188
SupportForms/LoginForm.Designer.cs
generated
Normal file
@ -0,0 +1,188 @@
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
partial class LoginForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.loginBox = new System.Windows.Forms.TextBox();
|
||||
this.passBox = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.workButton = new System.Windows.Forms.Button();
|
||||
this.canceledButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.formBox = new System.Windows.Forms.ComboBox();
|
||||
this.hideBox = new System.Windows.Forms.CheckBox();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// loginBox
|
||||
//
|
||||
this.loginBox.Location = new System.Drawing.Point(128, 12);
|
||||
this.loginBox.Name = "loginBox";
|
||||
this.loginBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.loginBox.TabIndex = 0;
|
||||
//
|
||||
// passBox
|
||||
//
|
||||
this.passBox.Location = new System.Drawing.Point(128, 38);
|
||||
this.passBox.Name = "passBox";
|
||||
this.passBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.passBox.TabIndex = 1;
|
||||
this.passBox.UseSystemPasswordChar = true;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 155);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(352, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(57, 17);
|
||||
this.errorLabel.Text = "Ошибка.";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(269, 121);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 9;
|
||||
this.workButton.Text = "Добавить";
|
||||
this.workButton.UseVisualStyleBackColor = true;
|
||||
this.workButton.Click += new System.EventHandler(this.workButton_Click);
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(188, 121);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 10;
|
||||
this.canceledButton.Text = "Отмена";
|
||||
this.canceledButton.UseVisualStyleBackColor = true;
|
||||
this.canceledButton.Click += new System.EventHandler(this.canceledButton_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(81, 15);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(41, 13);
|
||||
this.label1.TabIndex = 29;
|
||||
this.label1.Text = "Логин:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(74, 41);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(48, 13);
|
||||
this.label2.TabIndex = 30;
|
||||
this.label2.Text = "Пароль:";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(12, 67);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(110, 13);
|
||||
this.label4.TabIndex = 32;
|
||||
this.label4.Text = "Окно по умолчанию:";
|
||||
//
|
||||
// formBox
|
||||
//
|
||||
this.formBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.formBox.FormattingEnabled = true;
|
||||
this.formBox.Location = new System.Drawing.Point(128, 64);
|
||||
this.formBox.Name = "formBox";
|
||||
this.formBox.Size = new System.Drawing.Size(216, 21);
|
||||
this.formBox.TabIndex = 3;
|
||||
//
|
||||
// hideBox
|
||||
//
|
||||
this.hideBox.AutoSize = true;
|
||||
this.hideBox.Location = new System.Drawing.Point(128, 92);
|
||||
this.hideBox.Name = "hideBox";
|
||||
this.hideBox.Size = new System.Drawing.Size(76, 17);
|
||||
this.hideBox.TabIndex = 42;
|
||||
this.hideBox.Text = "Скрывать";
|
||||
this.hideBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// LoginForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(352, 177);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.hideBox);
|
||||
this.Controls.Add(this.formBox);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.passBox);
|
||||
this.Controls.Add(this.loginBox);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "LoginForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Штатное место";
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox loginBox;
|
||||
private System.Windows.Forms.TextBox passBox;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.Button workButton;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.ComboBox formBox;
|
||||
private System.Windows.Forms.CheckBox hideBox;
|
||||
}
|
||||
}
|
79
SupportForms/LoginForm.cs
Normal file
79
SupportForms/LoginForm.cs
Normal file
@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
public partial class LoginForm : Form
|
||||
{
|
||||
public bool isCanceled = false;
|
||||
private User user = null;
|
||||
public LoginForm(User user = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
formBox.Items.Clear();
|
||||
for (var i = 0; i < 8; i++)
|
||||
formBox.Items.Add(FormArray.GetNameString(i));
|
||||
formBox.SelectedIndex = 0;
|
||||
hideBox.Checked = false;
|
||||
try
|
||||
{
|
||||
if (user != null)
|
||||
{
|
||||
this.user = user;
|
||||
workButton.Text = "Изменить";
|
||||
loginBox.Text = user.Login;
|
||||
passBox.Text = user.Pass;
|
||||
formBox.SelectedIndex = user.Default;
|
||||
hideBox.Checked = user.Hide;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
workButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void workButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var _user = new User();
|
||||
_user.Login = loginBox.Text;
|
||||
_user.Pass = passBox.Text;
|
||||
_user.Hide = hideBox.Checked;
|
||||
_user.Default = formBox.SelectedIndex;
|
||||
|
||||
FuncDB.UserCheckValid(_user);
|
||||
if (user == null)
|
||||
FuncDB.UserAdd(_user);
|
||||
else
|
||||
{
|
||||
_user.Id = user.Id;
|
||||
if (FuncDB.AccessGetByUserIdFormIdAccessId(_user.Id, _user.Default, 0) == null)
|
||||
throw new Exception("Необходим сначала доступ к форме.");
|
||||
FuncDB.UserChange(_user);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
isCanceled = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
126
SupportForms/LoginForm.resx
Normal file
126
SupportForms/LoginForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
193
SupportForms/OptForm.Designer.cs
generated
Normal file
193
SupportForms/OptForm.Designer.cs
generated
Normal file
@ -0,0 +1,193 @@
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
partial class OptForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.workButton = new System.Windows.Forms.Button();
|
||||
this.canceledButton = new System.Windows.Forms.Button();
|
||||
this.label = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.dateBox = new System.Windows.Forms.DateTimePicker();
|
||||
this.dateBox2 = new System.Windows.Forms.DateTimePicker();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 152);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(332, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(57, 17);
|
||||
this.errorLabel.Text = "Ошибка.";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(245, 116);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 9;
|
||||
this.workButton.Text = "Добавить";
|
||||
this.workButton.UseVisualStyleBackColor = true;
|
||||
this.workButton.Click += new System.EventHandler(this.workButton_Click);
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(164, 116);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 10;
|
||||
this.canceledButton.Text = "Отмена";
|
||||
this.canceledButton.UseVisualStyleBackColor = true;
|
||||
this.canceledButton.Click += new System.EventHandler(this.canceledButton_Click);
|
||||
//
|
||||
// label
|
||||
//
|
||||
this.label.AutoSize = true;
|
||||
this.label.Location = new System.Drawing.Point(57, 15);
|
||||
this.label.Name = "label";
|
||||
this.label.Size = new System.Drawing.Size(29, 13);
|
||||
this.label.TabIndex = 29;
|
||||
this.label.Text = "Тип:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 41);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(74, 13);
|
||||
this.label2.TabIndex = 30;
|
||||
this.label2.Text = "Дата начала:";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(17, 93);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(69, 13);
|
||||
this.label3.TabIndex = 31;
|
||||
this.label3.Text = "Дата конца:";
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.AutoSize = true;
|
||||
this.checkBox1.Location = new System.Drawing.Point(104, 66);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(121, 17);
|
||||
this.checkBox1.TabIndex = 38;
|
||||
this.checkBox1.Text = "По текущее время";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
|
||||
//
|
||||
// dateBox
|
||||
//
|
||||
this.dateBox.CustomFormat = "yyyy.MM.dd";
|
||||
this.dateBox.Location = new System.Drawing.Point(104, 38);
|
||||
this.dateBox.Name = "dateBox";
|
||||
this.dateBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.dateBox.TabIndex = 39;
|
||||
//
|
||||
// dateBox2
|
||||
//
|
||||
this.dateBox2.CustomFormat = "yyyy.MM.dd";
|
||||
this.dateBox2.Location = new System.Drawing.Point(104, 90);
|
||||
this.dateBox2.Name = "dateBox2";
|
||||
this.dateBox2.Size = new System.Drawing.Size(216, 20);
|
||||
this.dateBox2.TabIndex = 40;
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Items.AddRange(new object[] {
|
||||
"Отпуск",
|
||||
"Больничный",
|
||||
"Иное"});
|
||||
this.comboBox1.Location = new System.Drawing.Point(104, 12);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(216, 21);
|
||||
this.comboBox1.TabIndex = 41;
|
||||
//
|
||||
// OptForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(332, 174);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.dateBox2);
|
||||
this.Controls.Add(this.dateBox);
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label);
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "OptForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Образование";
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.Button workButton;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
private System.Windows.Forms.Label label;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.DateTimePicker dateBox;
|
||||
private System.Windows.Forms.DateTimePicker dateBox2;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
}
|
||||
}
|
98
SupportForms/OptForm.cs
Normal file
98
SupportForms/OptForm.cs
Normal file
@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
public partial class OptForm : Form
|
||||
{
|
||||
public bool isCanceled = false;
|
||||
private int chelId = 0;
|
||||
private Free free = null;
|
||||
public OptForm(Free free = null, int? chelId = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (free == null && chelId == null)
|
||||
throw new Exception("Не выбран сотрудник.");
|
||||
dateBox.Value = DateTime.Now;
|
||||
dateBox2.Value = DateTime.Now;
|
||||
comboBox1.SelectedIndex = 0;
|
||||
try
|
||||
{
|
||||
if (free != null)
|
||||
{
|
||||
this.free = free;
|
||||
this.chelId = free.ChelId;
|
||||
dateBox.Value = free.Start;
|
||||
comboBox1.Text = free.Type;
|
||||
if (free.End.HasValue)
|
||||
{
|
||||
checkBox1.Checked = false;
|
||||
dateBox2.Enabled = true;
|
||||
dateBox2.Value = free.End.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkBox1.Checked = true;
|
||||
dateBox2.Enabled = false;
|
||||
}
|
||||
workButton.Text = "Изменить";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.chelId = chelId.Value;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
workButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void workButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var _free = new Free();
|
||||
_free.ChelId = chelId;
|
||||
_free.Type = comboBox1.Text;
|
||||
_free.Start = dateBox.Value;
|
||||
if (checkBox1.Checked)
|
||||
_free.End = null;
|
||||
else
|
||||
_free.End = dateBox2.Value;
|
||||
FuncDB.FreeCheckValid(_free);
|
||||
if (free == null)
|
||||
FuncDB.FreeAdd(_free);
|
||||
else
|
||||
{
|
||||
_free.Id = free.Id;
|
||||
FuncDB.FreeChange(_free);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
isCanceled = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
dateBox2.Enabled = !checkBox1.Checked;
|
||||
}
|
||||
}
|
||||
}
|
126
SupportForms/OptForm.resx
Normal file
126
SupportForms/OptForm.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
165
SupportForms/SelectChelForm.Designer.cs
generated
165
SupportForms/SelectChelForm.Designer.cs
generated
@ -1,165 +0,0 @@
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
partial class SelectChelForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.chelGridView = new System.Windows.Forms.DataGridView();
|
||||
this.dropFindButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.findBox = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.canceledButton = new System.Windows.Forms.Button();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chelGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 529);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(352, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(57, 17);
|
||||
this.errorLabel.Text = "Ошибка.";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// chelGridView
|
||||
//
|
||||
this.chelGridView.AllowUserToAddRows = false;
|
||||
this.chelGridView.AllowUserToDeleteRows = false;
|
||||
this.chelGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.chelGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.chelGridView.Location = new System.Drawing.Point(12, 41);
|
||||
this.chelGridView.MultiSelect = false;
|
||||
this.chelGridView.Name = "chelGridView";
|
||||
this.chelGridView.ReadOnly = true;
|
||||
this.chelGridView.RowHeadersVisible = false;
|
||||
this.chelGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.chelGridView.Size = new System.Drawing.Size(328, 456);
|
||||
this.chelGridView.TabIndex = 4;
|
||||
//
|
||||
// dropFindButton
|
||||
//
|
||||
this.dropFindButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dropFindButton.Location = new System.Drawing.Point(265, 503);
|
||||
this.dropFindButton.Name = "dropFindButton";
|
||||
this.dropFindButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.dropFindButton.TabIndex = 3;
|
||||
this.dropFindButton.Text = "Сбросить";
|
||||
this.dropFindButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 508);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(39, 13);
|
||||
this.label1.TabIndex = 37;
|
||||
this.label1.Text = "Поиск";
|
||||
//
|
||||
// findBox
|
||||
//
|
||||
this.findBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.findBox.Location = new System.Drawing.Point(57, 505);
|
||||
this.findBox.Name = "findBox";
|
||||
this.findBox.Size = new System.Drawing.Size(202, 20);
|
||||
this.findBox.TabIndex = 2;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(12, 12);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "Выбрать";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.workButton_Click);
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(93, 12);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 1;
|
||||
this.canceledButton.Text = "Отмена";
|
||||
this.canceledButton.UseVisualStyleBackColor = true;
|
||||
this.canceledButton.Click += new System.EventHandler(this.canceledButton_Click);
|
||||
//
|
||||
// SelectChelForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(352, 551);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.chelGridView);
|
||||
this.Controls.Add(this.dropFindButton);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.findBox);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "SelectChelForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Человек";
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chelGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.DataGridView chelGridView;
|
||||
private System.Windows.Forms.Button dropFindButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox findBox;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
}
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
public partial class SelectChelForm : Form
|
||||
{
|
||||
private Task errDrop;
|
||||
private void ShowError(string msg = null)
|
||||
{
|
||||
errorLabel.Text = string.IsNullOrEmpty(msg) ? "Неизвестная ошибка." : msg;
|
||||
errorLabel.Visible = true;
|
||||
errDrop = new Task(() =>
|
||||
{
|
||||
var fd = errDrop.Id;
|
||||
Task.Delay(5000).Wait();
|
||||
if (errDrop.Id == fd)
|
||||
if (InvokeRequired) Invoke((Action)(() => { errorLabel.Visible = false; }));
|
||||
else errorLabel.Visible = false;
|
||||
});
|
||||
errDrop.Start();
|
||||
}
|
||||
|
||||
private void resetChelTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
chelGridView.Rows.Clear();
|
||||
chelGridView.Columns.Clear();
|
||||
var c = chelGridView.Columns;
|
||||
c.Add("Id", "№");
|
||||
c.Add("FName", "Фамилия");
|
||||
c.Add("SName", "Имя");
|
||||
c.Add("TName", "Отчество");
|
||||
c.Add("Birthday", "Дата рождения");
|
||||
c.Add("Male", "Пол");
|
||||
c[0].Width = 40;
|
||||
c[1].Width = 120;
|
||||
c[1].Width = 120;
|
||||
c[1].Width = 120;
|
||||
c[4].Width = 80;
|
||||
c[5].Width = 80;
|
||||
}
|
||||
{
|
||||
var arr = FuncDB.ListChel(findBox.Text);
|
||||
var r = chelGridView.Rows;
|
||||
foreach (var chel in arr)
|
||||
r.Add(new object[] {
|
||||
chel.Id,
|
||||
chel.FName,
|
||||
chel.SName,
|
||||
chel.TName,
|
||||
chel.Birthday.ToString("yyyy.MM.dd"),
|
||||
chel.Male ? "Муж" : "Жен"
|
||||
});
|
||||
}
|
||||
if (chelGridView.Rows.Count > 0)
|
||||
chelGridView.Rows[0].Selected = true;
|
||||
}
|
||||
catch (Exception e) { ShowError(e.Message); }
|
||||
}
|
||||
private Chel selectedChel()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (chelGridView.SelectedRows.Count != 1) throw new Exception("Человек не выбран.");
|
||||
var chel = FuncDB.GetChel((int)chelGridView.SelectedRows[0].Cells[0].Value);
|
||||
return chel;
|
||||
}
|
||||
catch (Exception e) { ShowError(e.Message); return null; }
|
||||
}
|
||||
|
||||
public bool isCanceled = false;
|
||||
private Chel chel = null;
|
||||
public SelectChelForm(Chel chel = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
resetChelTable();
|
||||
}
|
||||
|
||||
private void workButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
chel = selectedChel();
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
chel = null;
|
||||
ShowError(ex.Message);
|
||||
}
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
isCanceled = true;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
60
SupportForms/WorkChelForm.Designer.cs
generated
60
SupportForms/WorkChelForm.Designer.cs
generated
@ -51,6 +51,9 @@ namespace Diplom_O.SupportForms
|
||||
this.birthdayBox = new System.Windows.Forms.DateTimePicker();
|
||||
this.snilsBox = new System.Windows.Forms.MaskedTextBox();
|
||||
this.innBox = new System.Windows.Forms.MaskedTextBox();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.phoneBox = new System.Windows.Forms.MaskedTextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@ -72,7 +75,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 428);
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 485);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(332, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
@ -89,7 +92,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(245, 402);
|
||||
this.workButton.Location = new System.Drawing.Point(245, 451);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 9;
|
||||
@ -99,7 +102,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(164, 402);
|
||||
this.canceledButton.Location = new System.Drawing.Point(164, 451);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 10;
|
||||
@ -162,7 +165,7 @@ namespace Diplom_O.SupportForms
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(12, 145);
|
||||
this.label6.Location = new System.Drawing.Point(60, 145);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(38, 13);
|
||||
this.label6.TabIndex = 34;
|
||||
@ -171,7 +174,7 @@ namespace Diplom_O.SupportForms
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(12, 249);
|
||||
this.label7.Location = new System.Drawing.Point(67, 275);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(31, 13);
|
||||
this.label7.TabIndex = 35;
|
||||
@ -180,7 +183,7 @@ namespace Diplom_O.SupportForms
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(12, 275);
|
||||
this.label8.Location = new System.Drawing.Point(53, 301);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(45, 13);
|
||||
this.label8.TabIndex = 36;
|
||||
@ -189,7 +192,7 @@ namespace Diplom_O.SupportForms
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(12, 301);
|
||||
this.label9.Location = new System.Drawing.Point(48, 327);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(50, 13);
|
||||
this.label9.TabIndex = 37;
|
||||
@ -205,7 +208,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
// pasportBox
|
||||
//
|
||||
this.pasportBox.Location = new System.Drawing.Point(104, 298);
|
||||
this.pasportBox.Location = new System.Drawing.Point(104, 324);
|
||||
this.pasportBox.Name = "pasportBox";
|
||||
this.pasportBox.Size = new System.Drawing.Size(216, 98);
|
||||
this.pasportBox.TabIndex = 8;
|
||||
@ -233,7 +236,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
// snilsBox
|
||||
//
|
||||
this.snilsBox.Location = new System.Drawing.Point(104, 272);
|
||||
this.snilsBox.Location = new System.Drawing.Point(104, 298);
|
||||
this.snilsBox.Mask = "000-000-000 00";
|
||||
this.snilsBox.Name = "snilsBox";
|
||||
this.snilsBox.Size = new System.Drawing.Size(216, 20);
|
||||
@ -241,18 +244,48 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
// innBox
|
||||
//
|
||||
this.innBox.Location = new System.Drawing.Point(104, 246);
|
||||
this.innBox.Location = new System.Drawing.Point(104, 272);
|
||||
this.innBox.Mask = "000000000000";
|
||||
this.innBox.Name = "innBox";
|
||||
this.innBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.innBox.TabIndex = 6;
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.AutoSize = true;
|
||||
this.checkBox1.Location = new System.Drawing.Point(104, 428);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(82, 17);
|
||||
this.checkBox1.TabIndex = 38;
|
||||
this.checkBox1.Text = "Пенсионер";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// phoneBox
|
||||
//
|
||||
this.phoneBox.Location = new System.Drawing.Point(104, 246);
|
||||
this.phoneBox.Mask = "+7(000)000-00-00";
|
||||
this.phoneBox.Name = "phoneBox";
|
||||
this.phoneBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.phoneBox.TabIndex = 39;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(46, 249);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(52, 13);
|
||||
this.label10.TabIndex = 40;
|
||||
this.label10.Text = "Телефон";
|
||||
//
|
||||
// WorkChelForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(332, 450);
|
||||
this.ClientSize = new System.Drawing.Size(332, 507);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.phoneBox);
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Controls.Add(this.innBox);
|
||||
this.Controls.Add(this.snilsBox);
|
||||
this.Controls.Add(this.birthdayBox);
|
||||
@ -310,5 +343,8 @@ namespace Diplom_O.SupportForms
|
||||
private System.Windows.Forms.DateTimePicker birthdayBox;
|
||||
private System.Windows.Forms.MaskedTextBox snilsBox;
|
||||
private System.Windows.Forms.MaskedTextBox innBox;
|
||||
}
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.MaskedTextBox phoneBox;
|
||||
private System.Windows.Forms.Label label10;
|
||||
}
|
||||
}
|
@ -13,22 +13,6 @@ namespace Diplom_O.SupportForms
|
||||
{
|
||||
public partial class WorkChelForm : Form
|
||||
{
|
||||
private Task errDrop;
|
||||
private void ShowError(string msg = null)
|
||||
{
|
||||
errorLabel.Text = string.IsNullOrEmpty(msg) ? "Неизвестная ошибка." : msg;
|
||||
errorLabel.Visible = true;
|
||||
errDrop = new Task(() =>
|
||||
{
|
||||
var fd = errDrop.Id;
|
||||
Task.Delay(5000).Wait();
|
||||
if (errDrop.Id == fd)
|
||||
if (InvokeRequired) Invoke((Action)(() => { errorLabel.Visible = false; }));
|
||||
else errorLabel.Visible = false;
|
||||
});
|
||||
errDrop.Start();
|
||||
}
|
||||
|
||||
public bool isCanceled = false;
|
||||
private Chel chel = null;
|
||||
public WorkChelForm(Chel chel = null)
|
||||
@ -48,14 +32,16 @@ namespace Diplom_O.SupportForms
|
||||
maleBox.SelectedIndex = chel.Male ? 0 : 1;
|
||||
birthdayBox.Value = chel.Birthday;
|
||||
addressBox.Text = chel.Address;
|
||||
phoneBox.Text = chel.Phone;
|
||||
innBox.Text = chel.INN;
|
||||
snilsBox.Text = chel.SNILS;
|
||||
pasportBox.Text = chel.Pasport;
|
||||
checkBox1.Checked = chel.Pensia;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ShowError(e.Message);
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
workButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
@ -64,39 +50,34 @@ namespace Diplom_O.SupportForms
|
||||
{
|
||||
try
|
||||
{
|
||||
if (maleBox.SelectedIndex == -1) throw new Exception("Пол не указан.");
|
||||
if (maleBox.SelectedIndex == -1)
|
||||
throw new Exception("Пол не указан.");
|
||||
var _chel = new Chel();
|
||||
_chel.FName = fNameBox.Text;
|
||||
_chel.SName = sNameBox.Text;
|
||||
_chel.TName = tNameBox.Text;
|
||||
_chel.Male = maleBox.SelectedIndex == 0;
|
||||
_chel.Birthday = birthdayBox.Value;
|
||||
_chel.Address = addressBox.Text;
|
||||
_chel.Phone = phoneBox.Text;
|
||||
_chel.INN = innBox.Text;
|
||||
_chel.SNILS = snilsBox.Text;
|
||||
_chel.Pasport = pasportBox.Text;
|
||||
_chel.Pensia = checkBox1.Checked;
|
||||
FuncDB.ChelCheckValid(_chel);
|
||||
if (chel == null)
|
||||
{
|
||||
var s = new Chel()
|
||||
{
|
||||
FName = fNameBox.Text,
|
||||
SName = sNameBox.Text,
|
||||
TName = tNameBox.Text,
|
||||
Male = maleBox.SelectedIndex == 0,
|
||||
Birthday = birthdayBox.Value,
|
||||
Address = addressBox.Text,
|
||||
INN = innBox.Text,
|
||||
SNILS = snilsBox.Text,
|
||||
Pasport = pasportBox.Text
|
||||
};
|
||||
FuncDB.AddChel(s);
|
||||
}
|
||||
FuncDB.ChelAdd(_chel);
|
||||
else
|
||||
{
|
||||
chel.FName = fNameBox.Text;
|
||||
chel.SName = sNameBox.Text;
|
||||
chel.TName = tNameBox.Text;
|
||||
chel.Male = maleBox.SelectedIndex == 0;
|
||||
chel.Birthday = birthdayBox.Value;
|
||||
chel.Address = addressBox.Text;
|
||||
chel.INN = innBox.Text;
|
||||
chel.SNILS = snilsBox.Text;
|
||||
chel.Pasport = pasportBox.Text;
|
||||
FuncDB.ChangeChel(chel);
|
||||
{
|
||||
_chel.Id = chel.Id;
|
||||
FuncDB.ChelChange(_chel);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex) { ShowError(ex.Message); }
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
10
SupportForms/WorkShtatForm.Designer.cs
generated
10
SupportForms/WorkShtatForm.Designer.cs
generated
@ -60,7 +60,7 @@ namespace Diplom_O.SupportForms
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel,
|
||||
this.busySizeLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 90);
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 94);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(262, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
@ -102,7 +102,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(175, 64);
|
||||
this.workButton.Location = new System.Drawing.Point(174, 64);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 2;
|
||||
@ -112,7 +112,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(94, 64);
|
||||
this.canceledButton.Location = new System.Drawing.Point(93, 64);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 3;
|
||||
@ -124,7 +124,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(262, 112);
|
||||
this.ClientSize = new System.Drawing.Size(262, 116);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
@ -156,5 +156,5 @@ namespace Diplom_O.SupportForms
|
||||
private System.Windows.Forms.Button workButton;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
private System.Windows.Forms.ToolStripStatusLabel busySizeLabel;
|
||||
}
|
||||
}
|
||||
}
|
@ -13,24 +13,9 @@ namespace Diplom_O.SupportForms
|
||||
{
|
||||
public partial class WorkShtatForm : Form
|
||||
{
|
||||
private Task errDrop;
|
||||
private void ShowError(string msg = null)
|
||||
{
|
||||
errorLabel.Text = string.IsNullOrEmpty(msg) ? "Неизвестная ошибка." : msg;
|
||||
errorLabel.Visible = true;
|
||||
errDrop = new Task(() =>
|
||||
{
|
||||
var fd = errDrop.Id;
|
||||
Task.Delay(5000).Wait();
|
||||
if (errDrop.Id == fd)
|
||||
if (InvokeRequired) Invoke((Action)(() => { errorLabel.Visible = false; }));
|
||||
else errorLabel.Visible = false;
|
||||
});
|
||||
errDrop.Start();
|
||||
}
|
||||
|
||||
public bool isCanceled = false;
|
||||
private Shtat shtat = null;
|
||||
|
||||
public WorkShtatForm(Shtat shtat = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -42,12 +27,13 @@ namespace Diplom_O.SupportForms
|
||||
workButton.Text = "Изменить";
|
||||
doljBox.Text = shtat.Doljnost;
|
||||
kolvoBox.Text = shtat.Size.ToString();
|
||||
busySizeLabel.Text = "Занято: " + FuncDB.BusySizeShtat(shtat.Id);
|
||||
busySizeLabel.Text = "Занято: " + (shtat.Size - FuncDB.ShtatFreeSpaceById(shtat.Id));
|
||||
busySizeLabel.Visible = true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ShowError(e.Message);
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
workButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
@ -56,21 +42,24 @@ namespace Diplom_O.SupportForms
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!int.TryParse(kolvoBox.Text, out int kolvo)) throw new Exception("Ошибка указания количества.");
|
||||
if (string.IsNullOrEmpty(doljBox.Text))
|
||||
throw new Exception("Ошибка указания должности.");
|
||||
if (!int.TryParse(kolvoBox.Text, out int kolvo))
|
||||
throw new Exception("Ошибка указания количества.");
|
||||
if (shtat == null)
|
||||
{
|
||||
var s = new Shtat() { Doljnost = doljBox.Text, Size = kolvo };
|
||||
FuncDB.AddShtat(s);
|
||||
FuncDB.ShtatAdd(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
shtat.Doljnost = doljBox.Text;
|
||||
shtat.Size = kolvo;
|
||||
FuncDB.ChangeShtat(shtat);
|
||||
FuncDB.ShtatChange(shtat);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex) { ShowError(ex.Message); }
|
||||
catch (Exception ex) { this.ShowError(errorLabel, ex.Message); }
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
252
SupportForms/WorkerForm.Designer.cs
generated
Normal file
252
SupportForms/WorkerForm.Designer.cs
generated
Normal file
@ -0,0 +1,252 @@
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
partial class WorkerForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.workButton = new System.Windows.Forms.Button();
|
||||
this.canceledButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.linkSelectFIO = new System.Windows.Forms.LinkLabel();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
|
||||
this.tabNumBox = new System.Windows.Forms.TextBox();
|
||||
this.linkDolj = new System.Windows.Forms.LinkLabel();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 253);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(332, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// errorLabel
|
||||
//
|
||||
this.errorLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.errorLabel.ForeColor = System.Drawing.Color.Red;
|
||||
this.errorLabel.Name = "errorLabel";
|
||||
this.errorLabel.Size = new System.Drawing.Size(57, 17);
|
||||
this.errorLabel.Text = "Ошибка.";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(248, 191);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 9;
|
||||
this.workButton.Text = "Добавить";
|
||||
this.workButton.UseVisualStyleBackColor = true;
|
||||
this.workButton.Click += new System.EventHandler(this.workButton_Click);
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(167, 191);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 10;
|
||||
this.canceledButton.Text = "Отмена";
|
||||
this.canceledButton.UseVisualStyleBackColor = true;
|
||||
this.canceledButton.Click += new System.EventHandler(this.canceledButton_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(17, 15);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(81, 13);
|
||||
this.label1.TabIndex = 29;
|
||||
this.label1.Text = "Фамилия И.О.";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(23, 93);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(78, 13);
|
||||
this.label2.TabIndex = 30;
|
||||
this.label2.Text = "Табельный №";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(39, 145);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(62, 13);
|
||||
this.label4.TabIndex = 32;
|
||||
this.label4.Text = "Конец раб.";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(33, 116);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(68, 13);
|
||||
this.label5.TabIndex = 33;
|
||||
this.label5.Text = "Начало раб.";
|
||||
//
|
||||
// linkSelectFIO
|
||||
//
|
||||
this.linkSelectFIO.AutoSize = true;
|
||||
this.linkSelectFIO.Location = new System.Drawing.Point(104, 15);
|
||||
this.linkSelectFIO.Name = "linkSelectFIO";
|
||||
this.linkSelectFIO.Size = new System.Drawing.Size(110, 13);
|
||||
this.linkSelectFIO.TabIndex = 38;
|
||||
this.linkSelectFIO.TabStop = true;
|
||||
this.linkSelectFIO.Text = "Выбрать человека...";
|
||||
this.linkSelectFIO.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkSelectFIO_LinkClicked);
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.CustomFormat = "yyyy.MM.dd";
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(107, 116);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(216, 20);
|
||||
this.dateTimePicker1.TabIndex = 40;
|
||||
//
|
||||
// dateTimePicker2
|
||||
//
|
||||
this.dateTimePicker2.CustomFormat = "yyyy.MM.dd";
|
||||
this.dateTimePicker2.Location = new System.Drawing.Point(107, 142);
|
||||
this.dateTimePicker2.Name = "dateTimePicker2";
|
||||
this.dateTimePicker2.Size = new System.Drawing.Size(216, 20);
|
||||
this.dateTimePicker2.TabIndex = 41;
|
||||
//
|
||||
// tabNumBox
|
||||
//
|
||||
this.tabNumBox.Location = new System.Drawing.Point(107, 90);
|
||||
this.tabNumBox.Name = "tabNumBox";
|
||||
this.tabNumBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.tabNumBox.TabIndex = 1;
|
||||
//
|
||||
// linkDolj
|
||||
//
|
||||
this.linkDolj.AutoSize = true;
|
||||
this.linkDolj.Location = new System.Drawing.Point(104, 67);
|
||||
this.linkDolj.Name = "linkDolj";
|
||||
this.linkDolj.Size = new System.Drawing.Size(118, 13);
|
||||
this.linkDolj.TabIndex = 43;
|
||||
this.linkDolj.TabStop = true;
|
||||
this.linkDolj.Text = "Выбрать должность...";
|
||||
this.linkDolj.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkDolj_LinkClicked);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(33, 67);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(65, 13);
|
||||
this.label3.TabIndex = 44;
|
||||
this.label3.Text = "Должность";
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.AutoSize = true;
|
||||
this.checkBox1.Location = new System.Drawing.Point(189, 168);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(134, 17);
|
||||
this.checkBox1.TabIndex = 45;
|
||||
this.checkBox1.Text = "По настоящее время";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
|
||||
//
|
||||
// checkBox2
|
||||
//
|
||||
this.checkBox2.AutoSize = true;
|
||||
this.checkBox2.Location = new System.Drawing.Point(194, 40);
|
||||
this.checkBox2.Name = "checkBox2";
|
||||
this.checkBox2.Size = new System.Drawing.Size(126, 17);
|
||||
this.checkBox2.TabIndex = 49;
|
||||
this.checkBox2.Text = "Иное место работы";
|
||||
this.checkBox2.UseVisualStyleBackColor = true;
|
||||
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
|
||||
//
|
||||
// WorkerForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(332, 275);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.checkBox2);
|
||||
this.Controls.Add(this.checkBox1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.linkDolj);
|
||||
this.Controls.Add(this.dateTimePicker2);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.linkSelectFIO);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.tabNumBox);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "WorkerForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Сотрудник";
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.Button workButton;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.LinkLabel linkSelectFIO;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker2;
|
||||
private System.Windows.Forms.TextBox tabNumBox;
|
||||
private System.Windows.Forms.LinkLabel linkDolj;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.CheckBox checkBox2;
|
||||
}
|
||||
}
|
169
SupportForms/WorkerForm.cs
Normal file
169
SupportForms/WorkerForm.cs
Normal file
@ -0,0 +1,169 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Diplom_O.DataBase;
|
||||
|
||||
namespace Diplom_O.SupportForms
|
||||
{
|
||||
public partial class WorkerForm : Form
|
||||
{
|
||||
private Chel chel = null;
|
||||
private void ResetLinkFIO()
|
||||
{
|
||||
if (chel == null)
|
||||
{
|
||||
linkSelectFIO.Text = "Выбрать человека...";
|
||||
return;
|
||||
}
|
||||
var res = chel.FName.ToString() + " " +
|
||||
chel.SName[0].ToString() + "." +
|
||||
((!string.IsNullOrEmpty(chel.TName)) ?
|
||||
chel.TName[0].ToString() + "." : "");
|
||||
linkSelectFIO.Text = res;
|
||||
}
|
||||
|
||||
private int? shtatId = null;
|
||||
private void ResetLinkShtat()
|
||||
{
|
||||
if (shtatId == null)
|
||||
{
|
||||
linkDolj.Text = "Выбрать должность...";
|
||||
return;
|
||||
}
|
||||
var res = FuncDB.ShtatGetById(shtatId.Value)?.Doljnost;
|
||||
linkDolj.Text = res;
|
||||
}
|
||||
|
||||
public bool isCanceled = false;
|
||||
private Rabotnik rabotnik = null;
|
||||
public WorkerForm(Rabotnik rabotnik = null, bool create = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
try
|
||||
{
|
||||
ResetLinkFIO();
|
||||
ResetLinkShtat();
|
||||
tabNumBox.Text = "";
|
||||
dateTimePicker1.Value = DateTime.Now;
|
||||
dateTimePicker2.Value = DateTime.Now;
|
||||
|
||||
if (rabotnik == null) return;
|
||||
|
||||
|
||||
chel = FuncDB.ChelGetById(rabotnik.ChelId);
|
||||
ResetLinkFIO();
|
||||
linkSelectFIO.Enabled = false;
|
||||
|
||||
if (create)
|
||||
return;
|
||||
|
||||
this.rabotnik = rabotnik;
|
||||
workButton.Text = "Изменить";
|
||||
chel = FuncDB.ChelGetById(rabotnik.ChelId);
|
||||
ResetLinkFIO();
|
||||
if (checkBox2.Checked)
|
||||
shtatId = null;
|
||||
else
|
||||
shtatId = FuncDB.ShtatGetById(rabotnik.ShtatId.Value).Id;
|
||||
ResetLinkShtat();
|
||||
tabNumBox.Text = rabotnik.TabNum;
|
||||
dateTimePicker1.Value = rabotnik.Start;
|
||||
if (rabotnik.End.HasValue)
|
||||
{
|
||||
checkBox1.Checked = false;
|
||||
dateTimePicker2.Value = rabotnik.End.Value;
|
||||
}
|
||||
else
|
||||
checkBox1.Checked = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShowError(errorLabel, e.Message);
|
||||
workButton.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void linkSelectFIO_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var form = new ChelForm(true);
|
||||
form.ShowDialog();
|
||||
if (form.isCanceled)
|
||||
chel = null;
|
||||
else
|
||||
chel = form.formResult;
|
||||
ResetLinkFIO();
|
||||
}
|
||||
private void linkDolj_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var form = new ShtatForm(true);
|
||||
form.ShowDialog();
|
||||
if (form.isCanceled)
|
||||
shtatId = null;
|
||||
else
|
||||
shtatId = form.formResult.Id;
|
||||
ResetLinkShtat();
|
||||
}
|
||||
private void workButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (chel == null)
|
||||
throw new Exception("Не выбран человек.");
|
||||
if (!checkBox2.Checked && !shtatId.HasValue)
|
||||
throw new Exception("Не выбрана должность.");
|
||||
DateTime start = dateTimePicker1.Value;
|
||||
start = new DateTime(start.Year, start.Month, start.Day, 0, 0, 0);
|
||||
DateTime? end = null;
|
||||
if (!checkBox1.Checked)
|
||||
{
|
||||
end = dateTimePicker2.Value;
|
||||
end = new DateTime(end.Value.Year, end.Value.Month, end.Value.Day, 23, 59, 59);
|
||||
}
|
||||
|
||||
var _rabotnik = new Rabotnik()
|
||||
{
|
||||
ChelId = chel.Id,
|
||||
ShtatId = checkBox2.Checked ? null : shtatId,
|
||||
AnotherWork = checkBox2.Checked,
|
||||
TabNum = checkBox2.Checked ? "" : tabNumBox.Text,
|
||||
Start = start,
|
||||
End = end
|
||||
};
|
||||
if (rabotnik == null)
|
||||
FuncDB.RabotnikAdd(_rabotnik);
|
||||
else
|
||||
{
|
||||
_rabotnik.Id = rabotnik.Id;
|
||||
FuncDB.RabotnikChange(_rabotnik);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.ShowError(errorLabel, ex.Message);
|
||||
}
|
||||
}
|
||||
private void canceledButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
isCanceled = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
dateTimePicker2.Enabled = !checkBox1.Checked;
|
||||
}
|
||||
|
||||
private void checkBox2_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
linkDolj.Enabled = !checkBox2.Checked;
|
||||
tabNumBox.Enabled = !checkBox2.Checked;
|
||||
}
|
||||
}
|
||||
}
|
123
SupportForms/WorkerForm.resx
Normal file
123
SupportForms/WorkerForm.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/Release/Diplom O.exe
Normal file
BIN
bin/Release/Diplom O.exe
Normal file
Binary file not shown.
BIN
bin/Release/Diplom O.pdb
Normal file
BIN
bin/Release/Diplom O.pdb
Normal file
Binary file not shown.
BIN
bin/Release/Diplom_O.db
Normal file
BIN
bin/Release/Diplom_O.db
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user