private string Emailtext(IEnumerable<string> replacements, int iStudentId, MarksCalculator mcalc, out DataRow row)
 {
     var emailtext = txtEmailBody.Text;
     row = _config.GetStudentRow(iStudentId);
     foreach (var item in replacements)
     {
         var repvalue = "";
         switch (item)
         {
             case "MarkReport":
                 repvalue = _config.GetStudentReport(iStudentId, chkSendModerationNotice.Checked);
                 break;
             case "FinalMark":
                 repvalue = mcalc.GetFinalMark(row["SUB_NumericUserId"].ToString(), _config).ToString();
                 break;
             case "AllMarks":
             {
                 var p = new Programme(row["SUB_NumericUserId"].ToString());
                 repvalue = p.ShortMarksReport();
             }
                 break;
             default:
                 try
                 {
                     repvalue = row[item].ToString();
                 }
                 catch (Exception ex)
                 {
                 }
                 break;
         }
         emailtext = emailtext.Replace("{" + item + "}", repvalue);
     }
     return emailtext;
 }