/// <summary>
        /// Attribute Listing Tree..
        /// </summary>
        /// <returns></returns>
        public object createTreeAttributeName()
        {
            StringBuilder sql = new StringBuilder();

            sql.Append(MRole.GetDefault(_ctx).AddAccessSQL("SELECT M_Attribute_id  , Name FROM M_Attribute  WHERE IsActive='Y'", "M_Attribute", true, true));
            sql.Append("~");
            sql.Append(MRole.GetDefault(_ctx).AddAccessSQL("SELECT ma.M_Attribute_id,mv.m_attributevalue_id, ma.Name as NameAttribute,mv.Name FROM M_Attribute ma inner JOIN m_attributevalue mv ON ma.M_Attribute_id=mv.M_Attribute_id", "M_Attribute", true, true));

            SqlParamsIn sqlpar = new SqlParamsIn();

            sqlpar.sql      = sql.ToString();
            sqlpar.pageSize = 0;

            VIS.Helpers.SqlHelper sHelper = new VIS.Helpers.SqlHelper();

            DataSet ds = sHelper.ExecuteDataSet(sqlpar);

            if (ds == null || ds.Tables.Count < 1)
            {
                return(null);
            }

            VA005_TreeStructure tree = new VA005_TreeStructure();

            tree.text   = Msg.GetMsg(_ctx, "VA005_AttributeTree");
            tree.NodeID = 0;
            tree.items  = new List <VA005_TreeStructure>();
            LoadAttributeName(ds, tree);

            List <VA005_TreeStructure> final = new List <VA005_TreeStructure>();

            final.Add(tree);
            return(final);
        }
        /// <summary>
        /// USed to Create Tree. This is main function which intialize tree creation.
        /// </summary>
        public object CreateTree(string Expend)
        {
            exp = Expend;
            StringBuilder sql = new StringBuilder();

            sql.Append(MRole.GetDefault(_ctx).AddAccessSQL("SELECT m_attributeSet_ID , Name FROM m_attributeSet WHERE IsActive='Y' ORDER BY LOWER(Name),m_attributeSet_ID", "M_AttributeSet", true, true));
            sql.Append("~");
            sql.Append(MRole.GetDefault(_ctx).AddAccessSQL(@"SELECT m_attribute.m_attribute_ID,m_attribute.Name,m_attributeuse.m_attributeset_id,m_attribute.ATTRIBUTEVALUETYPE
                                        FROM m_attributeuse
                                        JOIN m_attribute
                                        ON m_attributeuse.m_attribute_ID=m_attribute.m_attribute_ID WHERE m_attributeuse.IsActive='Y' AND m_attributeuse.IsActive='Y' ORDER BY m_attribute.Name,m_attribute.m_attribute_ID", "M_AttributeUse", true, true));
            sql.Append("~");
            sql.Append(MRole.GetDefault(_ctx).AddAccessSQL("SELECT m_attribute_ID , name,  M_AttributeValue_ID FROM M_AttributeValue WHERE IsActive='Y' ORDER BY name,m_attribute_ID  ", "M_AttributeValue", true, true));
            sql.Append("~");

            SqlParamsIn sqlpar = new SqlParamsIn();

            sqlpar.sql      = sql.ToString();
            sqlpar.pageSize = 0;

            VIS.Helpers.SqlHelper sHelper = new VIS.Helpers.SqlHelper();

            DataSet ds = sHelper.ExecuteDataSet(sqlpar);

            if (ds == null || ds.Tables.Count < 1)
            {
                return(null);
            }

            VA005_TreeStructure tree = new VA005_TreeStructure();

            tree.text   = Msg.GetMsg(_ctx, "VA005_AttributeSetListing");
            tree.NodeID = 0;
            //tree.ParentID = 0;
            tree.expanded   = true;
            tree.visibility = "none";
            tree.ShowInfo   = "none";
            tree.padding    = "8px 10px 8px 10px";
            tree.margin     = "0 0 0 0";

            //tree.ImageSource = "Areas/VA005/Images/1.png";
            tree.items = new List <VA005_TreeStructure>();
            LoadAttributeSet(ds, tree);
            //hidden
            List <VA005_TreeStructure> final = new List <VA005_TreeStructure>();

            final.Add(tree);


            return(final);
        }