public Agent SetAgentAllotmentsDetails(Agent agent, DateTime startDate, DateTime endDate, int qty, int cutOff) { var alloment = Allotment.CreateNew(agent, startDate, endDate, qty, cutOff); Allotments.Add(alloment); return(this); }
public static Allotment CreateNew(Agent agent, DateTime startDate, DateTime endDate, int qty, int cutOff) { var obj = new Allotment { Agent = agent, StartDate = startDate, EndDate = endDate, Qty = qty, CutOff = cutOff, State = AllotmentState.Active, }; return(obj); }