Exemplo n.º 1
0
		public void Apply(Import i)
		{
            i.Type = Type;
            i.Notify = Notify;
            for (var j=0; j<i.Columns.Length; j++)
            {
                i.Columns[j].Target = Columns[j].Target;
                i.Columns[j].CustomTarget = Columns[j].CustomTarget;
            }
		}
Exemplo n.º 2
0
		public static ImportEditModel FromDomain(Import i)
		{
			return new ImportEditModel {
                Type = i.Type,
				Location = i.Location,
                Notify = i.Notify,
                Columns = i.Columns ?? new ImportColumn[0],
                Attempts = i.Attempts ?? new List<ImportAttempt>(),
			};
		}
Exemplo n.º 3
0
        protected IImportSource GetSourceForImport(Import i)
        {
            if (i.Location.EndsWith(".csv"))
            {
                return new CsvImportSource(i.Location.ToAbsoluteUrl().ToString());
            }
            if (i.Location.EndsWith(".xls") ||
                i.Location.EndsWith((".xlsx")))
            {
                return new ExcelImportSource(i.Location.ToAbsoluteUrl().ToString());
            }

            throw new NotSupportedException();
        }