Exemple #1
0
        public async Task <IActionResult> Import(ImportCsv request)
        {
            var rows = await _mediator.Process(request);

            Alert($"CSV import was successfully processed with {rows} rows!");
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        /// <summary>
        /// 手动导入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barBtnManualImport_ItemClick(object sender, ItemClickEventArgs e)
        {
            ImportCsv importCsv = new ImportCsv();

            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                string msg  = string.Empty;
                string file = string.Empty;
                Dictionary <string, Dictionary <string, string> > message = importCsv.ReadCsv(folderBrowserDialog1.SelectedPath);

                foreach (KeyValuePair <string, Dictionary <string, string> > item in message)
                {
                    file = item.Key + "\r\n";
                    string error = string.Empty;
                    foreach (KeyValuePair <string, string> kvp in item.Value)
                    {
                        error += String.Format("{0}\r\n{1}\r\n", kvp.Key, kvp.Value);
                    }
                    msg += file + error;
                }
                MessageForm mf = new MessageForm(msg);
                mf.Show();
                this.searchLocal();
            }
        }
Exemple #3
0
    public CFDClosestPt(float x, float y, ImportCsv cfdData, ImportCsv cfdOrigin)
    {
        this.cfdData   = cfdData;
        this.cfdOrigin = cfdOrigin;

        float min = 99999999;

        for (int i = 0; i < cfdData.Count; i++)
        {
            float xTest = Math.Abs(x - (cfdData.Itemf(i, 0) + cfdOrigin.Itemf(0, 0))); // +x
            float yTest = Math.Abs(y - (cfdData.Itemf(i, 1) + cfdOrigin.Itemf(0, 2))); // +z

            float dist = (float)Math.Sqrt(Math.Pow(xTest, 2) + Math.Pow(yTest, 2));

            if (dist < min)
            {
                min     = dist;
                this.id = i;
            }
        }
        this.Vx = cfdData.Itemf(this.id, 2);
        this.Vy = cfdData.Itemf(this.id, 3);
        this.Vz = cfdData.Itemf(this.id, 4);

        this.V = Mathf.Sqrt(this.Vx * this.Vx + this.Vy * this.Vy + this.Vz * this.Vz);

        this.T   = cfdData.Itemf(this.id, 6);
        this.PMV = cfdData.Itemf(this.id, 7);
        this.PPD = 100 - 95 * Mathf.Exp(-0.03353f * Mathf.Pow(this.PMV, 4f) - 0.2179f * Mathf.Pow(this.PMV, 2f));
        this.PPS = 100 - this.PPD;
    }
Exemple #4
0
    void ApplyMovements()
    {
        if (enableFreeRoam)
        {
            PlayerObj.GetComponent <Navigation>().setMovementMode(0);
        }
        else
        {
            ImportCsv loc = new ImportCsv(WWWLoader.active_download_path + "jumplocations");
            jumpLocations = new Vector3[loc.Count];
            for (int i = 0; i < loc.Count; i++)
            {
                jumpLocations[i] = new Vector3(loc.Itemf(i, 0), loc.Itemf(i, 1), loc.Itemf(i, 2));
            }

            //create jumpProgressBars as necessary
            for (int i = 0; i < jumpLocations.Length; i++)
            {
                GameObject canvas = (GameObject)Instantiate(Resources.Load("prefabs/MovementCanvas"),
                                                            new Vector3(jumpLocations[i].x, jumpLocations[i].y, jumpLocations[i].z),
                                                            Quaternion.identity);
                canvas.GetComponentInChildren <RadialProgressBar>().roomControl = this;
                movementCanvases.Add(canvas.GetComponent <Canvas>());
            }
            rotateMovementCanvases(transform.position);
            PlayerObj.GetComponent <Navigation>().setMovementMode(1);
        }
    }
