protected void btnGetStatus_Click(object sender, EventArgs e)
    {
        var sqlServerBulkCopyFolder = ConfigurationManager.AppSettings["ASRemlBulkInsertFolder"];
        var localBulkCopyFolder = ConfigurationManager.AppSettings["ASRemlDataFilesFolder"];
        var ebvConnectionString = ConfigurationManager.ConnectionStrings["EBVConnectionString"].ConnectionString;
        var controlNumber = getControlNumber();

        var importer = new ASREMLImport(txtUploadedFile.Text, sqlServerBulkCopyFolder, localBulkCopyFolder, ebvConnectionString, controlNumber);

        txtStatusMessage.Text = importer.GetStatusMessage();
    }
    protected void btnProcessFile_Click(object sender, EventArgs e)
    {
        txtResult.Text = string.Empty;
        txtStatusMessage.Text = string.Empty;
        btnGetStatus.Enabled = false;

        if (txtUploadedFile.Text.Length != 0)
        {
            // Extract the filename part from the full path of the original file.
            string ebvDataFileName = uploader.PostedFile.FileName;

            var sqlServerBulkCopyFolder = ConfigurationManager.AppSettings["ASRemlBulkInsertFolder"];
            var localBulkCopyFolder = ConfigurationManager.AppSettings["ASRemlDataFilesFolder"];
            var ebvConnectionString = ConfigurationManager.ConnectionStrings["EBVConnectionString"].ConnectionString;
            var controlNumber = getControlNumber();

            // Do the work
            var importer = new ASREMLImport(txtUploadedFile.Text, sqlServerBulkCopyFolder, localBulkCopyFolder, ebvConnectionString, controlNumber);

            txtStrainCode.Text = importer.Strain;

            if (importer.Validate())
            {
                int status = importer.ImportData();
                if (status == 1)
                {
                    txtResult.Text = "Success";
                    txtResult.ForeColor = System.Drawing.Color.Green;
                    btnGetStatus.Enabled = false;
                }
                else
                {
                    txtResult.Text = "Fail";
                    txtResult.ForeColor = System.Drawing.Color.Red;
                    btnGetStatus.Enabled = true;
                }
            }
            else
            {
                throw new ApplicationException(string.Format("{0} is invalid.", ebvDataFileName));
            }
        }
    }
    protected void btnValidate_Click(object sender, EventArgs e)
    {
        if (txtUploadedFile.Text.Length != 0)
        {
            // Extract the filename part from the full path of the original file.
            var ebvDataFileName = txtUploadedFile.Text;

            var sqlServerBulkCopyFolder = ConfigurationManager.AppSettings["ASRemlBulkInsertFolder"];
            var localBulkCopyFolder = ConfigurationManager.AppSettings["ASRemlDataFilesFolder"];
            var ebvConnectionString = ConfigurationManager.ConnectionStrings["EBVConnectionString"].ConnectionString;
            var controlNumber =  getControlNumber();

            var importer = new ASREMLImport(ebvDataFileName, sqlServerBulkCopyFolder, localBulkCopyFolder, ebvConnectionString, controlNumber);

            txtStrainCode.Text = importer.Strain;
            btnProcessFile.Enabled = importer.Validate();
        }
    }