Exemplo n.º 1
0
        public ActionResult ImportFile()
        {
            ImportSession s = new HRJobTitleSession().ToImportSession();

            return View("~/Areas/Import/Views/ImportFile.cshtml", s);
        }
Exemplo n.º 2
0
        public ActionResult Preview(ImportSession s)
        {
            try
            {

                HRJobTitleSession jt = new HRJobTitleSession();
                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"));
            }
        }
Exemplo n.º 3
0
 public ActionResult Import(ImportSession s)
 {
     try
     {
         ImportSession dbs = db.ImportSessions.First(x => x.SessionId.Equals(s.SessionId));
         HRJobTitleSession jt = new HRJobTitleSession(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"));
     }
 }