private void SearchResult()
        {
            try
            {
                string keyword = CpanelUtils.ClearUnicode(txtKeyword.Value);

                var AllList = (from g in DB.ESHOP_CATEGORies
                               where ("" == keyword || (DB.fClearUnicode(g.CAT_NAME)).Contains(keyword)) && g.CAT_RANK > 0
                               select new
                {
                    g.CAT_ID,
                    g.CAT_PARENT_ID,
                    CAT_NAME = (string.IsNullOrEmpty(g.CAT_CODE) ? g.CAT_NAME : g.CAT_NAME + "(" + g.CAT_CODE + ")"),
                    g.CAT_POSITION,
                    g.CAT_LANGUAGE,
                    g.CAT_ORDER,
                    g.CAT_PERIOD_ORDER,
                    g.CAT_RANK,
                    g.CAT_STATUS
                });

                if (AllList.ToList().Count > 0)
                {
                    DataRelation relCat;
                    //Session["CatList"] = DataUtil.LINQToDataTable(AllList);
                    //DataTable tbl = Session["CatList"] as DataTable;
                    DataTable tbl = DataUtil.LINQToDataTable(AllList);

                    DataSet ds = new DataSet();
                    ds.Tables.Add(tbl);

                    tbl.PrimaryKey = new DataColumn[] { tbl.Columns["CAT_ID"] };
                    relCat         = new DataRelation("Category_parent", ds.Tables[0].Columns["CAT_ID"], ds.Tables[0].Columns["CAT_PARENT_ID"], false);

                    ds.Relations.Add(relCat);
                    DataSet   dsCat    = ds.Clone();
                    DataTable CatTable = ds.Tables[0];

                    DataUtil.TransformTableWithSpace(ref CatTable, dsCat.Tables[0], relCat, null);
                    if (IsPostBack)
                    {
                        Rplistcate.DataSource = AllList;
                        Rplistcate.DataBind();
                    }
                    else
                    {
                        Rplistcate.DataSource = dsCat.Tables[0];
                        Rplistcate.DataBind();
                    }
                }
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
Esempio n. 2
0
        private void SearchResult()
        {
            try
            {
                string keyword = CpanelUtils.ClearUnicode(txtKeyword.Value);
                if (_gtype != 1)
                {
                    var AllList = (from g in DB.ESHOP_SHOPs
                                   where ("" == keyword || (DB.fClearUnicode(g.NAME)).Contains(keyword)) &&
                                   g.FIELD1 == _userId.ToString()
                                   select new
                    {
                        g.ID,
                        g.NAME,
                        g.EMAIL,
                        g.ADDRESS,
                        g.PHONE,
                        g.FIELD1,
                        g.WEBSITE,
                        g.TYPE,
                        g.SEO_URL
                    });

                    Rplistcate.DataSource = AllList;
                    Rplistcate.DataBind();
                }
                else
                {
                    var AllList = (from g in DB.ESHOP_SHOPs
                                   where ("" == keyword || (DB.fClearUnicode(g.NAME)).Contains(keyword))
                                   select new
                    {
                        g.ID,
                        g.NAME,
                        g.EMAIL,
                        g.ADDRESS,
                        g.PHONE,
                        g.FIELD1,
                        g.WEBSITE,
                        g.TYPE,
                        g.SEO_URL
                    });

                    Rplistcate.DataSource = AllList;
                    Rplistcate.DataBind();
                }
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
Esempio n. 3
0
        private void LoadCat()
        {
            try
            {
                var AllList = (from g in DB.ESHOP_CATEGORies
                               where g.CAT_RANK > 0
                               select g);

                if (AllList.ToList().Count > 0)
                {
                    DataRelation relCat;
                    //Session["CatList"] = DataUtil.LINQToDataTable(AllList);
                    //DataTable tbl = Session["CatList"] as DataTable;
                    DataTable tbl = DataUtil.LINQToDataTable(AllList);

                    DataSet ds = new DataSet();
                    ds.Tables.Add(tbl);

                    tbl.PrimaryKey = new DataColumn[] { tbl.Columns["CAT_ID"] };
                    relCat         = new DataRelation("Category_parent", ds.Tables[0].Columns["CAT_ID"], ds.Tables[0].Columns["CAT_PARENT_ID"], false);

                    ds.Relations.Add(relCat);
                    DataSet   dsCat    = ds.Clone();
                    DataTable CatTable = ds.Tables[0];

                    DataUtil.TransformTableWithSpace(ref CatTable, dsCat.Tables[0], relCat, null);
                    Rplistcate.DataSource = dsCat.Tables[0];
                    Rplistcate.DataBind();
                }


                //var allCat=DB.GetTable<ESHOP_CATEGORy>();

                //GridItemList.DataSource = allCat;
                //GridItemList.DataBind();

                //Session["CatGroupList"] = allCat;
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
        private void LoadCat()
        {
            try
            {
                var AllList = (from g in DB.ESHOP_CATEGORies
                               where g.CAT_RANK > 0
                               select new
                {
                    g.CAT_ID,
                    g.CAT_PARENT_ID,
                    g.CAT_RANK,
                    CAT_NAME = (string.IsNullOrEmpty(g.CAT_CODE) ? g.CAT_NAME : g.CAT_NAME + "(" + g.CAT_CODE + ")")
                });

                if (AllList.ToList().Count > 0)
                {
                    DataRelation relCat;
                    Session["CatNewsList"] = DataUtil.LINQToDataTable(AllList);
                    DataTable tbl = Session["CatNewsList"] as DataTable;

                    DataSet ds = new DataSet();
                    ds.Tables.Add(tbl);

                    tbl.PrimaryKey = new DataColumn[] { tbl.Columns["CAT_ID"] };
                    relCat         = new DataRelation("Category_parent", ds.Tables[0].Columns["CAT_ID"], ds.Tables[0].Columns["CAT_PARENT_ID"], false);

                    ds.Relations.Add(relCat);
                    DataSet   dsCat    = ds.Clone();
                    DataTable CatTable = ds.Tables[0];

                    DataUtil.TransformTableWithSpace(ref CatTable, dsCat.Tables[0], relCat, null);

                    Rplistcate.DataSource = dsCat.Tables[0];
                    Rplistcate.DataBind();
                }
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }