Ejemplo n.º 1
0
 public void UpdatePlannedProductionDetail(PlannedProductionDetail plannedProductionDetail)
 {
     using (var context = new ManufacturingDataContext(_connectionString))
     {
         plannedProductionDetail.ModifiedOn = DateTime.Now;
         context.PlannedProductionDetails.Attach(plannedProductionDetail);
         context.Refresh(RefreshMode.KeepCurrentValues, plannedProductionDetail);
         context.SubmitChanges();
     }
 }
Ejemplo n.º 2
0
 public void DeletePlannedProductionDetail(PlannedProductionDetail plannedProductionDetail)
 {
     using (var context = new ManufacturingDataContext(_connectionString))
     {
         plannedProductionDetail.Deleted = true;
         //context.PlannedProductionDetails.Attach(plannedProductionDetail);
         context.Refresh(RefreshMode.KeepCurrentValues, plannedProductionDetail);
         context.SubmitChanges();
     }
 }
        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);
        }