From 2d41477e55dde4c9946a6dfeaa4d18def5670615 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 8 Oct 2019 19:38:56 +0000 Subject: [PATCH] --- .../AyaLib/GZTW.AyaNova.BLL/Client.cs | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/Client.cs b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/Client.cs index 7649576..84b0fb5 100644 --- a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/Client.cs +++ b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/Client.cs @@ -2366,6 +2366,21 @@ namespace GZTW.AyaNova.BLL /*Custom fields*/ mCustom1,mCustom2,mCustom3,mCustom4,mCustom5,mCustom6,mCustom7,mCustom8,mCustom9,mCustom0)); + //case 3701 set pm's inactive if client is now inactive + if (this.mActiveChanged && this.mActive == false) + { + //here set all pm's for this client to inactive + DBCommandWrapper cmPM = DBUtil.GetCommandFromSQL( + "update AWORKORDERPREVENTIVEMAINTENANCE set aactive = 0 from AWORKORDERPREVENTIVEMAINTENANCE " + + "LEFT OUTER JOIN AWORKORDER ON (AWORKORDERPREVENTIVEMAINTENANCE.AWORKORDERID=AWORKORDER.AID) " + + "WHERE AWORKORDER.AWORKORDERTYPE='2' and aworkorder.ACLIENTID=@CLIENTID " + ); + cmPM.AddInParameter("@CLIENTID", DbType.Guid, mID); + DBUtil.DB.ExecuteNonQuery(cmPM, transaction); + + } + + MarkOld();//db is now synched with object // Commit the transaction @@ -2398,15 +2413,7 @@ namespace GZTW.AyaNova.BLL //in use AyaBizUtils.MRU.Save(); } - //case 3701 set pm's inactive if client is now inactive - if (this.mActiveChanged && this.mActive == false) - { - //here set all pm's for this client to inactive -/* "update AWORKORDERPREVENTIVEMAINTENANCE set aactive = 1 from AWORKORDERPREVENTIVEMAINTENANCE "+ - "LEFT OUTER JOIN AWORKORDER ON (AWORKORDERPREVENTIVEMAINTENANCE.AWORKORDERID=AWORKORDER.AID) "+ - "WHERE AWORKORDER.AWORKORDERTYPE='2' and aworkorder.ACLIENTID=@ID " */ - } - + //Process events as necessary if (AyaBizUtils.GlobalSettings.UseNotification)//Case 510