public void DeletePlannedProduction(int plannedProductionId) { var repo = new ProductionRespository(Properties.Settings.Default.ManufacturingConStr); repo.AddNewUpdateHistory(repo.GetPlannedProduction(plannedProductionId), "deleted"); repo.DeletePlannedProduction(plannedProductionId); }
public void UpdateMarkerCat(MarkerCategory markerCategory) { var repo = new MarkerRespository(Properties.Settings.Default.ManufacturingConStr); var prodRepo = new ProductionRespository(Properties.Settings.Default.ManufacturingConStr); var originalMarker = repo.GetMarkerCategory(markerCategory.Id); prodRepo.AddNewUpdateHistory(originalMarker, markerCategory.Deleted ? "deleted" : null); repo.UpdateMarkerCat(originalMarker.SetOrginalDbObjToUpdated(markerCategory)); }
public void UpdatePlannedProductionDetails(PlannedProductionDetail plannedProductionDetail) { var repo = new ProductionRespository(Properties.Settings.Default.ManufacturingConStr); var currentItem = repo.GetPlannedProductionDetail(plannedProductionDetail.Id); plannedProductionDetail.CreatedOn = currentItem.CreatedOn; repo.AddNewUpdateHistory(repo.GetPlannedProductionDetail(plannedProductionDetail.Id)); repo.UpdatePlannedProductionDetail(plannedProductionDetail); }
public void UpdatePlannedProductionNotes(PlannedProduction plannedProduction) { var repo = new ProductionRespository(Properties.Settings.Default.ManufacturingConStr); //var currentItem = repo.GetPlannedProduction(plannedProduction.Id).GetObjectBasePropertiesOnDbObject(); //repo.AddNewUpdateHistory(currentItem); //currentItem.Notes = plannedProduction.Notes; var currentItem = repo.GetPlannedProduction(plannedProduction.Id); repo.AddNewUpdateHistory(currentItem); repo.UpdatePlannedProduction(currentItem.SetOrginalDbObjToUpdated(plannedProduction)); }
public void DeletePlannedProductionDetails(int plannedProductionDetailId) { var repo = new ProductionRespository(Properties.Settings.Default.ManufacturingConStr); var pp = repo.GetPlannedProductionDetail(plannedProductionDetailId); //repo.DeletePlannedProductionDetail(new PlannedProductionDetail //{ // Id = pp.Id, // ItemId = pp.ItemId, // Quantity = pp.Quantity, // Deleted = true //}); repo.AddNewUpdateHistory(repo.GetPlannedProductionDetail(plannedProductionDetailId), "deleted"); repo.DeletePlannedProductionDetail(plannedProductionDetailId); }