Пример #1
0
        public ActionResult ImportFile()
        {
            ImportSession s = new HRBuildingSession().ToImportSession();

            return View("~/Areas/Import/Views/ImportFile.cshtml", s);
        }
Пример #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"));
            }
        }
Пример #3
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"));
     }
 }