public void Post() { if (this.Status == ProdRouteListStatus.Waiting) { if (this.FromProdRoute != null) { ProdRouteList fromProdRouteList = new ProdRouteList(Session); fromProdRouteList.Date = this.Date; fromProdRouteList.ProdRoute = this.FromProdRoute; fromProdRouteList.Qty = this.Qty * -1; fromProdRouteList.ScrapQty = this.ScrapQty; fromProdRouteList.Save(); FromProdRoute.UpdateTotalIOQty(); // ToProdRoute.WorkCenter.Type == } if (this.ToProdRoute != null) { ProdRouteList toProdRouteList = new ProdRouteList(Session); toProdRouteList.Date = this.Date; toProdRouteList.ProdRoute = this.ToProdRoute; toProdRouteList.Qty = this.Qty; toProdRouteList.ScrapQty = this.ScrapQty; toProdRouteList.Save(); ToProdRoute.UpdateTotalIOQty(); } _Status = ProdRouteListStatus.Complete; OnChanged("Status"); _PostDate = ServerHelper.GetCurrentDateTime(); OnChanged("PostDate"); _PostBy = base.CurrentUser; OnChanged("PostBy"); ProdOrder.UpdateWipQty(); ProdOrder.UpdateKitQty(); ProdOrder.Save(); } }
public void Cancel() { if (Status == ProdRouteListStatus.Waiting) { _Status = ProdRouteListStatus.Cancel; _CancelBy = ServerHelper.userName; _CancelDate = ServerHelper.GetCurrentDateTime(); Save(); } }