Exemplo n.º 1
0
 /// <summary>
 /// Constructs an employee
 /// </summary>
 /// <param name="firstName">First name of an employee</param>
 /// <param name="lastName">Last name of an employee</param>
 /// <param name="city">City of an employee</param>
 /// <param name="type">EmployeeType of an employee</param>
 /// <param name="task">CompanyTask's ID of an employee</param>
 public Employee(string firstName, string lastName, string city, EmployeeType type, int?task = null)
 {
     Checks.CheckLength(firstName, "First Name", 0, 30);
     Checks.CheckLength(lastName, "Last Name", 0, 30);
     Checks.CheckLength(city, "City", 0, 30);
     FirstName = firstName;
     LastName  = lastName;
     City      = city;
     Type      = type;
     TaskID    = task;
 }
 /// <summary>
 /// Constructs a task with creation date set to the moment of creation
 /// </summary>
 /// <param name="name">Name of a task</param>
 /// <param name="desc">Description of a task</param>
 /// <param name="deadline">Deadline of a task</param>
 /// <param name="product">Product's ID of a task</param>
 /// <param name="finished">Status of a task</param>
 public CompanyTask(string name, string desc, DateTime deadline, int?product = null, bool finished = false) : this()
 {
     Checks.CheckLength(name, "Name", 0, 30);
     Checks.CheckLength(desc, "Description", 0, 100);
     if (deadline < CreatedAt)
     {
         throw new ArgumentException("Deadline can't be lesser than creation date.");
     }
     Name        = name;
     Description = desc;
     Deadline    = deadline;
     ProductID   = product;
     Finished    = finished;
 }
 /// <summary>
 /// Constructs a new ProductTarget
 /// </summary>
 /// <param name="name">Name of the target</param>
 public ProductTarget(string name)
 {
     Checks.CheckLength(name, "Name", 0, 30);
     Name = name;
 }