public MitchellClaimType(string CN, string CFN, string CLN, StatusCode stt, DateTime LDate, LossInfoType LI, long aaID, VehicleListType vehi)
 {
     ClaimNumber = CN;
     ClaimFirstName = CFN;
     ClaimLastName = CLN;
     Status = stt;
     LossDate = LDate;
     LossInfo = LI;
     AssignedAdjusterID = aaID;
     Vehicles = vehi;
 }
Exemple #2
0
    //Helper Function - Not in web service
    public void loadfromXML(XmlDocument xdoc)
    {
        //Read the information from the xml xdoc XML Document
        //Assumption: All submitted files must be in this formatting 
            var tClaimNumber = xdoc.DocumentElement.ChildNodes[0].InnerText;
            var tClaimFirstName = xdoc.DocumentElement.ChildNodes[1].InnerText;
            var tClaimLastName = xdoc.DocumentElement.ChildNodes[2].InnerText;
            var tStatus = (StatusCode)Enum.Parse(typeof(StatusCode), xdoc.DocumentElement.ChildNodes[3].InnerText);
            var tLossDate = DateTime.Parse(xdoc.DocumentElement.ChildNodes[4].InnerText);
            var aaID = long.Parse(xdoc.DocumentElement.ChildNodes[6].InnerText);
            var li = xdoc.DocumentElement.ChildNodes[5];
            var ColCode = (CauseOfLossCode)Enum.Parse(typeof(CauseOfLossCode), li.ChildNodes[0].InnerText, false);
            var date = DateTime.Parse(li.ChildNodes[1].InnerText);
            var des = li.ChildNodes[2].InnerText;
            var tLossInfo = new LossInfoType(ColCode, date, des);
            var vehi = xdoc.DocumentElement.ChildNodes[7];

        //Reading Vehicles attributes of the claim xml file
        VehicleListType VehicleList = new VehicleListType();
            foreach (XmlNode veNode in vehi)
            {
                var ModelYear = int.Parse(veNode.ChildNodes.Item(1).InnerText);
                var MakeDescription = veNode.ChildNodes.Item(2).InnerText;
                var ModelDescription = veNode.ChildNodes.Item(3).InnerText;
                var EngineDescription = veNode.ChildNodes.Item(4).InnerText;
                var ExteriorColor = veNode.ChildNodes.Item(5).InnerText;
                var Vin = veNode.ChildNodes.Item(0).InnerText;
                var LicPlate = veNode.ChildNodes.Item(6).InnerText;
                var LicPlateState = veNode.ChildNodes.Item(7).InnerText;
                var LicPlateExpDate = DateTime.Parse(veNode.ChildNodes.Item(8).InnerText);
                var DamageDescription = veNode.ChildNodes.Item(9).InnerText;
                var Mileage = int.Parse(veNode.ChildNodes.Item(10).InnerText);
                var tVehicle = new VehicleInfoType(ModelYear, MakeDescription, ModelDescription, EngineDescription, ExteriorColor, Vin, LicPlate, LicPlateState, LicPlateExpDate, DamageDescription, Mileage);
                VehicleList.add(tVehicle);
            }
        //Create an MitchellClaimType object based on the information getting from XML file    
        MitchellClaimType addClaim = new MitchellClaimType(tClaimNumber, tClaimFirstName, tClaimLastName, tStatus, tLossDate, tLossInfo, aaID, VehicleList);
        
        //In this demo, this will add the new submitted claim into the database
        //In real program, this will fetch this object into the database - SQL Server or anything else
        backing_store[claimCount] = addClaim;
        claimCount++;
    }