public ActionResult Preview(ImportSession s)
        {
            try
            {
                InstructionalLevelSession ss = new InstructionalLevelSession();
                ss.SessionId = s.SessionId;

                using (StreamReader sr = new StreamReader(s.ImportFile.InputStream))
                {
                    ss.ParseItems(sr);
                }

                ImportPreviewModel m = new ImportPreviewModel(ss.SessionId);
                return View("~/Areas/Import/Views/Preview.cshtml", m);
            }
            catch (Exception ex)
            {
                return View("Error", new Anvil.v2015.v001.Domain.Exceptions.AnvilExceptionModel(ex, "Parse Import File", "Students", "InstructionalLevel", "Index"));
            }
        }
Esempio n. 2
0
        public ActionResult Preview(ImportSession s)
        {
            try
            {

                HRBuildingSession jt = new HRBuildingSession();
                jt.SessionId = s.SessionId;

                using (StreamReader sr = new StreamReader(s.ImportFile.InputStream))
                {
                    jt.ParseItems(sr);
                }

                ImportPreviewModel m = new ImportPreviewModel(s.SessionId);
                return View("~/Areas/Import/Views/Preview.cshtml", m);
            }
            catch (Exception ex)
            {
                return View("Error", new Anvil.v2015.v001.Domain.Exceptions.AnvilExceptionModel(ex, "Parse Import File", "HumanResources", "HRJobTitles", "Index"));
            }
        }
 public ActionResult Import(ImportSession s)
 {
     try
     {
         ImportSession dbs = db.ImportSessions.First(x => x.SessionId.Equals(s.SessionId));
         InstructionalLevelSession jt = new InstructionalLevelSession(dbs);
         jt.Import();
         ImportPreviewModel m = new ImportPreviewModel(s.SessionId);
         return View("~/Areas/Import/Views/Import.cshtml", m);
     }
     catch (Exception ex)
     {
         return View("Error", new Anvil.v2015.v001.Domain.Exceptions.AnvilExceptionModel(ex, "Import Staff", "Students", "InstructionalLevel", "ImportFile"));
     }
 }
Esempio n. 4
0
 public ActionResult Import(ImportSession s)
 {
     try
     {
         ImportSession dbs = db.ImportSessions.First(x => x.SessionId.Equals(s.SessionId));
         HRBuildingSession jt = new HRBuildingSession(dbs);
         jt.Import();
         ImportPreviewModel m = new ImportPreviewModel(s.SessionId);
         return View("~/Areas/Import/Views/Import.cshtml", m);
     }
     catch (Exception ex)
     {
         return View("Error", new Anvil.v2015.v001.Domain.Exceptions.AnvilExceptionModel(ex, "Import Job Titles", "HumanResources", "HRJobTitles", "Preview"));
     }
 }