public virtual void AssignToCurrentStatus(CurrentStatus t) { t.Workflow = this.Workflow; t.WorkflowStep = this.WorkflowStep; t.CurrentStepPass = this.CurrentStepPass; t.Spec = this.Spec; t.InProcess = this.InProcess; t.Resource = this.Resource; t.Factory = this.Factory; }
protected void ReplaceCurrentStatus(CurrentStatus cs_new) { CurrentStatus cs_old = Container.CurrentStatus; CurrentStatus cs_exist = ResolveCurrentStatus(cs_new); if (cs_exist == null) { ObjScope.Add(cs_new); Container.CurrentStatus = cs_new; } else Container.CurrentStatus = cs_exist; if (cs_old.Containers.Count == 0) ObjScope.Remove(cs_old); }
protected CurrentStatus GetCurrentStatusToModify() { CurrentStatus cs_new = new CurrentStatus(); Container.CurrentStatus.AssignToCurrentStatus(cs_new); return cs_new; }
protected CurrentStatus ResolveCurrentStatus(CurrentStatus cs) { const string queryCurrentStatus = @"ELEMENT (SELECT * FROM CurrentStatusExtent AS o WHERE o.Workflow = $1 AND o.WorkflowStep = $2 AND o.CurrentStepPass = $3 AND o.Spec = $4 AND o.InProcess = $5 AND o.Resource = $6 AND o.Factory = $7 )"; object res = null; IQuery oqlQuery = ObjScope.GetOqlQuery(queryCurrentStatus); IQueryResult result = oqlQuery.Execute(cs.Workflow, cs.WorkflowStep, cs.CurrentStepPass, cs.Spec, cs.InProcess, cs.Resource, cs.Factory); if (result.Count > 0) res = result[0]; result.Dispose(); return res as CurrentStatus; }
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 AssignToCurrentStatus(CurrentStatus t) { t.Workflow = this.Workflow; t.WorkflowStep = this.WorkflowStep; t.Factory = this.Factory; t.Spec = this.WorkflowStep.FirstSpecStep.Spec; }
public virtual void AssignToCurrentStatus(CurrentStatus t) { t.Workflow = this.Workflow; t.WorkflowStep = this.WorkflowStep; t.CurrentStepPass = this.CurrentStepPass; t.Spec = this.Spec; t.InProcess = this.InProcess; t.Resource = this.Resource; t.Factory = this.Factory; }