public static List <Department> GetDepartments() { List <Department> list = null; if (application != null) { Sage.Accounting.SystemManager.Departments departments = Sage.Accounting.SystemManager.DepartmentsFactory.Factory.CreateNew(); list = departments.GetList().Cast <Department>().ToList(); } return(list); }
// GET: Departments public ActionResult Index() { Sage.Accounting.SystemManager.Departments departments = Sage.Accounting.SystemManager.DepartmentsFactory.Factory.CreateNew(); List <Models.Department> list = new List <Models.Department>(); foreach (Sage.Accounting.SystemManager.Department department in departments) { Models.Department item = new Models.Department(); item.id = department.NLDepartment; item.code = department.Code; item.name = department.Name; list.Add(item); } return(View(list)); }
public static List <Department> GetDepartmentsModifiedAfter(DateTime dt) { List <Department> list = new List <Department>(); if (application != null) { Sage.Accounting.SystemManager.Departments departments = Sage.Accounting.SystemManager.DepartmentsFactory.Factory.CreateNew(); List <Department> temp = departments.GetList().Cast <Department>().ToList(); foreach (Department department in temp) { if (department.DateTimeUpdated > dt) { list.Add(department); } } } return(list); }