protected override bool RecordServiceHistory() { StartHistory h = new StartHistory(); AssignToStartHistory(h); foreach (StartDetail sd in Details) { StartHistoryDetail hd = new StartHistoryDetail(); AssignStartDetailToStartHistoryDetail(sd, hd); hd.ServiceHistorySummary = h; ObjScope.Add(hd); } ObjScope.Add(h); return true; }
protected virtual void AssignStartDetailToStartHistoryDetail(StartDetail s, StartHistoryDetail t) { t.ContainerName = s.ContainerName; t.ContainerLevel = ResolveCDO("ContainerLevel", s.ContainerLevel_Name) as ContainerLevel; t.ContainerStatus = ResolveCDO("ContainerStatus", s.ContainerStatus_Name) as ContainerStatus; t.DueDate = s.DueDate; t.Qty = s.Qty; t.UOM = ResolveCDO("UOM", s.UOM_Name) as UOM; t.Product = ResolveCDO("Product", s.Product_Revision) as Product; if (t.Product != null) { if (t.Qty == 0) { t.Qty = t.Product.StdStartedQty; t.UOM = t.Product.StdStartedUOM; } } }