public List <ContainersModel> Containers(IConnectToDB _Connect, List <ContainersModel> ContainerModel, DataTable _DT, string ModelType) { List <ContainersModel> Containers = new List <ContainersModel>(); switch (ModelType.ToLower()) { case "view": foreach (DataRow ContainerViewRow in _DT.Rows) { ContainersModel Container = new ContainersModel(); Container.Container = new ContainersModel.ContainerStruct(); Container.Container.ContainerView = new ContainersModel.ViewContainerModel(); Container.Container.ContainerView = ContainerView(new ContainersModel.ViewContainerModel(), ContainerViewRow); Containers.Add(Container); } break; case "table": break; } return(Containers); }
public List <ContainersModel> GetContainers(List <ContainersModel> Containers, DataTable _DT) { ContainersModel _Containers = new ContainersModel(); foreach (DataRow ContainerRow in _DT.Rows) { Containers.Add(GetContainer(new ContainersModel(), ContainerRow)); } return(Containers); }
public ContainersModel GetContainer(ContainersModel Containers, DataRow _DR) { Containers = new ContainersModel { ViewContainer = new ContainersModel.ViewContainerModel { enabled = _DR.Field <string>("enabled"), containers_id = _DR.Field <long?>("containers_id"), container_name = _DR.Field <string>("container_name"), object_layer = _DR.Field <string>("object_layer"), object_type = _DR.Field <string>("object_type"), dt_available = _DR.Field <DateTime?>("dt_available"), dt_created = _DR.Field <DateTime>("dt_created"), dt_end = _DR.Field <DateTime?>("dt_end"), } }; return(Containers); }