Here's the class:
Code:
public class ProductionLaborTransaction : IEntity
{
private int id = EntityHelper.UnsavedIdentityValue;
private Employee employee;
private DateTime day;
private ProductionTask task;
private Product product;
private DateTime transactionDate;
private string submitter;
private int minutes;
private int units;
private string comments;
#region IEntity Members
public int Id
{
get
{
return this.id;
}
}
#endregion
public Employee Employee
{
get { return employee; }
}
public ProductionTask Task
{
get { return task; }
}
public Product Product
{
get { return product; }
}
public DateTime Day
{
get { return day; }
}
public DateTime TransactionDate
{
get { return transactionDate; }
}
public string Submitter
{
get { return this.submitter; }
}
public int Minutes
{
get { return this.minutes; }
}
public int Units
{
get{return this.units;}
}
public string Comments
{
get { return comments; }
}
public ProductionLaborTransaction CreateOffset(DateTime transactionDate)
{
return new ProductionLaborTransaction(
this.employee, this.day, this.task, this.product, DateTime.Now, string.Empty,
this.minutes * -1, this.units * -1, string.Empty);
}
public ProductionLaborTransaction(
Employee employee,
DateTime day,
ProductionTask task,
Product product,
DateTime transactionDate,
string submitter,
int minutes,
int units,
string comments)
{
Validator.ValidateParameter(employee, "employee");
Validator.ValidateParameter(task, "task");
Validator.ValidateParameter(product, "product");
Validator.ValidateParameter(comments, "comments", true);
this.employee = employee;
this.day = day;
this.task = task;
this.product = product;
this.transactionDate = transactionDate;
this.submitter = submitter;
this.minutes = minutes;
this.units = units;
this.comments = comments;
}
private ProductionLaborTransaction()
{
}
}