Example #1
0
        public static int AddClaimType(MitchellClaim ClaimInfo, int vehicleInfoID, int lossInfoID)
        {
            //string  ConnectionString = ConfigurationManager.ConnectionStrings["ClaimsConn"].ConnectionString;// "Data Source=(localdb)\\Projects;Initial Catalog=CFN_CCE_ServiceBroker_TRACING;Integrated Security=true;";
            string ConnectionString = @"Data Source=(localdb)\ProjectsV12;Initial Catalog=MTL_ClaimData;Integrated Security=true;";
            int ClaimTypeID = -1;
            try
            {
                using (SqlConnection connection = new SqlConnection(ConnectionString))
                using (SqlCommand command = new SqlCommand("dbo.[AddClaimType]", connection))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.CommandTimeout = 60;
                    connection.Open();

                    command.Parameters.AddWithValue("@ClaimNumber", ClaimInfo.ClaimNumber);
                    command.Parameters.AddWithValue("@ClaimantFirstName", ClaimInfo.ClaimantFirstName);
                    command.Parameters.AddWithValue("@ClaimantLastName", ClaimInfo.ClaimantLastName);
                    command.Parameters.AddWithValue("@Status", ClaimInfo.Status);
                    command.Parameters.AddWithValue("@LossDate", ClaimInfo.LossDate);
                    command.Parameters.AddWithValue("@lossInfoTypeID", lossInfoID);
                    command.Parameters.AddWithValue("@VehicleID", vehicleInfoID);
                    command.Parameters.AddWithValue("@AssignedAdjusterID", ClaimInfo.AssignedAdjusterID);

                    ClaimTypeID = System.Convert.ToInt32(command.ExecuteScalar());
                }
            }
            catch (Exception)
            {
                throw;
            }
            return ClaimTypeID;
        }
Example #2
0
 private MitchellClaim GetMitchellClaim(string xmlFileName)
 {
     var rdMitchellClaim = new MitchellClaim();
     using(var stream = File.OpenRead(xmlFileName))
     {
         var serializer = new XmlSerializer(typeof(MitchellClaim));
         rdMitchellClaim = (MitchellClaim)serializer.Deserialize(stream);
     }
     return rdMitchellClaim;
 }