Exemple #5
0
 /// <summary>
 /// 批量修改进口日期
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barBtnUpdateDate_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
     {
         try
         {
             ImportCsv     importCsv    = new ImportCsv();
             List <string> fileNameList = new List <string>();
             DirectoryInfo folder       = new DirectoryInfo(folderBrowserDialog1.SelectedPath);
             foreach (FileInfo file in folder.GetFiles("*.xls"))
             {
                 fileNameList.Add(file.FullName);
             }
             if (fileNameList.Count > 0)
             {
                 foreach (string fileName in fileNameList)
                 {
                     if (importCsv.ReadUpdateDate(fileName) == 1)
                     {
                         MessageBox.Show(fileName + "批量修改时间成功");
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         this.searchLocal();
     }
 }
        protected override void ProcessRecord()
        {
            WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();
            string csvFile = OutPutDirectory + @"\" + System.IO.Path.GetFileNameWithoutExtension(WebPartUsageFilePath) + "_DeleteOperationStatus" + "_" + DateTime.Now.ToString("dd_MM_yyyy_hh_ss") + ".csv";


            if (String.Equals(Transformation.PowerShell.Common.Constants.ActionType_All, SourceWebPartType, StringComparison.CurrentCultureIgnoreCase))
            {
                //Reading Input File
                IEnumerable <WebPartDiscoveryInput> objWPDInput;

                objWPDInput = ImportCsv.ReadMatchingColumns <WebPartDiscoveryInput>(WebPartUsageFilePath, Transformation.PowerShell.Common.Constants.CsvDelimeter);

                if (objWPDInput.Any())
                {
                    IEnumerable <string> webPartTypes = objWPDInput.Select(x => x.WebPartType);

                    webPartTypes = webPartTypes.Distinct();

                    foreach (string webPartType in webPartTypes)
                    {
                        webPartTransformationHelper.DeleteWebPart_UsingCSV(webPartType, WebPartUsageFilePath, OutPutDirectory, csvFile, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
                    }
                }
            }
            else
            {
                webPartTransformationHelper.DeleteWebPart_UsingCSV(SourceWebPartType, WebPartUsageFilePath, OutPutDirectory, csvFile, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
            }
        }
        /// <summary>
        /// Fonction appelé lorsque on souhaite importer un fichier csv en mode écraser
        /// </summary>
        private void ImporterEcrasement_Click(object sender, EventArgs e)
        {
            //Si aucun fichier n'a été selectionnée on ne fait rien
            if (this.File_Name_TextBox.Text != "")
            {
                //On recupere le ficheir selectionnée et on se met en mode lecture
                System.IO.TextReader Reader = new System.IO.StreamReader(this.File_Name_TextBox.Text);

                //On supprimer toutes les tables de la base de données
                SupprimerTable Ecraser = new SupprimerTable();
                Ecraser.SupprimerToutesTable();

                string Line       = Reader.ReadLine();
                int    CountLines = Line.Length;

                //Pour chaque ligne du fichier Csv on appel la fonction ImporterLigneCsv
                ImportCsv Import = new ImportCsv();
                while (Line != null)
                {
                    Line = Reader.ReadLine();
                    CountLines++;

                    //Barre de progression
                    this.progressBar1.Increment(CountLines);

                    Import.ImporterLigneCsv(Line);
                }
                // Message affiché à la fin de l'importation
                this.textStatus.Text = "Le fichier importé est :" + this.File_Name_TextBox.Text + ", " + CountLines + " lignes ont été ajoutés à la base de données .";
            }
        }
Exemple #8
0
        /// <summary>
        /// 手动导入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barBtnManualImport_ItemClick(object sender, ItemClickEventArgs e)
        {
            ImportCsv importCsv = new ImportCsv();

            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                this.progressBarControl1.Position = 0;
                string msg  = string.Empty;
                string file = string.Empty;
                importCsv.ProgressDoing      += new ProgressEventHandler(operate_ProgressDoing);
                importCsv.ProgressCountDoing += new ProgressCountEventHandel(importCsv_ProgressCountDoing);
                Dictionary <string, Dictionary <string, string> > message = importCsv.ReadCsv(folderBrowserDialog1.SelectedPath);

                foreach (KeyValuePair <string, Dictionary <string, string> > item in message)
                {
                    file = item.Key + "\r\n";
                    string error = string.Empty;
                    foreach (KeyValuePair <string, string> kvp in item.Value)
                    {
                        error += String.Format("{0}\r\n{1}\r\n", kvp.Key, kvp.Value);
                    }
                    msg += file + error;
                }
                MessageForm mf = new MessageForm(msg + "\r\n导入完成");
                mf.Show();
                this.searchLocal();
            }
        }
Exemple #9
0
        private void OnImportCsv(object sender, EventArgs args)
        {
            string fileName = AskUserForFileName("Choose a .csv file", Utility.FileDialog.FileActionType.Open, "CSV File (*.csv) | *.csv");

            ImportCsv?.Invoke(this, new FileActionArgs {
                Path = fileName
            });
        }
Exemple #10
0
    void ApplyHumanLayer()
    {
        ImportCsv Human = new ImportCsv(WWWLoader.active_download_path + "humancoords");

        for (int i = 0; i < Human.Count; i++)
        {
            HumanCoords.Add(new Vector4(Human.Itemf(i, 0), Human.Itemf(i, 1), Human.Itemf(i, 2), Human.Itemf(i, 3)));
        }
        if (showHuman)
        {
            List <GameObject> hPrefab = new List <GameObject> ();
            hPrefab.Add((GameObject)Resources.Load("prefabs/Human Prefabs/HumanFig"));
            hPrefab.Add((GameObject)Resources.Load("prefabs/Human Prefabs/HumanFig (2)"));
            hPrefab.Add((GameObject)Resources.Load("prefabs/Human Prefabs/HumanFig (3)"));
            hPrefab.Add((GameObject)Resources.Load("prefabs/Human Prefabs/HumanFig (4)"));
            hPrefab.Add((GameObject)Resources.Load("prefabs/Human Prefabs/HumanFig (5)"));

            ImportCsv cfdData   = new ImportCsv(WWWLoader.active_download_path + "cfd");
            ImportCsv cfdOrigin = new ImportCsv(WWWLoader.active_download_path + "cfdorigin");

            for (int i = 0; i < HumanCoords.Count; i++)
            {
                //"TODO" instantiating with y to be 0.14 and not coord.y as a quick fix
                int        index  = UnityEngine.Random.Range(0, hPrefab.Count);
                GameObject person = (GameObject)Instantiate(hPrefab[index],
                                                            new Vector3(HumanCoords[i].x, HumanCoords[i].y, HumanCoords[i].z),
                                                            Quaternion.Euler(0.0f, HumanCoords[i].w, 0.0f));
                person.name = "Person" + i;

                //Match location coordinates with closest CFD data
                CFDClosestPt CFD     = new CFDClosestPt(HumanCoords[i].x, HumanCoords[i].z, cfdData, cfdOrigin);
                Vector3      extWind = new Vector3(CFD.Vx * 0.8f, CFD.Vz * 0.8f, CFD.Vy * 0.8f);
                Vector3      ranWind = new Vector3(CFD.Vx * 0.4f, CFD.Vz * 0.4f, CFD.Vy * 0.4f);

                //Cloth Setting
                GameObject WindCloth = person.transform.Find("Skirt (1)").gameObject;
                //GameObject WindCloth = (GameObject)Instantiate(GameObject.Find("WindCloth"), new Vector3(HumanCoords[i].x, 0.638f, HumanCoords[i].z), Quaternion.Euler(270f, HumanCoords[i].w + 180f, 0.0f));
                WindCloth.GetComponent <Cloth>().externalAcceleration = extWind * 6;
                WindCloth.GetComponent <Cloth>().randomAcceleration   = ranWind * 6;

                GameObject Hair = person.transform.Find("Hair (2)").gameObject;
                //GameObject WindCloth = (GameObject)Instantiate(GameObject.Find("WindCloth"), new Vector3(HumanCoords[i].x, 0.638f, HumanCoords[i].z), Quaternion.Euler(270f, HumanCoords[i].w + 180f, 0.0f));
                Hair.GetComponent <Cloth>().externalAcceleration = extWind * 8;
                Hair.GetComponent <Cloth>().randomAcceleration   = ranWind * 8;

                GameObject Hair2 = person.transform.Find("Hair (3)").gameObject;
                //GameObject WindCloth = (GameObject)Instantiate(GameObject.Find("WindCloth"), new Vector3(HumanCoords[i].x, 0.638f, HumanCoords[i].z), Quaternion.Euler(270f, HumanCoords[i].w + 180f, 0.0f));
                Hair2.GetComponent <Cloth>().externalAcceleration = extWind * 8;
                Hair2.GetComponent <Cloth>().randomAcceleration   = ranWind * 8;

                person.GetComponent <TooltipPopup>().setTooltip(CFD.PPS.ToString("F0"), CFD.T.ToString("F1"), CFD.V.ToString("F2"), CFD.PMV);

                //set mood based on PMV here
                //random from 0-100 inclusive
                person.GetComponent <HumanEmoticon>().setMood(CFD.PMV);
            }
        }
    }
Exemple #11
0
        public async Task Returns_zero_when_csv_is_null(
            ImportCsv request,
            ImportCsvHandler sut)
        {
            request.Csv = null;
            var rows = await sut.Handle(request);

            rows.Should().Be(0);
        }
Exemple #12
0
 /// <summary>
 /// 批量查询
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barBtnSearch_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         ImportCsv importCsv = new ImportCsv();
         DataSet   ds        = importCsv.ReadSharchExcel(openFileDialog1.FileName, "", ((int)Status.待上报).ToString());
         DataTable dt        = ds.Tables[0];
         dt.Columns.Add("check", System.Type.GetType("System.Boolean"));
         gcCljbxx.DataSource = dt;
         this.lblSum.Text    = String.Format("共{0}条", dt.Rows.Count);
         Utils.SelectItem(this.gvCljbxx, false);
     }
 }
Exemple #13
0
 /// <summary>
 /// 批量修改进口日期
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barBtnUpdateDate_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         ImportCsv importCsv = new ImportCsv();
         if (importCsv.ReadUpdateDate(openFileDialog1.FileName, "") == 1)
         {
             MessageBox.Show("批量修改时间成功");
         }
         else
         {
             MessageBox.Show("批量修改时间失败");
         }
         this.searchLocal();
     }
 }
