Exemplo n.º 1
0
            public string Explain(string JSON)
            {
                if (JSON == null)
                {
                    return("SimpleTask: no data");
                }

                try
                {
                    ReportingSimpleTaskCompletion rd = JsonConvert.DeserializeObject <ReportingSimpleTaskCompletion>(JSON);
                    if (rd.App == null)
                    {
                        return("SimpleTask: no data");
                    }

                    string res = "Action: " + rd.Action + "\r\n";
                    res += "Name: " + rd.App.Name + "\r\n";
                    res += "Result: 0x" + rd.App.Result.ToString("X") + "\r\n";
                    if (string.IsNullOrWhiteSpace(rd.App.Text) == false)
                    {
                        res += "Text: " + rd.App.Text + "\r\n";
                    }

                    return(res);
                }
                catch
                {
                    return("SimpleTask Data faulty: " + JSON);
                }
            }
Exemplo n.º 2
0
        public static void ReportSimpleTaskCompletion(SQLLib sql, string MachineID, string Method, SimpleTaskResult AR, ReportingFlags Flags)
        {
            Flags &= ~(ReportingFlags.AdminReported | ReportingFlags.ClientReported | ReportingFlags.UrgentAdminReported | ReportingFlags.UrgentClientReported);

            ReportingSimpleTaskCompletion a = new  ReportingSimpleTaskCompletion();

            a.Action = Method;
            a.App    = AR;

            sql.InsertMultiData("Reporting",
                                new SQLData("MachineID", MachineID),
                                new SQLData("Type", ReportingPolicyType.SimpleTaskCompleted),
                                new SQLData("Data", JsonConvert.SerializeObject(a)),
                                new SQLData("Flags", Flags));
        }