public IEnumerable <GroupTreeNode> GetProductLineTreeNode(GroupTreeNode factoryTreeNode)
        {
            IList <GroupTreeNode> result = new List <GroupTreeNode>();

            Query query = new Query("ProductLine");

            query.AddCriterion("CompanyID", "a", factoryTreeNode.CompanyID, SqlServerDataAdapter.Infrastruction.CriteriaOperator.Equal);
            query.AddCriterion("FactoryID", "b", factoryTreeNode.FactoryID, SqlServerDataAdapter.Infrastruction.CriteriaOperator.Equal);
            DataTable dt = dataFactory.Query(query);

            foreach (DataRow row in dt.Rows)
            {
                GroupTreeNode item = new GroupTreeNode();
                item.ProductLineID     = int.Parse(row["ID"].ToString().Trim());
                item.CompanyID         = int.Parse(row["CompanyID"].ToString().Trim());
                item.FactoryID         = int.Parse(row["FactoryID"].ToString().Trim());
                item.Name              = row["Name"].ToString().Trim();
                item.Address           = row["Address"].ToString().Trim();
                item.CommissioningDate = row["CommissioningDate"].ToString();
                item.Products          = row["Products"].ToString().Trim();
                item.children          = null;
                result.Add(item);
            }

            return(result);
        }
Exemple #2
0
        public IEnumerable<GroupTreeNode> GetFactoryTreeNode(GroupTreeNode companyTreeNode)
        {
            IList<GroupTreeNode> result = new List<GroupTreeNode>();

            Query query = new Query("Factory");
            query.AddCriterion("CompanyID", companyTreeNode.CompanyID, SqlServerDataAdapter.Infrastruction.CriteriaOperator.Equal);
            DataTable dt = dataFactory.Query(query);
            foreach (DataRow row in dt.Rows)
            {
                GroupTreeNode item = new GroupTreeNode();
                item.CompanyID = int.Parse(row["CompanyID"].ToString().Trim());
                item.FactoryID = int.Parse(row["ID"].ToString().Trim());
                item.Name = row["Name"].ToString().Trim();
                item.Address = row["Address"].ToString().Trim();
                item.CommissioningDate = row["CommissioningDate"].ToString();
                item.Products = row["Products"].ToString().Trim();
                result.Add(item);
            }

            return result;
        }
Exemple #3
0
        public IEnumerable<GroupTreeNode> GetCompanyTreeNode()
        {
            IList<GroupTreeNode> result = new List<GroupTreeNode>();

            Query query = new Query("Company");
            DataTable dt = dataFactory.Query(query);
            foreach (DataRow row in dt.Rows)
            {
                GroupTreeNode item = new GroupTreeNode();
                if (row["ID"].ToString().Trim() != "")
                {
                    item.CompanyID = int.Parse(row["ID"].ToString().Trim());
                }
                item.Name = row["Name"].ToString().Trim();
                item.Address = row["Address"].ToString().Trim();
                item.CommissioningDate = row["CommissioningDate"].ToString();
                item.Products = row["Products"].ToString().Trim();
                result.Add(item);
            }

            return result;
        }
        public IEnumerable <GroupTreeNode> GetCompanyTreeNode()
        {
            IList <GroupTreeNode> result = new List <GroupTreeNode>();

            Query     query = new Query("Company");
            DataTable dt    = dataFactory.Query(query);

            foreach (DataRow row in dt.Rows)
            {
                GroupTreeNode item = new GroupTreeNode();
                if (row["ID"].ToString().Trim() != "")
                {
                    item.CompanyID = int.Parse(row["ID"].ToString().Trim());
                }
                item.Name              = row["Name"].ToString().Trim();
                item.Address           = row["Address"].ToString().Trim();
                item.CommissioningDate = row["CommissioningDate"].ToString();
                item.Products          = row["Products"].ToString().Trim();
                result.Add(item);
            }

            return(result);
        }