Exemple #14
0
    void ApplyNoise()
    {
        ImportCsv      Noise       = new ImportCsv(WWWLoader.active_download_path + "noisecoords");
        List <Vector4> NoiseCoords = new List <Vector4>();

        for (int i = 0; i < Noise.Count; i++)
        {
            NoiseCoords.Add(new Vector4(Noise.Itemf(i, 0), Noise.Itemf(i, 1), Noise.Itemf(i, 2), Noise.Itemf(i, 3)));
        }

        if (enableNoise)
        {
            for (int i = 0; i < NoiseCoords.Count; i++)
            {
                string path = "prefabs/NoisePresets/";
                switch ((int)NoiseCoords [i].w)
                {
                case 4:
                    path += "NoiseSourceEnclosed";
                    break;

                case 3:
                    path += "NoiseSourceTelevision";
                    break;

                case 2:
                    path += "NoiseSourceSeaside";
                    break;

                case 1:
                    path += "NoiseSourceNeighbourhood";
                    break;

                default:
                    path += "NoiseSourceCity";
                    break;
                }

                //"TODO" instantiating with y to be 0.14 and not coord.y as a quick fix
                GameObject person = (GameObject)Instantiate(Resources.Load(path),
                                                            new Vector3(NoiseCoords[i].x, NoiseCoords[i].y, NoiseCoords[i].z),
                                                            Quaternion.identity);
                person.name = "Noise" + i;
            }
        }
    }
