示例#1
0
        private void PopulateNamesValueLists()
        {
            DataTable ds;

            m_VWAWeightsData = new WeightsData();


            if (!this.ultraGrid1.DisplayLayout.ValueLists.Exists("FoodTypeIDNames"))
            {
                ValueList objValueList = this.ultraGrid1.DisplayLayout.ValueLists.Add("FoodTypeIDNames");

                ds = m_VWAWeightsData.FoodType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                //objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.ultraGrid1.DisplayLayout.ValueLists.Exists("LossTypeIDNames"))
            {
                ValueList objValueList = this.ultraGrid1.DisplayLayout.ValueLists.Add("LossTypeIDNames");

                ds = m_VWAWeightsData.LossType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
        }
示例#2
0
        private void PopulateNamesValueLists()
        {
            DataTable ds;

            m_VWAWeightsData = new WeightsData();

            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("TermNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("TermNames");

                ds = m_VWAWeightsData.Terminals;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("SiteNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("SiteNames");

                ds = m_VWAWeightsData.Sites;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("TypeCatalogNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("TypeCatalogNames");

                ds = m_VWAWeightsData.TypeCatalogs;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }

                objValueList.ValueListItems.Add(null, "Master");
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("PreconsumerNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("PreconsumerNames");
                objValueList.ValueListItems.Add(0, "Post consumer");
                objValueList.ValueListItems.Add(1, "Pre consumer");
                objValueList.ValueListItems.Add(2, "Intermediate");
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("FoodNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("FoodNames");

                ds = m_VWAWeightsData.FoodType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("LossNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("LossNames");

                ds = m_VWAWeightsData.LossType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("ContainerNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("ContainerNames");

                ds = m_VWAWeightsData.ContainerType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("StationNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("StationNames");

                ds = m_VWAWeightsData.StationType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("DispositionNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("DispositionNames");

                ds = m_VWAWeightsData.DispositionType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("DaypartNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("DaypartNames");

                ds = m_VWAWeightsData.DayPartType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("BEONames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("BEONames");

                ds = m_VWAWeightsData.BEOType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
            if (!this.gridViewWaste.DisplayLayout.ValueLists.Exists("UserNames"))
            {
                ValueList objValueList = this.gridViewWaste.DisplayLayout.ValueLists.Add("UserNames");

                ds = m_VWAWeightsData.UserType;
                for (int i = 0; i < ds.Rows.Count; i++)
                {
                    objValueList.ValueListItems.Add(ds.Rows[i].ItemArray[0], ds.Rows[i].ItemArray[1].ToString());
                }
                objValueList.SortStyle = ValueListSortStyle.Ascending;
            }
        }