public string CreateCSV(List <PlayerDailyActivityCSV> ListOfActivities, string FileName, string PlayerName, string PlayerEmailAddress, string LeagueName, Controller ctrl)
        {
            string CSVFilePath             = "";
            PlayerDailyActivityCSV dataCSV = new PlayerDailyActivityCSV();
            string output = "";



            output  = dataCSV.ToCsvHeader();
            output += Environment.NewLine;

            ListOfActivities.ForEach(data =>
            {
                output += data.ToCsvRow();
                output += Environment.NewLine;
            });

            output += "-------------------------------------";
            output += Environment.NewLine;

            output += "Player Name: " + PlayerName;
            output += Environment.NewLine;

            output += "Email Address: " + PlayerEmailAddress;
            output += Environment.NewLine;

            output += "League Name: " + LeagueName;
            output += Environment.NewLine;

            try
            {
                var path = ctrl.Server.MapPath(SecurityUtils.ActivityData_Path);

                //if Directory is not exists then create one
                if (!System.IO.Directory.Exists(path))
                {
                    System.IO.Directory.CreateDirectory(path);
                }

                CSVFilePath = System.IO.Path.Combine(path, FileName);

                System.IO.File.WriteAllText(CSVFilePath, output);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                //if(System.IO.File.Exists(path))
                //{
                //    System.IO.File.Delete(path);
                //}
            }

            return(CSVFilePath);
        }
        public PlayerDailyActivityCSV MAP_To_CSV(PlayerDailyActivityExt model)
        {
            PlayerDailyActivityCSV m = new PlayerDailyActivityCSV()
            {
                ActivityDate = model.ActivityDate.ToString("dd/MM/yyyy"),
                Breakfast    = model.Breakfast,
                Lunch        = model.Lunch,
                Dinner       = model.Dinner,
                Snacks       = model.Snacks,
                Drink        = model.Drink,
                HowHealthy   = model.HowHealthy
            };

            return(m);
        }