From e64cbb521b9f13c2715b6172e4b31bcf4760ad5d Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 16 Apr 2021 15:00:42 +0200 Subject: [PATCH] modifica x MachGroup solo Start/End --- .../Controllers/MachGroupController.cs | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs b/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs index fe1ca2b0..ea169c3d 100644 --- a/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs +++ b/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs @@ -309,6 +309,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers return done; } + /// + /// Set Supervisor & state for MachGroup + /// + /// + /// + /// + /// + /// + public bool UpdateEnd(int ProdId, int MachGroupId, int PartId, DateTime DtEnd) + { + bool done = false; + try + { + // aggiorno + var currRecord = dbCtx + .PartList + .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId) + .FirstOrDefault(); + + currRecord.DtEnd = DtEnd; + + // Commit changes + dbCtx.SaveChanges(); + done = true; + } + catch (Exception exc) + { + Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}"); + } + + return done; + } + /// /// Set Order for MachGroup /// @@ -338,6 +371,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers return done; } + /// + /// Set Supervisor & state for MachGroup + /// + /// + /// + /// + /// + /// + public bool UpdateStart(int ProdId, int MachGroupId, int PartId, DateTime DtStart) + { + bool done = false; + try + { + // aggiorno + var currRecord = dbCtx + .PartList + .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId) + .FirstOrDefault(); + + currRecord.DtStart = DtStart; + + // Commit changes + dbCtx.SaveChanges(); + done = true; + } + catch (Exception exc) + { + Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}"); + } + + return done; + } + /// /// Set Supervisor & state for MachGroup ///