Advertisement
Guest User

Untitled

a guest
May 7th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace KR2
  7. {
  8.     public enum Form { ООО, ЗАО, ОАО, Unknown }
  9.  
  10.     public class Employee
  11.     {
  12.         private string _name;
  13.         private string _surname;
  14.         private string _position;
  15.         private DateTime _work;
  16.  
  17.         public Employee(string name, string surname, string position, DateTime work)
  18.         {
  19.             _name = name;
  20.             _surname = surname;
  21.             _position = position;
  22.             _work = work;
  23.         }
  24.  
  25.         public Employee() : this("UnknownName", "UnknownSurname", "UnknownPosition", DateTime.Now)
  26.         {
  27.         }
  28.  
  29.         public DateTime Work
  30.         {
  31.             get
  32.             {
  33.                 return _work;
  34.             }
  35.             set
  36.             {
  37.                 _work = value;
  38.             }
  39.         }
  40.  
  41.         public string Name
  42.         {
  43.             get
  44.             {
  45.                 return _name;
  46.             }
  47.             set
  48.             {
  49.                 _name = value;
  50.             }
  51.         }
  52.  
  53.         public string Surname
  54.         {
  55.             get
  56.             {
  57.                 return _surname;
  58.             }
  59.             set
  60.             {
  61.                 _surname = value;
  62.             }
  63.         }
  64.  
  65.         public string Position
  66.         {
  67.             get
  68.             {
  69.                 return _position;
  70.             }
  71.             set
  72.             {
  73.                 _position = value;
  74.             }
  75.         }
  76.  
  77.         public int Year
  78.         {
  79.             get
  80.             {
  81.                 return _work.Year;
  82.             }
  83.             set
  84.             {
  85.                 _work = new DateTime(value, _work.Month, _work.Day);
  86.             }
  87.         }
  88.  
  89.         public override string ToString()
  90.         {
  91.             return String.Format("Имя: {0}\n Фамилия: {1}\n Должность: {2}\n Дата принятия на работу: {3}", _name, _surname, _position, _work);
  92.         }
  93.  
  94.         public virtual string ToShortString()
  95.         {
  96.             return String.Format("Имя: {0}\n Фамилия: {1}", _name, _surname);
  97.         }
  98.  
  99.     }
  100.  
  101.     public class Organisation
  102.     {
  103.         private string _orgname;
  104.         private int _regnum;
  105.         private Form _form;
  106.         private Employee[] _emp;
  107.  
  108.         public Organisation(string orgname, int regnum, Form form)
  109.         {
  110.             _orgname = orgname;
  111.             _regnum = regnum;
  112.             _form = form;
  113.         }
  114.  
  115.         public Organisation() : this("UnknownOrgName", Convert.ToInt32("UnknownRegNum") , Form.Unknown)
  116.         {
  117.         }
  118.  
  119.         public string OrgName
  120.         {
  121.             get
  122.             {
  123.                 return _orgname;
  124.             }
  125.             set
  126.             {
  127.                 _orgname = value;
  128.             }
  129.         }
  130.  
  131.         public int RegNum
  132.         {
  133.             get
  134.             {
  135.                 return _regnum;
  136.             }
  137.             set
  138.             {
  139.                 _regnum = value;
  140.             }
  141.         }
  142.  
  143.         public Form FormForm
  144.         {
  145.             get
  146.             {
  147.                 return _form;
  148.             }
  149.             set
  150.             {
  151.                 _form = value;
  152.             }
  153.         }
  154.  
  155.         public Employee[] Emp
  156.         {
  157.             get
  158.             {
  159.                 return _emp;
  160.             }
  161.             set
  162.             {
  163.                 _emp = value;
  164.             }
  165.         }
  166.  
  167.         public Employee minDate
  168.         {
  169.             get
  170.             {
  171.                 return (minDate(DateTime.MinValue));
  172.             }
  173.         }
  174.  
  175.   //     Вот до сюда я дошел      
  176.  
  177.       }
  178.  
  179.     class Program
  180.     {
  181.         static void Main(string[] args)
  182.         {
  183.         }
  184.     }
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement