Esempio n. 1
0
        private CaseInvolvedName CreateInvolvedName(string involvementCode, int id)
        {
            CaseInvolvedName ciName = new CaseInvolvedName();

            ciName.Operation       = OperationType.Insert;
            ciName.InvolvementCode = involvementCode;
            ciName.NameID          = id;
            return(ciName);
        }
Esempio n. 2
0
        private Case InsertCase(JustWareApiClient apiClient, XElement caseXml, Name defendant, Name policeOfficer)
        {
            Case c = new Case();

            c.Operation         = OperationType.Insert;
            c.TypeCode          = "F";
            c.StatusCode        = "ACTIV";
            c.AgencyAddedByCode = "NDT";
            c.StatusDate        = DateTime.Now;
            c.ReceivedDate      = DateTime.Now;


            CaseInvolvedName def = CreateInvolvedName("DEF", defendant.ID);
            CaseInvolvedName po  = CreateInvolvedName("PO", policeOfficer.ID);

            c.CaseInvolvedNames = new List <CaseInvolvedName>()
            {
                def, po
            };

            var chargeElements = caseXml.Descendants("Charge");

            foreach (var chargeElement in chargeElements)
            {
                Charge charge = CreateNewCharge(apiClient, chargeElement);
                if (charge == null)
                {
                    continue;
                }
                if (c.Charges == null)
                {
                    c.Charges = new List <Charge>();
                }
                c.Charges.Add(charge);
            }

            List <Key> returnedKeys = apiClient.Submit(c);
            string     newCaseID    = returnedKeys.First(k => k.TypeName == "Case").NewCaseID;

            Case finishedCase = apiClient.GetCase(newCaseID, null);

            return(finishedCase);
        }
Esempio n. 3
0
 private CaseInvolvedName CreateInvolvedName(string involvementCode, int id)
 {
     CaseInvolvedName ciName = new CaseInvolvedName();
     ciName.Operation = OperationType.Insert;
     ciName.InvolvementCode = involvementCode;
     ciName.NameID = id;
     return ciName;
 }