Exemple #15
0
 /// <summary>
 /// 批量查询
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barBtnSearch_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         try
         {
             ImportCsv importCsv = new ImportCsv();
             DataSet   ds        = importCsv.ReadSharchExcel(openFileDialog1.FileName, ((int)Status.待上报).ToString());
             DataTable dt        = ds.Tables[0];
             dt.Columns.Add("check", System.Type.GetType("System.Boolean"));
             dgvCljbxx.DataSource = dt;
             this.lblSum.Text     = String.Format("共{0}条", dt.Rows.Count);
             Utils.SelectItem(this.gridView1, false);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Exemple #16
0
        public async Task Returns_number_of_rows_imported_and_saved_to_db(
            Employee[] employees,
            ImportCsv request,
            ImportCsvHandler sut)
        {
            var stream = new MemoryStream();

            await using var streamWriter = new StreamWriter(stream, leaveOpen: true);
            await using var csvWriter    = new CsvWriter(streamWriter, CultureInfo.GetCultureInfo("en-GB"));
            csvWriter.Configuration.RegisterClassMap <EmployeeCsvMap>();
            await csvWriter.WriteRecordsAsync(employees);

            await streamWriter.FlushAsync();

            stream.Position = 0;
            Mock.Get(request.Csv).Setup(_ => _.OpenReadStream()).Returns(stream);

            var rows = await sut.Handle(request);

            rows.Should().Be(employees.Length);
        }
Exemple #17
0
    // Use this for initialization
    void Start()
    {
        renderMat      = false;
        showFurn       = false;
        showHuman      = false;
        showView       = false;
        enableNoise    = false;
        enableFreeRoam = false;
        //Read from Defaults
        ImportCsv Defaults = new ImportCsv(WWWLoader.active_download_path + "layersettings", ":");

        if (!PlayerPrefs.HasKey("RenderMat"))
        {
            for (int i = 0; i < Defaults.Count; i++)
            {
                switch (Defaults.Item(i, 0))
                {
                case "Material":
                    toggleMat.isOn = bool.Parse(Defaults.Item(i, 2));
                    break;

                case "Furniture":
                    toggleFurn.isOn = bool.Parse(Defaults.Item(i, 2));
                    break;

                case "Human":
                    toggleHuman.isOn = bool.Parse(Defaults.Item(i, 2));
                    break;

                case "FreeMovement":
                    toggleFreeRoam.isOn = bool.Parse(Defaults.Item(i, 2));
                    break;

                case "View":
                    toggleView.isOn = bool.Parse(Defaults.Item(i, 2));
                    break;

                case "Noise":
                    toggleNoise.isOn = bool.Parse(Defaults.Item(i, 2));
                    break;

                case "MovementSpeed":
                    movementSpeed = Defaults.Itemf(i, 1);
                    PlayerPrefs.SetFloat("MovementSpeed", movementSpeed);
                    break;

                case "LightIntensity":
                    lightIntensity = Defaults.Itemf(i, 1);
                    PlayerPrefs.SetFloat("LightIntensity", lightIntensity);
                    break;

                default:
                    break;
                }
            }
        }
        else
        {
            //read from PlayerPrefs
            if (PlayerPrefs.GetInt("RenderMat") == 1)
            {
                toggleMat.isOn = PlayerPrefs.GetInt("RenderMat") == 1; //this toggles the trigger
            }
            if (PlayerPrefs.GetInt("ShowFurn") == 1)
            {
                toggleFurn.isOn = PlayerPrefs.GetInt("ShowFurn") == 1;
            }
            if (PlayerPrefs.GetInt("ShowHuman") == 1)
            {
                toggleHuman.isOn = PlayerPrefs.GetInt("ShowHuman") == 1;
            }
            if (PlayerPrefs.GetInt("ShowView") == 1)
            {
                toggleView.isOn = PlayerPrefs.GetInt("ShowView") == 1;
            }
            if (PlayerPrefs.GetInt("EnableNoise") == 1)
            {
                toggleNoise.isOn = PlayerPrefs.GetInt("EnableNoise") == 1;
            }
            if (PlayerPrefs.GetInt("EnableFreeRoam") == 1)
            {
                toggleFreeRoam.isOn = PlayerPrefs.GetInt("EnableFreeRoam") == 1;
            }
        }

        //set enabled or disabled
        for (int i = 0; i < Defaults.Count; i++)
        {
            switch (Defaults.Item(i, 0))
            {
            case "Material":
                setToggleStatus(toggleMat, bool.Parse(Defaults.Item(i, 1)));
                break;

            case "Furniture":
                setToggleStatus(toggleFurn, bool.Parse(Defaults.Item(i, 1)));
                break;

            case "Human":
                setToggleStatus(toggleHuman, bool.Parse(Defaults.Item(i, 1)));
                break;

            case "FreeMovement":
                setToggleStatus(toggleFreeRoam, bool.Parse(Defaults.Item(i, 1)));
                break;

            case "View":
                setToggleStatus(toggleView, bool.Parse(Defaults.Item(i, 1)));
                break;

            case "Noise":
                setToggleStatus(toggleNoise, bool.Parse(Defaults.Item(i, 1)));
                break;

            default:
                break;
            }
        }
    }
        public void ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV(string outPutFolder, string MasterPageUsagePath, out IEnumerable <MasterPageInput> objMPInput, string New_MasterPageDetails = "N/A", string Old_MasterPageDetails = "N/A", string SharePointOnline_OR_OnPremise = Constants.OnPremise, string UserName = "******", string Password = "******", string Domain = "N/A")
        {
            string exceptionCommentsInfo1          = string.Empty;
            List <MasterPageBase> _WriteMasterList = new List <MasterPageBase>();

            Logger.AddMessageToTraceLogFile(Constants.Logging, "[START] ::: ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV");
            Logger.AddMessageToTraceLogFile(Constants.Logging, "[ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV] [START] Calling function ImportCsv.ReadMatchingColumns<MasterPageInput>. Master Page Input CSV file is available at " + MasterPageUsagePath);
            Console.WriteLine("[ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV] [START] Calling function ImportCsv.ReadMatchingColumns<MasterPageInput>. Master Page Input CSV file is available at " + MasterPageUsagePath);

            objMPInput = null;
            //objMPInput = ImportCsv.Read<MasterPageInput>(outPutFolder + @"\" + Transformation.PowerShell.Common.Constants.MasterPageInput, Transformation.PowerShell.Common.Constants.CsvDelimeter);
            objMPInput = ImportCsv.ReadMatchingColumns <MasterPageInput>(MasterPageUsagePath, Transformation.PowerShell.Common.Constants.CsvDelimeter);

            Logger.AddMessageToTraceLogFile(Constants.Logging, "[ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV] [END] Read all the INPUT from Master Page and saved in List - out IEnumerable<MasterPageInput> objMpInput, for processing.");
            Console.WriteLine("[ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV] [END] Read all the INPUT from Master Page and saved in List - out IEnumerable<MasterPageInput> objMpInput, for processing.");

            try
            {
                if (objMPInput.Any())
                {
                    Logger.AddMessageToTraceLogFile(Constants.Logging, "[START] ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV - After Loading InputCSV ");
                    Console.WriteLine("[START] ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV - After Loading InputCSV");

                    bool headerMasterPage = false;

                    foreach (MasterPageInput objInput in objMPInput)
                    {
                        //This is for Exception Comments:
                        ExceptionCsv.WebUrl         = objInput.WebUrl;
                        ExceptionCsv.SiteCollection = objInput.SiteCollectionUrl;
                        ExceptionCsv.WebApplication = objInput.WebApplicationUrl;
                        exceptionCommentsInfo1      = "<Input>New MasterPage Url = " + New_MasterPageDetails + ", <Input> OLD MasterUrl: " + Old_MasterPageDetails + ", WebUrl: " + objInput.WebUrl + ", CustomMasterUrlStatus" + objInput.CustomMasterUrlStatus + "MasterUrlStatus" + objInput.MasterUrlStatus;
                        //This is for Exception Comments:

                        MasterPageBase objMPBase = new MasterPageBase();
                        //if (Old_MasterPageDetails.Trim().ToLower() != Constants.Input_Blank && Old_MasterPageDetails.Trim().ToLower() != Constants.Input_All)
                        if (Old_MasterPageDetails.Trim().ToLower() != Constants.Input_All)
                        {
                            objMPBase = ChangeMasterPageForWeb(outPutFolder, objInput.WebUrl, New_MasterPageDetails, Old_MasterPageDetails, Convert.ToBoolean(objInput.CustomMasterUrlStatus), Convert.ToBoolean(objInput.MasterUrlStatus), Constants.ActionType_CSV, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
                        }
                        else
                        {
                            objMPBase = ChangeMasterPageForWeb(outPutFolder, objInput.WebUrl, New_MasterPageDetails, Old_MasterPageDetails, true, Convert.ToBoolean(objInput.MasterUrlStatus), Constants.ActionType_CSV, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
                        }

                        if (objMPBase != null)
                        {
                            _WriteMasterList.Add(objMPBase);
                        }
                    }

                    if (_WriteMasterList != null)
                    {
                        if (_WriteMasterList.Count > 0)
                        {
                            FileUtility.WriteCsVintoFile(outPutFolder + @"\" + Constants.MasterPageUsage, ref _WriteMasterList, ref headerMasterPage);
                        }
                    }

                    Logger.AddMessageToTraceLogFile(Constants.Logging, "[END] ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV - After Loading InputCSV. Updated the Master Pages.");
                    Console.WriteLine("[END] ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV - After Loading InputCSV. Updated the Master Pages.");
                }
            }
            catch (Exception ex)
            {
                ExceptionCsv.WriteException(ExceptionCsv.WebApplication, ExceptionCsv.SiteCollection, ExceptionCsv.WebUrl, "MasterPage", ex.Message, ex.ToString(), "ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV", ex.GetType().ToString(), exceptionCommentsInfo1);
                Logger.AddMessageToTraceLogFile(Constants.Logging, "[Exception] ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV. Exception Message:" + ex.Message);

                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("[Exception] ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV. Exception Message:" + ex.Message + ", Exception Comment: " + exceptionCommentsInfo1);
                Console.ForegroundColor = ConsoleColor.Gray;
            }

            Logger.AddMessageToTraceLogFile(Constants.Logging, "[END] ::: ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV");
            Console.WriteLine("[END] ::: ChangeMasterPageForDiscoveryOutPut_ReadMasterPagesCSV");
        }