public Incident(IncidentStatus status, IncidentSeverity severity, IncidentFeedbackFrequency freq, IncidentCommunicationType comType)
        {
            info = new IncidentInfo();

            info.Status            = EnumUtils.stringValueOf(status);
            info.Severity          = EnumUtils.stringValueOf(severity);
            info.FeedbackFrequency = EnumUtils.stringValueOf(freq);
            info.CommunicationType = EnumUtils.stringValueOf(comType);
            info.Opened            = new DateEpoch(DateTime.UtcNow);
            info.Resources         = null;
            info.Comments          = null;
        }
        public IEnumerable <IncidentInfo> FindBySeverity(IncidentSeverity severity)
        {
            if (client == null)
            {
                Connect2DocDb();
            }

            if (info != null && client != null)
            {
                var cases =
                    from c in client.CreateDocumentQuery <IncidentInfo>(docDbUrl)
                    where c.Severity == severity.ToString()
                    select c;

                return(cases);
            }
            else
            {
                return(null);
            }
        }
        public static void FindBySeverity(IncidentSeverity severity)
        {
            using (Incident inc = new Incident())
            {
                IEnumerable <IncidentInfo> issues = inc.FindBySeverity(severity);

                Console.WriteLine("FindBySeverity: " + EnumUtils.stringValueOf(severity));

                if (issues.Count() > 0)
                {
                    Console.Write(Environment.NewLine);

                    foreach (var issue in issues)
                    {
                        OutputCaseDetails(issue);
                        Console.Write(Environment.NewLine);
                    }
                }

                Console.WriteLine(cStrTotalResults + issues.Count().ToString());
            }
        }
        public static async Task <string> OpenCase(string description, IncidentStatus st, IncidentSeverity sv,
                                                   IncidentFeedbackFrequency ff, IncidentCommunicationType ct)
        {
            string id = string.Empty;

            using (Incident inc = new Incident(st, sv, ff, ct))
            {
                var issue = await inc.Open(description);

                if (issue != null)
                {
                    var i = JsonConvert.DeserializeObject <IncidentInfo>(issue.ToString());

                    Console.WriteLine(cStrCaseCreated);
                    Console.WriteLine(issue.ToString());

                    id = issue.Id;
                }
            }

            return(id);
        }