protected void btnAddNewDetail_Click(object sender, EventArgs e) { Disassociate service = MESPageService as Disassociate; DisassociateDetail sd = new DisassociateDetail(); sd.ChildContainerName = ""; service.InsertDetail(sd); GridView1.DataBind(); }
private void InsertFullDetails(Container co) { foreach (Container child in co.ChildContainers) { DisassociateDetail sd = new DisassociateDetail(); sd.ChildContainerName = child.ContainerName; InsertDetail(sd); } }
public void UpdateDetails(DisassociateDetail s) { foreach (DisassociateDetail t in DisassociateDetails) { if (t.ServiceDetailID == s.ServiceDetailID) { AssignDisassociateDetailToDisassociateDetail(s, t); } } }
public void DeleteDetail(DisassociateDetail s) { int i = -1; foreach (DisassociateDetail t in DisassociateDetails) if (t.ServiceDetailID == s.ServiceDetailID) { i = DisassociateDetails.IndexOf(t); break; } if (-1 != i) DisassociateDetails.RemoveAt(i); }
public void DeleteDetail(DisassociateDetail s) { int i = -1; foreach (DisassociateDetail t in DisassociateDetails) { if (t.ServiceDetailID == s.ServiceDetailID) { i = DisassociateDetails.IndexOf(t); break; } } if (-1 != i) { DisassociateDetails.RemoveAt(i); } }
protected override bool ModifyEntity() { bool success = base.ModifyEntity(); if (true == DisassociateAll) { DisassociateDetails.Clear(); foreach (UO_Model.Execution.Container d in this.Container.ChildContainers) { DisassociateDetail sd = new DisassociateDetail(); sd.ChildContainerName = d.ContainerName; DisassociateDetails.Add(sd); } } foreach (DisassociateDetail d in DisassociateDetails) { Container childContainer = ResolveContainer(d.ChildContainerName); this.Container.Qty -= childContainer.Qty; childContainer.Parent = null; } return(success); }
public void InsertDetail(DisassociateDetail s) { s.ServiceDetailID = detailIDCount++; DisassociateDetails.Add(s); }
protected virtual void AssignDisassociateDetailToDisassociateHistoryDetail(DisassociateDetail s, DisassociateHistoryDetail t) { t.ChildContainer = ResolveContainer(s.ChildContainerName); }
protected virtual void AssignDisassociateDetailToDisassociateDetail(DisassociateDetail s, DisassociateDetail t) { t.ChildContainerName = s.ChildContainerName; }
protected override bool ModifyEntity() { bool success = base.ModifyEntity(); if (true == DisassociateAll) { DisassociateDetails.Clear(); foreach (UO_Model.Execution.Container d in this.Container.ChildContainers) { DisassociateDetail sd = new DisassociateDetail(); sd.ChildContainerName = d.ContainerName; DisassociateDetails.Add(sd); } } foreach (DisassociateDetail d in DisassociateDetails) { Container childContainer = ResolveContainer(d.ChildContainerName); this.Container.Qty -= childContainer.Qty; childContainer.Parent = null; } return success; }