コード例 #1
0
        private void SearchResult()
        {
            try
            {
                string keyword = CpanelUtils.ClearUnicode(txtKeyword.Value);

                var AllList = (from g in DB.ESHOP_NEWs
                               where ("" == keyword || DB.fClearUnicode(g.NEWS_TITLE).Contains(keyword) || g.NEWS_DESC.Contains(keyword))
                               //&& g.NEWS_LANGUAGE == lang
                               && (g.NEWS_TYPE != 1 && g.NEWS_TYPE != 2)
                               orderby g.NEWS_ID descending
                               select g);


                if (AllList.ToList().Count > 0)
                {
                    Session["NewsList"] = DataUtil.LINQToDataTable(AllList);
                }

                GridItemList.DataSource = AllList;
                if (AllList.ToList().Count > GridItemList.PageSize)
                {
                    GridItemList.AllowPaging = true;
                }
                else
                {
                    GridItemList.AllowPaging = false;
                }
                GridItemList.DataBind();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
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);
            }
        }
コード例 #4
0
        private void SearchResult()
        {
            try
            {
                int    _limit  = 20;
                int    _skip   = 0;
                string keyword = CpanelUtils.ClearUnicode(txtKeyword.Value);
                int    _catid  = Utils.CIntDef(ddlCategory.SelectedValue);
                if (_catid != 0 || !String.IsNullOrEmpty(keyword))
                {
                    _limit = 200;
                }

                if (_page != 0)
                {
                    _skip = _page * _limit - _limit;
                }
                var AllList = (from g in DB.ESHOP_NEWs
                               join a in DB.ESHOP_NEWS_CATs on g.NEWS_ID equals a.NEWS_ID into t2_join
                               from d in t2_join.DefaultIfEmpty()
                               where ("" == keyword || SqlMethods.Like(g.NEWS_KEYWORD_ASCII, "%" + keyword + "%") || g.NEWS_CODE.Contains(keyword)) &&
                               (_gtype != 1 ? (getCatid().Contains(d.ESHOP_CATEGORy.CAT_ID.ToString()) || getCatid().Contains(d.ESHOP_CATEGORy.CAT_PARENT_ID.ToString())) : true) &&
                               (_type == 1 ? g.NEWS_TYPE == 1 : g.NEWS_TYPE != 1) &&
                               ((d.ESHOP_CATEGORy.CAT_ID == _catid || d.ESHOP_CATEGORy.CAT_PARENT_PATH.Contains(_catid.ToString())) || 0 == _catid)
                               orderby g.NEWS_ID descending
                               select g).GroupBy(n => n.NEWS_ID).Select(n => new
                {
                    NEWS_ID          = n.First().NEWS_ID,
                    NEWS_TITLE       = n.First().NEWS_TITLE,
                    NEWS_TYPE        = n.First().NEWS_TYPE,
                    NEWS_SHOWTYPE    = n.First().NEWS_SHOWTYPE,
                    NEWS_ORDER       = n.First().NEWS_ORDER,
                    NEWS_PUBLISHDATE = n.First().NEWS_PUBLISHDATE,
                }).OrderByDescending(n => n.NEWS_ID).ToList();


                RpItemList.DataSource = AllList.Skip(_skip).Take(_limit);
                RpItemList.DataBind();
                LitPage.Text = pagechange.changePageNews("news_list.aspx", AllList.Count, _limit, _page, _type);
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
コード例 #5
0
        private void Loadinventory()
        {
            string keyword = CpanelUtils.ClearUnicode(txtKeyword.Value);
            var    list    = DB.ESHOP_NEWs.Where(n => n.NEWS_TYPE == 1 && (DB.fClearUnicode(n.NEWS_TITLE).Contains(keyword) || DB.fClearUnicode(n.NEWS_CODE).Contains(keyword) || "" == keyword)).OrderByDescending(n => n.NEWS_ID).ToList();

            if (list.Count > 0)
            {
                ASPxGridView_inventory.DataSource = list;
                ASPxGridView_inventory.DataBind();
                HttpContext.Current.Session["buy.listinvent"] = list;
            }
            else
            {
                HttpContext.Current.Session["buy.listinvent"] = null;
                ASPxGridView_inventory.DataSource             = list;
                ASPxGridView_inventory.DataBind();
            }
        }
コード例 #6
0
        private void SearchResult()
        {
            try
            {
                int    _limit  = 20;
                int    _skip   = 0;
                string keyword = CpanelUtils.ClearUnicode(txtKeyword.Value);
                int    _catid  = Utils.CIntDef(ddlCategory.SelectedValue);
                if (_catid != 0 || !String.IsNullOrEmpty(keyword))
                {
                    _limit = 200;
                }

                if (_page != 0)
                {
                    _skip = _page * _limit - _limit;
                }
                var AllList = (from g in DB.ESHOP_NEWs
                               join a in DB.ESHOP_NEWS_CATs on g.NEWS_ID equals a.NEWS_ID
                               join d in DB.ESHOP_CATEGORies on a.CAT_ID equals d.CAT_ID
                               where ("" == keyword || (DB.fClearUnicode(g.NEWS_TITLE)).Contains(keyword) || g.NEWS_CODE.Contains(keyword)) &&
                               (g.NEWS_TYPE == 1) && g.UNIT_ID2 > 0 &&
                               ((d.CAT_ID == _catid || d.CAT_PARENT_PATH.Contains(_catid.ToString())) || 0 == _catid)
                               orderby g.UNIT_ID2 descending
                               select g).GroupBy(n => n.NEWS_ID).Select(n => new
                {
                    UNIT_ID2         = n.First().UNIT_ID2,
                    NEWS_ID          = n.First().NEWS_ID,
                    NEWS_TITLE       = n.First().NEWS_TITLE,
                    NEWS_TYPE        = n.First().NEWS_TYPE,
                    NEWS_SHOWTYPE    = n.First().NEWS_SHOWTYPE,
                    NEWS_ORDER       = n.First().NEWS_ORDER,
                    NEWS_PUBLISHDATE = n.First().NEWS_PUBLISHDATE,
                }).OrderByDescending(n => n.NEWS_ID).ToList();
                RpItemList.DataSource = AllList.Skip(_skip).Take(_limit);
                RpItemList.DataBind();
                LitPage.Text = pagechange.changePageNews(AllList.Count, _limit, "xulylinkdie.aspx", _page, _type, 10);
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
コード例 #7
0
 private void SearchResult()
 {
     try
     {
         int    _limit  = 40;
         int    _skip   = 0;
         string keyword = CpanelUtils.ClearUnicode(txtKeyword.Value);
         if (_page != 0)
         {
             _skip = _page * _limit - _limit;
         }
         var AllList = (from g in DB.ESHOP_NEWs
                        where (g.NEWS_TYPE == 1 && ("" == keyword || (DB.fClearUnicode(g.NEWS_TITLE)).Contains(keyword)))
                        select new
         {
             g.NEWS_ID,
             g.NEWS_TITLE,
             g.NEWS_PERIOD,
             g.NEWS_COUNT,
             g.NEWS_ORDER,
             g.NEWS_ORDER_PERIOD,
             g.NEWS_PUBLISHDATE,
         }).ToList();
         if (_News_period == 1)
         {
             AllList = AllList.OrderByDescending(n => n.NEWS_ID).ToList();
         }
         else
         {
             AllList = AllList.OrderByDescending(n => n.NEWS_COUNT).ToList();
         }
         Rplist_news.DataSource = AllList.Skip(_skip).Take(_limit);
         Rplist_news.DataBind();
         LitPage.Text = changePageNews(AllList.Count, _limit, "duyet_video_index.aspx", _page, 10);
     }
     catch (Exception ex)
     {
         clsVproErrorHandler.HandlerError(ex);
     }
 }
コード例 #8
0
        private void loadListInventory()
        {
            string   keyword = CpanelUtils.ClearUnicode(txtKeyword.Value);
            string   date    = txtDate.Text;
            DateTime dt      = DateTime.Now;

            if (!String.IsNullOrEmpty(date))
            {
                dt = Utils.CDateDef(catngay(date), DateTime.Now);
            }
            //int khoid = Utils.CIntDef(Drkho.SelectedValue);
            //int nhacccid = Utils.CIntDef(Drnhacc.SelectedValue);
            var list = (from a in db.ESHOP_NEWs
                        join b in db.INVENTORies on a.NEWS_ID equals b.NEWS_ID
                        where b.INVENT_TYPE == type && (db.fClearUnicode(a.NEWS_TITLE).Contains(keyword) || db.fClearUnicode(a.NEWS_CODE).Contains(keyword) || "" == keyword)
                        //&&(b.INVENT_KHO==khoid||0==khoid)&&(b.INVENT_NHACC==nhacccid||0==nhacccid)
                        && (!String.IsNullOrEmpty(date) ? b.INVENT_DATE.Value.Date == dt : 0 == 0)
                        select new
            {
                a.NEWS_TITLE,
                a.NEWS_CODE,
                b.INVENT_TYPE,
                b.ID,
                b.INVENT_DATE,
                b.INVENT_QUANTITY,
                b.USER_ID,
                b.INVENT_NHACC,
                b.INVENT_KHO,
                b.INVENT_PRICE,
                b.INVENT_NAMEKH,
                b.INVENT_ADDRESS,
                b.INVENT_CHIECKHAU,
                b.INVENT_NO,
                b.INVENT_NOTE
            }).OrderByDescending(n => n.ID).ToList();

            RplistInvent.DataSource = list;
            RplistInvent.DataBind();
        }