public string Explain(string JSON) { if (JSON == null) { return("Add Remove Programs: no data"); } try { ReportingAddRemovePrograms rd = JsonConvert.DeserializeObject <ReportingAddRemovePrograms>(JSON); string res = "Action: " + rd.Action + "\r\n"; res += rd.App.Name + "\r\n"; res += "Version: " + rd.App.DisplayVersion + "\r\n"; res += "ID: " + rd.App.ProductID + "\r\n"; res += "HKCUUser: "******"HKLM SYSTEM" : rd.App.HKCUUser) + "\r\n"; res += "IsWOW: " + (rd.App.IsWOWBranch == false ? "no" : "yes") + " IsMSI: " + (rd.App.IsMSI == false ? "no" : "yes") + " IsSystem: " + (rd.App.IsSystemComponent == false ? "no" : "yes"); return(res); } catch { return("Add Remove Programs Data faulty: " + JSON); } }
public static void ReportAddRemoveApps(SQLLib sql, string MachineID, string Method, AddRemoveApp AR, ReportingFlags Flags) { Flags &= ~(ReportingFlags.AdminReported | ReportingFlags.ClientReported | ReportingFlags.UrgentAdminReported | ReportingFlags.UrgentClientReported); ReportingAddRemovePrograms a = new ReportingAddRemovePrograms(); a.Action = Method; a.App = AR; sql.InsertMultiData("Reporting", new SQLData("MachineID", MachineID), new SQLData("Type", ReportingPolicyType.AddRemovePrograms), new SQLData("Data", JsonConvert.SerializeObject(a)), new SQLData("Flags", Flags)); }