protected bool CloseContainerWhenEmpty(Container co) { if (co.Qty > 0) return false; co.ContainerStatus = ResolveCDO("ContainerStatus", "Closed") as ContainerStatus; return true; }
public void T050_Hold_LOT1() { Hold s = new Hold(); Container co = new Container(); co.ContainerName = "LOT1"; s.Container = co; Assert.IsTrue(s.ExecuteService(), s.CompletionMessage); }
protected override bool ModifyEntity() { bool success = base.ModifyEntity(); foreach (SerializeDetail d in serializeDetail) { UO_Model.Execution.Container co = new UO_Model.Execution.Container(); Container.AssignToContainer(co); AssignSerializeDetailsToChildContainer(d, co); Container.Qty -= d.ChildQty; ObjScope.Add(co); } return(success); }
protected override bool ModifyEntity() { bool success = base.ModifyEntity(); foreach (SplitDetail d in ToContainerDetails) { UO_Model.Execution.Container co = new UO_Model.Execution.Container(); Container.AssignToContainer(co); co.ContainerName = d.ContainerName; co.Qty = d.Qty; Container.Qty -= d.Qty; ObjScope.Add(co); } if (true == CloseWhenEmpty) { CloseContainerWhenEmpty(this.Container); } return(success); }
protected override bool ModifyEntity() { bool success = base.ModifyEntity(); foreach (CombineFromDetail d in FromContainerDetails) { UO_Model.Execution.Container fromContainer = ResolveContainer(d.FromContainerName); if (true == d.CombineAllQty) { this.Container.Qty += fromContainer.Qty; fromContainer.Qty = 0; } else { this.Container.Qty += d.Qty; fromContainer.Qty -= d.Qty; } if (true == this.CloseWhenEmpty && true == d.CloseWhenEmpty) { CloseContainerWhenEmpty(fromContainer); } } return(success); }
public void T120_Associate_LOT1() { Associate s = new Associate(); Container co = new Container(); co.ContainerName = "LOT1"; s.Container = co; AssociateDetail sd; sd = new AssociateDetail(); sd.ChildContainerName = "LOT1-1"; s.InsertDetail(sd); sd = new AssociateDetail(); sd.ChildContainerName = "LOT1-2"; s.InsertDetail(sd); Assert.IsTrue(s.ExecuteService(), s.CompletionMessage); }
public void T110_Defect_LOT1() { Defect s = new Defect(); Container co = new Container(); co.ContainerName = "LOT1"; s.Container = co; DefectDetail d = new DefectDetail(); d.DefectQty = 1; s.InsertDetail(d); Assert.IsTrue(s.ExecuteService(), s.CompletionMessage); }
public void T100_Combine_LOT1() { Combine s = new Combine(); Container co = new Container(); co.ContainerName = "LOT1"; s.Container = co; s.CloseWhenEmpty = true; CombineFromDetail d = new CombineFromDetail(); d.FromContainerName = "LOT1-1"; d.Qty = 1; s.InsertDetail(d); d = new CombineFromDetail(); d.FromContainerName = "LOT1-2"; d.CombineAllQty = true; s.InsertDetail(d); Assert.IsTrue(s.ExecuteService(), s.CompletionMessage); }
public void T090_Split_LOT1() { Split s = new Split(); Container co = new Container(); co.ContainerName = "LOT1"; s.Container = co; s.CloseWhenEmpty = false; SplitDetail d = new SplitDetail(); d.ContainerName = "LOT1-1"; d.Qty = 2; s.InsertDetail(d); d = new SplitDetail(); d.ContainerName = "LOT1-2"; d.Qty = 2; s.InsertDetail(d); Assert.IsTrue(s.ExecuteService(), s.CompletionMessage); }
private void InsertFullDetails(Container co) { foreach (Container child in co.ChildContainers) { DisassociateDetail sd = new DisassociateDetail(); sd.ChildContainerName = child.ContainerName; InsertDetail(sd); } }
protected override bool ModifyEntity() { bool success = true; CurrentStatus cs_temp = new CurrentStatus(); AssignToCurrentStatus(cs_temp); CurrentStatus cs = ResolveCurrentStatus(cs_temp); if (cs == null) { ObjScope.Add(cs_temp); cs = cs_temp; } foreach (StartDetail sd in Details) { Container co = new Container(); co.CurrentStatus = cs; AssignToContainer(co); AssignStartDetailsToContainer(sd,co); ObjScope.Add(co); if (null != MfgOrder) MfgOrder.ReleasedQty += co.Qty; } return success; }
protected virtual void AssignToContainer(Container t) { t.StartReason = this.StartReason; t.LastActivityDate = HistoryMainLine.TxnDate; }
protected virtual void AssignStartDetailsToContainer(StartDetail s, Container 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; } } }
public virtual void AssignToContainer(Container t) { t.ContainerName = this.ContainerName; t.ContainerLevel = this.ContainerLevel; t.Qty = this.Qty; t.CurrentHoldCount = this.CurrentHoldCount; t.ContainerStatus = this.ContainerStatus; t.DueDate = this.DueDate; t.UOM = this.UOM; t.Product = this.Product; t.CurrentStatus = this.CurrentStatus; t.StartReason = this.StartReason; t.Parent = this.Parent; // TODO: How to deal with child container need implement // t.ChildContainers = this.ChildContainers; }
public void T140_CollectData_LOT1() { CollectData s = new CollectData(); Container co = new Container(); co.ContainerName = "LOT1"; s.Container = co; CollectDataDetail d = new CollectDataDetail(); // d stands for detail d.DataCollectionDef_Name = "WIPData(r1)"; d.DataCollectionValue = "10"; s.InsertDetail(d); Assert.IsTrue(s.ExecuteService(), s.CompletionMessage); }
public void T150_ComponentIssue() { ComponentIssue s = new ComponentIssue(); Container co = new Container(); co.ContainerName = "LOT1"; s.Container = co; ComponentIssueDetail d = new ComponentIssueDetail(); // d stands for detail d.IssueControl = 1; d.Product_Name = "ProductA(r2)"; d.Container_Name = "LOT1"; d.ActualQtyIssued = 2; s.InsertDetail(d); Assert.IsTrue(s.ExecuteService(), s.CompletionMessage); }
protected virtual void AssignSerializeDetailsToChildContainer(SerializeDetail s, Container t) { t.ContainerName = s.ChildContainerName; t.Qty = s.ChildQty; t.Parent = this.Container; }
public void T070_Release_LOT1() { Release s = new Release(); Container co = new Container(); co.ContainerName = "LOT1"; s.Container = co; Assert.IsTrue(s.ExecuteService(), s.CompletionMessage); }
protected override bool ModifyEntity() { bool success = base.ModifyEntity(); foreach (SerializeDetail d in serializeDetail) { UO_Model.Execution.Container co = new UO_Model.Execution.Container(); Container.AssignToContainer(co); AssignSerializeDetailsToChildContainer(d, co); Container.Qty -= d.ChildQty; ObjScope.Add(co); } return success; }
protected override bool ModifyEntity() { bool success = base.ModifyEntity(); foreach (SplitDetail d in ToContainerDetails) { UO_Model.Execution.Container co = new UO_Model.Execution.Container(); Container.AssignToContainer(co); co.ContainerName = d.ContainerName; co.Qty = d.Qty; Container.Qty -= d.Qty; ObjScope.Add(co); } if (true == CloseWhenEmpty) CloseContainerWhenEmpty(this.Container); return success; }
protected HoldReleaseHistory ResolveHoldHistory(Container co) { object res = null; IQuery oqlQuery = ObjScope.GetOqlQuery(queryHoldHistory); IQueryResult result = oqlQuery.Execute(co); if (result.Count > 0) res = result[0]; result.Dispose(); return res as HoldReleaseHistory; }