/// <summary>
        /// Get Dimension Type
        /// </summary>
        /// <param name="ctx">Context</param>
        /// <returns>List of Dimension Type</returns>
        public List <InfoRefList> GetDimensionType(Ctx ctx)
        {
            List <InfoRefList> list = new List <InfoRefList>();
            int Reference_ID        = Convert.ToInt32(VAdvantage.DataBase.DB.ExecuteScalar("SELECT AD_Reference_Value_ID FROM AD_Column WHERE Export_ID='VIS_2663'"));

            ValueNamePair[] refList = MRefList.GetList(Reference_ID, true, ctx);
            InfoRefList     itm     = null;// new InfoRefList();

            // itm.Key = "";
            // itm.Value = "";
            // list.Add(itm);
            for (int i = 0; i < refList.Length; i++)
            {
                if (refList[i].GetKeyID().ToString() != "")
                {
                    itm       = new InfoRefList();
                    itm.Key   = refList[i].GetKeyID().ToString(); //["Value"].ToString();
                    itm.Value = refList[i].GetName();             // ds.Tables[0].Rows[i]["Name"].ToString();

                    list.Add(itm);
                }
            }
            refList = null;
            return(list);
        }
Beispiel #2
0
        private List <InfoRefList> GetRefList(int AD_Reference_ID, Ctx ctx)
        {
            //String sql = "SELECT Value, Name FROM AD_Ref_List "
            //    + "WHERE AD_Reference_ID=" + AD_Reference_ID + " AND IsActive='Y' ORDER BY 1";
            //DataSet ds = null;

            List <InfoRefList> list = new List <InfoRefList>();

            try
            {
                ValueNamePair[] refList = MRefList.GetList(AD_Reference_ID, true, ctx);
                //ds = DB.ExecuteDataset(sql, null, null);
                InfoRefList itm = null;    // new InfoRefList();
                // itm.Key = "";
                // itm.Value = "";
                // list.Add(itm);
                for (int i = 0; i < refList.Length; i++)
                {
                    itm       = new InfoRefList();
                    itm.Key   = refList[i].GetKeyID().ToString(); //["Value"].ToString();
                    itm.Value = refList[i].GetValue();            // ds.Tables[0].Rows[i]["Name"].ToString();

                    list.Add(itm);
                }
                refList = null;
            }
            catch (Exception)
            {
            }

            return(list);
        }
        private List <InfoRefList> GetRefList(int AD_Reference_ID)
        {
            try
            {
                String sql = "SELECT Value, Name FROM AD_Ref_List "
                             + "WHERE AD_Reference_ID=" + AD_Reference_ID + " AND IsActive='Y' ORDER BY 1";
                DataSet            ds   = null;
                List <InfoRefList> list = new List <InfoRefList>();
                try
                {
                    ds = DB.ExecuteDataset(sql, null, null);
                    InfoRefList itm = new InfoRefList();
                    itm.Key   = "";
                    itm.Value = "";
                    list.Add(itm);
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        itm       = new InfoRefList();
                        itm.Key   = ds.Tables[0].Rows[i]["Value"].ToString();
                        itm.Value = ds.Tables[0].Rows[i]["Name"].ToString();

                        list.Add(itm);
                    }
                    ds = null;
                }
                catch (Exception)
                {
                }

                return(list);
            }
            catch
            {
                return(null);
            }
        }