none
Claim Processing hyparbloa RRS feed

  • Question

  • Claim
    -------------------------------------------------------------------------------------------------------------------
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ClaimProcessing
    {
        public class Claim
        {
            public string ClaimId { get; set; }
            public string ClaimDate { get; set; }        
            public string InsuredDate { get; set; }
            public string InsuredAmountPerYear { get; set; }
            public string EmailId { get; set; }        
            public string ClaimAmount { get; set; }
            public string DateOfAdmission { get; set; }
            public string DateOfDischarge { get; set; }        
            public string BoardingCharges { get; set; }        
            public string SurgeonFees { get; set; }
            public string Othercharges { get; set; }
            public string ClaimStatus { get; set; } 
        }
    }
    
    -------------------------------------------------------------------------------------------------------------------
    Claim Processor
    -------------------------------------------------------------------------------------------------------------------
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data.SqlClient;
    using System.Data;
    using System.IO;
    using System.Globalization;
    using System.Text.RegularExpressions;
    using System.Data.Linq;
    
    namespace ClaimProcessing
    {
        public class ClaimProcessor
        {
            public void ProcessData(string inputFilePath,string reportFilePath, string reportFileName, SqlConnection connection,string archivePath)
            {
                //Do your logic here
                
                //ReadAllDataFromInputFiles
    
                //UpdateStatusFlag
    
                //SaveClaimsToDatabase
              
                //GetRejectedClaimsFromDatabase
    
                //SaveReportAsTextFile
    
                //MoveToArchive
            }
            /*
             * Do not modify the method signatures
             * */
            public List<Claim> ReadAllDataFromInputFiles(string inputFilePath)
            {
                //Return list with all the data from the input files
                return null;
            }
            public List<Claim> UpdateStatusFlag(List<Claim> claims)
            {
                //return list with updated status flag
                return null;
            }
            
            public void SaveClaimsToDatabase(List<Claim> claims, SqlConnection sqlConnectionString)
            {
                //Save the claim details to database with the updated status flag
            }
            public List<Claim> GetRejectedClaimsFromDatabase(SqlConnection connectionString)
            {
                //Get the rejected claim details from the DB using Linq Concept
                return null;
            }
            public void SaveReportAsTextFile(List<Claim> claims, string reportFilePath, string reportFileName)
            {
               //Save the rejected claims as text file.
            }    
            public void MoveToArchive(string inputFilePath, string archiveFilePath)
            {
               //Create a copy of the input files to archive folder
            }
        }
    }
    
    -------------------------------------------------------------------------------------------------------------------
    Claim exeption
    -------------------------------------------------------------------------------------------------------------------
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ClaimProcessing
    {
        public class ClaimProcessorException: Exception
        {
    
        }
    }
    
    -------------------------------------------------------------------------------------------------------------------
    linqto sql desgner
    -------------------------------------------------------------------------------------------------------------------
    #pragma warning disable 1591
    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:4.0.30319.42000
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
    
    namespace ClaimProcessing
    {
    	using System.Data.Linq;
    	using System.Data.Linq.Mapping;
    	using System.Data;
    	using System.Collections.Generic;
    	using System.Reflection;
    	using System.Linq;
    	using System.Linq.Expressions;
    	using System.ComponentModel;
    	using System;
    	
    	
    	public partial class LinqtoSqlDataContext : System.Data.Linq.DataContext
    	{
    		
    		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
    		
        #region Extensibility Method Definitions
        partial void OnCreated();
        #endregion
    		
    		public LinqtoSqlDataContext(string connection) : 
    				base(connection, mappingSource)
    		{
    			OnCreated();
    		}
    		
    		public LinqtoSqlDataContext(System.Data.IDbConnection connection) : 
    				base(connection, mappingSource)
    		{
    			OnCreated();
    		}
    		
    		public LinqtoSqlDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
    				base(connection, mappingSource)
    		{
    			OnCreated();
    		}
    		
    		public LinqtoSqlDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
    				base(connection, mappingSource)
    		{
    			OnCreated();
    		}
    	}
    }
    #pragma warning restore 1591
    
    
    -------------------------------------------------------------------------------------------------------------------
    program
    -------------------------------------------------------------------------------------------------------------------
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data.SqlClient;
    
    namespace ClaimProcessing
    {
        public class Program
        {
            static void Main(string[] args)
            {
                SqlConnection connection = new SqlConnection(@"Data Source=PCNAME\SQLEXPRESS;Initial Catalog=DBClaimProcessing;Integrated Security=True");
                ClaimProcessor cpobject = new ClaimProcessor();
                cpobject.ProcessData(@"D:\Dotnetcaassessment\ClaimProcessing\Input File\",
                                    @"D:\Dotnetcaassessment\ClaimProcessing\Report\",
                                    "ReportOfRejectedClaims.txt", connection, @"D:\Dotnetcaassessment\ClaimProcessing\Archive\");
    
            }
        }
    }
    
    
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


    • Edited by eralph Friday, December 22, 2017 8:19 PM
    Friday, December 22, 2017 8:08 PM

Answers

  • Claim
    -------------------------------------------------------------------------------------------------------------------
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ClaimProcessing
    {
        public class Claim
        {
            public string ClaimId { get; set; }
            public string ClaimDate { get; set; }
            public string InsuredDate { get; set; }
            public string InsuredAmountPerYear { get; set; }
            public string EmailId { get; set; }
            public string ClaimAmount { get; set; }
            public string DateOfAdmission { get; set; }
            public string DateOfDischarge { get; set; }
            public string BoardingCharges { get; set; }
            public string SurgeonFees { get; set; }
            public string Othercharges { get; set; }
            public string ClaimStatus { get; set; } 
        }
    }
    
    -------------------------------------------------------------------------------------------------------------------
    Claim Processor
    -------------------------------------------------------------------------------------------------------------------
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data.SqlClient;
    using System.Data;
    using System.IO;
    using System.Globalization;
    using System.Text.RegularExpressions;
    using System.Data.Linq;
    
    
    namespace ClaimProcessing
    {
        public class ClaimProcessor
        {
            public void ProcessData(string inputFilePath, string reportFilePath, string reportFileName, SqlConnection connection, string archivePath)
            {
                List<Claim> claims = new List<Claim>();
    
                claims = this.ReadAllDataFromInputFiles(inputFilePath);
                if (claims.Count == 0)
                {
                    throw new ClaimProcessorException();
                }
                claims = this.UpdateStatusFlag(claims);
    
                this.SaveClaimsToDatabase(claims,connection);
              
                //Report generation
                claims = GetRejectedClaimsFromDatabase(connection);
    
                this.SaveReportAsTextFile(claims,reportFilePath,reportFileName);
    
                this.CopyToArchive(inputFilePath,archivePath);
            }
            public List<Claim> ReadAllDataFromInputFiles(string inputFilePath)
            {
                List<Claim> claims = new List<Claim>();
                try
                {
                    string[] fileEntries = Directory.GetFiles(inputFilePath);
                    foreach (string fileName in fileEntries)
                    {
                        if (fileName.Contains("CP"))
                        {
                            FileInfo fileIn = new FileInfo(fileName);
                            StreamReader reader = fileIn.OpenText();
                            string[] RecordRow;
                            while (!reader.EndOfStream)
                            {
                                RecordRow = reader.ReadLine().Split('|');
    
                                claims.Add(new Claim()
                                {
                                    ClaimId = RecordRow[0],
                                    ClaimDate = RecordRow[1],
                                    InsuredDate = RecordRow[2],
                                    InsuredAmountPerYear = (RecordRow[3]),
                                    EmailId = (RecordRow[4]),
                                    ClaimAmount = (RecordRow[5]),
                                    DateOfAdmission = (RecordRow[6]),
                                    DateOfDischarge = (RecordRow[7]),
                                    BoardingCharges = (RecordRow[8]),
                                    SurgeonFees = (RecordRow[9]),
                                    Othercharges = (RecordRow[10])
                                });
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    throw new ClaimProcessorException();
                }
                return claims;
            }
            public List<Claim> UpdateStatusFlag(List<Claim> claims)
            {
                List<Claim> updatedClaims = new List<Claim>();
                int numericValue;
                DateTime date;
                try
                {
                    foreach (var claim in claims)
                    {
                        bool isValid = true;
    
                        //validations
                        if ((!(claim.ClaimId.StartsWith("CP"))) || string.IsNullOrEmpty(claim.ClaimId.ToString()) ||
                            (claim.ClaimId.Length != 5) || !(Int32.TryParse(claim.ClaimId.Substring(2, 3), out numericValue)))
                        {
                            isValid = false;
                        }
                        else if(string.IsNullOrEmpty(claim.InsuredDate.ToString()))
                        {
                            isValid = false;
                        }                   
                        else if ((!DateTime.TryParseExact(claim.ClaimDate, "MM/dd/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out date)) || string.IsNullOrEmpty(claim.ClaimDate.ToString()) )
                        {
                            isValid = false;                   
                        }
                        else if ((!DateTime.TryParseExact(claim.InsuredDate, "MM/dd/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out date)) || string.IsNullOrEmpty(claim.ClaimDate.ToString()))
                        {
                            isValid = false;
                        }
                        else if (Convert.ToDateTime(claim.ClaimDate) < Convert.ToDateTime(claim.InsuredDate))
                        {
                            isValid = false;
                        }                   
                        else if (!Int32.TryParse(claim.InsuredAmountPerYear, out numericValue) || string.IsNullOrEmpty(claim.InsuredAmountPerYear.ToString()))
                        {
                            isValid = false;
                        }
                        else if (!ValidEmail(claim.EmailId))
                        {
                            isValid = false;
                        }
                        else if (!(claim.EmailId.EndsWith(".com")) && !(claim.EmailId.EndsWith("co.in")) && !(claim.EmailId.EndsWith("co.uk")))
                        {
                            isValid = false;
                        }
                        else if (!Int32.TryParse(claim.ClaimAmount, out numericValue) || string.IsNullOrEmpty(claim.ClaimAmount.ToString()) || numericValue > Convert.ToInt64(claim.InsuredAmountPerYear))
                        {
                            isValid = false;
                        }
                        else if ((!DateTime.TryParseExact(claim.DateOfAdmission, "MM/dd/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out date)) || string.IsNullOrEmpty(claim.DateOfAdmission.ToString()) || (Convert.ToDateTime(claim.DateOfAdmission) < Convert.ToDateTime(claim.InsuredDate)))
                        {
                            isValid = false;
                        }
                        else if ((!DateTime.TryParseExact(claim.DateOfDischarge, "MM/dd/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out date))
                            || string.IsNullOrEmpty(claim.DateOfDischarge.ToString())
                            || (Convert.ToDateTime(claim.DateOfDischarge) < Convert.ToDateTime(claim.InsuredDate))
                            || (Convert.ToDateTime(claim.DateOfDischarge) < Convert.ToDateTime(claim.DateOfAdmission))
                            || (Convert.ToDateTime(claim.DateOfDischarge) < Convert.ToDateTime(claim.InsuredDate).AddMonths(3)))
                        {
                            isValid = false;
                        }
                        else if ((!Int32.TryParse(claim.BoardingCharges, out numericValue))
                            || (!Int32.TryParse(claim.SurgeonFees, out numericValue))
                            || (!Int32.TryParse(claim.Othercharges, out numericValue)))
                        {
                            isValid = false;
                        }
                        if (isValid == true)
                        {
                            //Sum of all the charges (Boarding, room rent, surgeon, medicines, operation theatre and Other charges) 
                            //should be equal to the Claim amount.
                            if ((Convert.ToInt16(claim.BoardingCharges) + Convert.ToInt16(claim.SurgeonFees)
                                + Convert.ToInt16(claim.Othercharges)) != Convert.ToInt16(claim.ClaimAmount))
                            {
                                isValid = false;
                            }
                        }
    
                        //set the status flag
                        if (isValid == true)
                        {
                            claim.ClaimStatus = "Approved";
                        }
                        else
                        {
                            claim.ClaimStatus = "Rejected";
                        }
                        updatedClaims.Add(claim);
                    }
                }
                catch (Exception)
                {
                    throw new ClaimProcessorException();
                }
    
                return updatedClaims;
            }
            public bool ValidEmail(string stremailchk)
            {
    
                Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
                Match match = regex.Match(stremailchk);
                if (match.Success)
                    return true;
                else
                    return false;
            }
            public void SaveClaimsToDatabase(List<Claim> claims, SqlConnection sqlConnectionString)
            {
                //Do your logic here to upload to DB table
                foreach (var claim in claims)
                {
                    SqlCommand command = new SqlCommand("Insert into SBA.Claim_Requests values (@ClaimId,@ClaimDate,@InsuredDate,@InsuredAmountPerYear,@EmailId,@ClaimAmount,@DateOfAdmission,@DateOfDischarge,@BoardingCharges,@SurgeonFees,@Othercharges,@ClaimStatus)", sqlConnectionString);
                    command.Parameters.Add(new SqlParameter("@ClaimId", (claim.ClaimId)));
                    command.Parameters.Add(new SqlParameter("@ClaimDate", claim.ClaimDate));                
                    command.Parameters.Add(new SqlParameter("@InsuredDate", Convert.ToDateTime(claim.InsuredDate)));
                    command.Parameters.Add(new SqlParameter("@InsuredAmountPerYear", Convert.ToDecimal(claim.InsuredAmountPerYear)));
                    command.Parameters.Add(new SqlParameter("@EmailId", (claim.EmailId)));                
                    command.Parameters.Add(new SqlParameter("@ClaimAmount", Convert.ToDecimal(claim.ClaimAmount)));
                    command.Parameters.Add(new SqlParameter("@DateOfAdmission", Convert.ToDateTime(claim.DateOfAdmission)));
                    command.Parameters.Add(new SqlParameter("@DateOfDischarge", Convert.ToDateTime(claim.DateOfDischarge)));
                    command.Parameters.Add(new SqlParameter("@BoardingCharges", Convert.ToDecimal(claim.BoardingCharges)));                
                    command.Parameters.Add(new SqlParameter("@SurgeonFees", Convert.ToDecimal(claim.SurgeonFees)));                                
                    command.Parameters.Add(new SqlParameter("@Othercharges", Convert.ToDecimal(claim.Othercharges)));
                    command.Parameters.Add(new SqlParameter("@ClaimStatus", (claim.ClaimStatus)));
                    sqlConnectionString.Open();
                    command.ExecuteNonQuery();
                    sqlConnectionString.Close();
                }
            }
            public List<Claim> GetRejectedClaimsFromDatabase(SqlConnection connectionString)
            {
                List<Claim> rejectedClaims = new List<Claim>();
                LinqtoSqlDataContext db = new LinqtoSqlDataContext();
                var Query = (from c in db.Claim_Requests
                             where c.ClaimStatus == "Rejected"
                             select new { c.ClaimId, c.ClaimDate, c.ClaimAmount, c.EmailId }).ToList();
    
                foreach (var c in Query)
                {
                    rejectedClaims.Add(new Claim()
                    {
    
                        ClaimId = c.ClaimId.ToString(),
                        ClaimDate = c.ClaimDate.ToString(),
                        ClaimAmount = c.ClaimAmount.ToString(),
                        EmailId = c.EmailId.ToString()
                    });
                }
                return rejectedClaims;
            }
            public void SaveReportAsTextFile(List<Claim> claims, string reportFilePath, string reportFileName)
            {
                //Do your logic here
                if (File.Exists(reportFilePath + reportFileName))
                {
                    //Delete the existing file
                    File.Delete(reportFilePath + reportFileName);
                }
                StreamWriter fileWriter = new StreamWriter(reportFilePath + reportFileName, false, System.Text.Encoding.Default);
                foreach (var claim in claims)
                {
                    fileWriter.WriteLine(claim.ClaimId + "," + claim.ClaimDate  + "," + claim.ClaimAmount + "," + claim.EmailId);
                }
                fileWriter.Close();
            }    
            public void CopyToArchive(string inputFilePath, string archiveFilePath)
            {
                string[] fileEntries = Directory.GetFiles(inputFilePath);
                foreach (string fileName in fileEntries)
                {
                    string fileNameWithoutPath;
                    fileNameWithoutPath = Path.GetFileNameWithoutExtension(fileName);
                    if (File.Exists(archiveFilePath + fileNameWithoutPath + "_Processed.txt"))
                    {
                        File.Delete(archiveFilePath + fileNameWithoutPath + "_Processed.txt");
                    }
                    File.Copy(fileName, archiveFilePath + fileNameWithoutPath + "_Processed.txt");
                }
            }
        }
    }
    
    
    -------------------------------------------------------------------------------------------------------------------
    ClaimProcessorException
    -------------------------------------------------------------------------------------------------------------------
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ClaimProcessing
    {
        public class ClaimProcessorException: Exception
        {
    
        }
    }
    
    
    -------------------------------------------------------------------------------------------------------------------
    LinqtoSql.designer
    -------------------------------------------------------------------------------------------------------------------
    #pragma warning disable 1591
    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:4.0.30319.42000
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
    
    namespace ClaimProcessing
    {
    	using System.Data.Linq;
    	using System.Data.Linq.Mapping;
    	using System.Data;
    	using System.Collections.Generic;
    	using System.Reflection;
    	using System.Linq;
    	using System.Linq.Expressions;
    	using System.ComponentModel;
    	using System;
    	
    	
    	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="DBClaimProcessing")]
    	public partial class LinqtoSqlDataContext : System.Data.Linq.DataContext
    	{
    		
    		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
    		
        #region Extensibility Method Definitions
        partial void OnCreated();
        #endregion
    		
    		public LinqtoSqlDataContext() : 
    				base(global::ClaimProcessing.Properties.Settings.Default.DBClaimProcessingConnectionString, mappingSource)
    		{
    			OnCreated();
    		}
    		
    		public LinqtoSqlDataContext(string connection) : 
    				base(connection, mappingSource)
    		{
    			OnCreated();
    		}
    		
    		public LinqtoSqlDataContext(System.Data.IDbConnection connection) : 
    				base(connection, mappingSource)
    		{
    			OnCreated();
    		}
    		
    		public LinqtoSqlDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
    				base(connection, mappingSource)
    		{
    			OnCreated();
    		}
    		
    		public LinqtoSqlDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
    				base(connection, mappingSource)
    		{
    			OnCreated();
    		}
    		
    		public System.Data.Linq.Table<Claim_Request> Claim_Requests
    		{
    			get
    			{
    				return this.GetTable<Claim_Request>();
    			}
    		}
    	}
    	
    	[global::System.Data.Linq.Mapping.TableAttribute(Name="SBA.Claim_Requests")]
    	public partial class Claim_Request
    	{
    		
    		private string _ClaimId;
    		
    		private System.Nullable<System.DateTime> _ClaimDate;
    		
    		private System.Nullable<System.DateTime> _InsuredDate;
    		
    		private System.Nullable<double> _InsuredAmountPerYear;
    		
    		private string _EmailId;
    		
    		private System.Nullable<double> _ClaimAmount;
    		
    		private System.Nullable<System.DateTime> _DateOfAdmission;
    		
    		private System.Nullable<System.DateTime> _DateOfDischarge;
    		
    		private System.Nullable<double> _BoardingCharges;
    		
    		private System.Nullable<double> _SurgeonFees;
    		
    		private System.Nullable<double> _Othercharges;
    		
    		private string _ClaimStatus;
    		
    		public Claim_Request()
    		{
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClaimId", DbType="VarChar(5) NOT NULL", CanBeNull=false)]
    		public string ClaimId
    		{
    			get
    			{
    				return this._ClaimId;
    			}
    			set
    			{
    				if ((this._ClaimId != value))
    				{
    					this._ClaimId = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClaimDate", DbType="DateTime")]
    		public System.Nullable<System.DateTime> ClaimDate
    		{
    			get
    			{
    				return this._ClaimDate;
    			}
    			set
    			{
    				if ((this._ClaimDate != value))
    				{
    					this._ClaimDate = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InsuredDate", DbType="DateTime")]
    		public System.Nullable<System.DateTime> InsuredDate
    		{
    			get
    			{
    				return this._InsuredDate;
    			}
    			set
    			{
    				if ((this._InsuredDate != value))
    				{
    					this._InsuredDate = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InsuredAmountPerYear", DbType="Float")]
    		public System.Nullable<double> InsuredAmountPerYear
    		{
    			get
    			{
    				return this._InsuredAmountPerYear;
    			}
    			set
    			{
    				if ((this._InsuredAmountPerYear != value))
    				{
    					this._InsuredAmountPerYear = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EmailId", DbType="VarChar(100)")]
    		public string EmailId
    		{
    			get
    			{
    				return this._EmailId;
    			}
    			set
    			{
    				if ((this._EmailId != value))
    				{
    					this._EmailId = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClaimAmount", DbType="Float")]
    		public System.Nullable<double> ClaimAmount
    		{
    			get
    			{
    				return this._ClaimAmount;
    			}
    			set
    			{
    				if ((this._ClaimAmount != value))
    				{
    					this._ClaimAmount = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateOfAdmission", DbType="DateTime")]
    		public System.Nullable<System.DateTime> DateOfAdmission
    		{
    			get
    			{
    				return this._DateOfAdmission;
    			}
    			set
    			{
    				if ((this._DateOfAdmission != value))
    				{
    					this._DateOfAdmission = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateOfDischarge", DbType="DateTime")]
    		public System.Nullable<System.DateTime> DateOfDischarge
    		{
    			get
    			{
    				return this._DateOfDischarge;
    			}
    			set
    			{
    				if ((this._DateOfDischarge != value))
    				{
    					this._DateOfDischarge = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BoardingCharges", DbType="Float")]
    		public System.Nullable<double> BoardingCharges
    		{
    			get
    			{
    				return this._BoardingCharges;
    			}
    			set
    			{
    				if ((this._BoardingCharges != value))
    				{
    					this._BoardingCharges = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SurgeonFees", DbType="Float")]
    		public System.Nullable<double> SurgeonFees
    		{
    			get
    			{
    				return this._SurgeonFees;
    			}
    			set
    			{
    				if ((this._SurgeonFees != value))
    				{
    					this._SurgeonFees = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Othercharges", DbType="Float")]
    		public System.Nullable<double> Othercharges
    		{
    			get
    			{
    				return this._Othercharges;
    			}
    			set
    			{
    				if ((this._Othercharges != value))
    				{
    					this._Othercharges = value;
    				}
    			}
    		}
    		
    		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClaimStatus", DbType="VarChar(10)")]
    		public string ClaimStatus
    		{
    			get
    			{
    				return this._ClaimStatus;
    			}
    			set
    			{
    				if ((this._ClaimStatus != value))
    				{
    					this._ClaimStatus = value;
    				}
    			}
    		}
    	}
    }
    #pragma warning restore 1591
    
    
    -------------------------------------------------------------------------------------------------------------------
    Program
    -------------------------------------------------------------------------------------------------------------------
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data.SqlClient;
    
    namespace ClaimProcessing
    {
        public class Program
        {
            static void Main(string[] args)
            {
                SqlConnection connection = new SqlConnection("Data Source=PC233649;Initial Catalog=DBEmployeeValidation;Integrated Security=True");
                ClaimProcessor cpobject = new ClaimProcessor();
                cpobject.ProcessData(@"C:\Users\153239\Desktop\Case Studies\ClaimProcessing\Input File\", 
                                    @"C:\Users\153239\Desktop\Case Studies\ClaimProcessing\Report\",
                                    "ReportOfRejectedClaims.txt", connection, @"C:\Users\153239\Desktop\Case Studies\ClaimProcessing\Archive\");
    
            }
        }
    }
    
    
    -------------------------------------------------------------------------------------------------------------------
    

    • Marked as answer by eralph Friday, December 22, 2017 8:21 PM
    Friday, December 22, 2017 8:13 PM