예제 #1
0
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product      bll        = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.PurductName = Utils.GetQueryStringValue("productName");


            if (Utils.GetQueryStringValue("proType") == "-2")
            {
                serchModel.PType = 2;
            }
            else if (Utils.GetQueryStringValue("proType") == "-3")
            {
                serchModel.PType = 3;
            }
            else
            {
                serchModel.PurductType = Utils.GetQueryStringValue("proType");
                serchModel.PType       = 1;
            }
            serchModel.isVisable = false;
            var list = bll.GetList(pagesize, pageindex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
            }
            else
            {
                PlaceHolder1.Visible = false;
            }
        }
예제 #2
0
        /// <summary>
        /// 返回列表
        /// </summary>
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product      bll        = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.PurductName = prodectName;
            serchModel.PurductType = productType;
            serchModel.isVisable   = false;
            serchModel.isHot       = Utils.GetIntNull(tuijian);
            serchModel.WeiDianId   = Utils.GetQueryStringValue("weidianid");
            if (!string.IsNullOrEmpty(xianlu))
            {
                serchModel.xianlu = (Eyousoft_yhq.Model.XianLu)Utils.GetInt(xianlu);
            }
            var list   = bll.GetList(pagesize, pageindex, ref recordCount, serchModel);
            int isPage = 0;

            if (recordCount % pagesize != 0)
            {
                isPage = recordCount / pagesize + 1;
            }
            else
            {
                isPage = recordCount / pagesize;
            }
            if (list != null && list.Count > 0)
            {
                if (isPage >= pageindex)
                {
                    rpt_list.DataSource = list;
                    rpt_list.DataBind();
                }
            }
        }
예제 #3
0
        /// <summary>
        /// 返回列表
        /// </summary>
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product bll = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.PurductName = prodectName;
            serchModel.PurductType = productType;
            serchModel.isVisable = false;
            serchModel.isHot = Utils.GetIntNull(tuijian);
            serchModel.WeiDianId = Utils.GetQueryStringValue("weidianid");
            if (!string.IsNullOrEmpty(xianlu)) serchModel.xianlu = (Eyousoft_yhq.Model.XianLu)Utils.GetInt(xianlu);
            var list = bll.GetList(pagesize, pageindex, ref recordCount, serchModel);
            int isPage = 0;
            if (recordCount % pagesize != 0)
            {
                isPage = recordCount / pagesize + 1;
            }
            else
            {
                isPage = recordCount / pagesize;
            }
            if (list != null && list.Count > 0)
            {

                if (isPage >= pageindex)
                {
                    rpt_list.DataSource = list;
                    rpt_list.DataBind();
                }

            }
        }
예제 #4
0
파일: Index.aspx.cs 프로젝트: ichoukou/yhq
        /// <summary>
        /// 初始化页面
        /// </summary>
        protected void InitList()
        {
            Eyousoft_yhq.Model.SerProduct serModel = new Eyousoft_yhq.Model.SerProduct();
            serModel.PType       = Utils.GetInt(Utils.GetQueryStringValue("tp"));
            serModel.PurductName = Utils.GetQueryStringValue("keys");
            serModel.SFTJ        = Utils.GetInt(Utils.GetQueryStringValue("ishot"));
            serModel.DDXL        = Utils.GetInt(Utils.GetQueryStringValue("sale"));
            serModel.SJPX        = Utils.GetInt(Utils.GetQueryStringValue("issue"));
            serModel.JGPX        = Utils.GetInt(Utils.GetQueryStringValue("price"));
            int Productype = Utils.GetInt(Utils.GetQueryStringValue("routype"));

            serModel.PurductType = Productype > 0 ? Productype.ToString() : "";

            #region 输出样式
            //tj = getClass(serModel.SFTJ);
            xl = getClass(serModel.DDXL);
            zx = getClass(serModel.SJPX);
            jg = getClass(serModel.JGPX);
            #endregion


            pageIndex = UtilsCommons.GetPagingIndex("Page");
            IList <Eyousoft_yhq.Model.Product> list = new Eyousoft_yhq.BLL.Product().GetList(pageSize, pageIndex, ref recordCount, serModel);

            UtilsCommons.Paging(pageSize, ref pageIndex, recordCount);
            string pagingScript = "pagingConfig.pageSize={0};pagingConfig.pageIndex={1};pagingConfig.recordCount={2};";
            if (list != null && list.Count > 0)
            {
                rpt_products.DataSource = list;
                rpt_products.DataBind();
            }
            RegisterScript(string.Format(pagingScript, pageSize, pageIndex, recordCount));
        }
예제 #5
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected void InitBind()
        {
            Eyousoft_yhq.BLL.Product PBll = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct PModel = new Eyousoft_yhq.Model.SerProduct();
            PModel.SFTJ = 1;

            IList<Eyousoft_yhq.Model.Product> list = PBll.GetList(pageSize, pageIndex, ref recordCount, PModel);
            if (list != null && list.Count > 0)
            {
                rpList.DataSource = list;
                rpList.DataBind();
            }
        }
예제 #6
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected void InitBind()
        {
            Eyousoft_yhq.BLL.Product      PBll   = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct PModel = new Eyousoft_yhq.Model.SerProduct();
            PModel.SFTJ = 1;


            IList <Eyousoft_yhq.Model.Product> list = PBll.GetList(pageSize, pageIndex, ref recordCount, PModel);

            if (list != null && list.Count > 0)
            {
                rpList.DataSource = list;
                rpList.DataBind();
            }
        }
예제 #7
0
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product      bll        = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.PurductName = Utils.GetQueryStringValue("productName");
            if (Utils.GetInt(Utils.GetQueryStringValue("tuijian")) == 1)
            {
                serchModel.isHot = 1;
            }
            if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("xianlu")))
            {
                serchModel.xianlu = (Eyousoft_yhq.Model.XianLu)Utils.GetInt(Utils.GetQueryStringValue("xianlu"));
            }

            if (Utils.GetQueryStringValue("proType") == "-2")
            {
                serchModel.PType = 2;
            }
            else if (Utils.GetQueryStringValue("proType") == "-3")
            {
                serchModel.PType = 3;
            }
            else
            {
                serchModel.PurductType = Utils.GetQueryStringValue("proType");
                serchModel.PType       = 1;
            }
            serchModel.isVisable = false;
            serchModel.WeiDianId = WeiDianId;

            if (serchModel.isHot.HasValue && serchModel.isHot.Value == 1)
            {
                serchModel.WeiDianId = string.Empty;
            }

            var list = bll.GetList(pagesize, pageindex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
            }
            else
            {
                PlaceHolder1.Visible = false;
            }
        }
예제 #8
0
        /// <summary>
        /// 初始化列表
        /// </summary>
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product      bll        = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.FavourCode = Utils.GetQueryStringValue("productName");
            pageIndex             = UtilsCommons.GetPagingIndex("Page");
            var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
                BindPage();
                litMsg.Visible = false;
            }
            else
            {
                rpt_list.Visible = false;
            }
        }
예제 #9
0
        /// <summary>
        /// 初始化列表
        /// </summary>
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product bll = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.FavourCode = Utils.GetQueryStringValue("productName");
            pageIndex = UtilsCommons.GetPagingIndex("Page");
            var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel);
            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
                BindPage();
                litMsg.Visible = false;

            }
            else
            {
                rpt_list.Visible = false;
            }
        }
예제 #10
0
        void initList()
        {
            Eyousoft_yhq.BLL.Product      bll        = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.AdminName   = HuiYuanInfo.UserId;
            serchModel.PType       = 2;
            serchModel.PurductName = Utils.GetQueryStringValue("BusTicket");
            pageIndex = UtilsCommons.GetPagingIndex("Page");
            var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
                BindPage();
                litMsg.Visible = false;
            }
            else
            {
                rpt_list.Visible = false;
            }
        }
예제 #11
0
        void initList()
        {
            Eyousoft_yhq.BLL.Product bll = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.AdminName = HuiYuanInfo.UserId;
            serchModel.PType = 2;
            serchModel.PurductName = Utils.GetQueryStringValue("BusTicket");
            pageIndex = UtilsCommons.GetPagingIndex("Page");
            var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel);
            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
                BindPage();
                litMsg.Visible = false;

            }
            else
            {
                rpt_list.Visible = false;
            }
        }
예제 #12
0
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product bll = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.AdminName = HuiYuanInfo.UserId;
            serchModel.PType = 1;
            serchModel.PurductName = Utils.GetQueryStringValue("productName");
            serchModel.FavourCode = Utils.GetQueryStringValue("FavourCode");
            serchModel.PurductState = Utils.GetQueryStringValue("pstate");
            serchModel.Stime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("stime"));
            serchModel.Etime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("etime"));
            serchModel.isVisable = true;
            serchModel.IsAdmin = HuiYuanInfo.IsAdmin?"1":"0";
            serchModel.isHot = Utils.GetIntNull(Utils.GetQueryStringValue("isHot"));
            serchModel.PurductType = Utils.GetInt(Utils.GetQueryStringValue("ptype")).ToString();
            serchModel.ShenHeStatus = (Eyousoft_yhq.Model.ChanPinShenHeStatus?)Utils.GetEnumValueNull(typeof(Eyousoft_yhq.Model.ChanPinShenHeStatus), Utils.GetQueryStringValue("txtShenHeStatus"));

            if (HuiYuanInfo.LeiXing == Eyousoft_yhq.Model.WebmasterLeiXing.供应商)
            {
                serchModel.FaBuRenId = HuiYuanInfo.UserId;
            }

            pageIndex = UtilsCommons.GetPagingIndex("Page");
            var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel);
            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
                BindPage();
                litMsg.Visible = false;

            }
            else
            {
                rpt_list.Visible = false;
            }
        }
예제 #13
0
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product      bll        = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.AdminName    = HuiYuanInfo.UserId;
            serchModel.PType        = 1;
            serchModel.PurductName  = Utils.GetQueryStringValue("productName");
            serchModel.FavourCode   = Utils.GetQueryStringValue("FavourCode");
            serchModel.PurductState = Utils.GetQueryStringValue("pstate");
            serchModel.Stime        = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("stime"));
            serchModel.Etime        = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("etime"));
            serchModel.isVisable    = true;
            serchModel.IsAdmin      = HuiYuanInfo.IsAdmin?"1":"0";
            serchModel.isHot        = Utils.GetIntNull(Utils.GetQueryStringValue("isHot"));
            serchModel.PurductType  = Utils.GetInt(Utils.GetQueryStringValue("ptype")).ToString();
            serchModel.ShenHeStatus = (Eyousoft_yhq.Model.ChanPinShenHeStatus?)Utils.GetEnumValueNull(typeof(Eyousoft_yhq.Model.ChanPinShenHeStatus), Utils.GetQueryStringValue("txtShenHeStatus"));

            if (HuiYuanInfo.LeiXing == Eyousoft_yhq.Model.WebmasterLeiXing.供应商)
            {
                serchModel.FaBuRenId = HuiYuanInfo.UserId;
            }

            pageIndex = UtilsCommons.GetPagingIndex("Page");
            var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
                BindPage();
                litMsg.Visible = false;
            }
            else
            {
                rpt_list.Visible = false;
            }
        }
예제 #14
0
        public IList <Eyousoft_yhq.Model.Product> GetList(int PageSize, int PageIndex, ref int RecordCount, Eyousoft_yhq.Model.SerProduct serModel)
        {
            IList <Eyousoft_yhq.Model.Product> list = new List <Eyousoft_yhq.Model.Product>();


            string tableName     = "view_Product";
            string fileds        = " *  ";
            string orderByString = "";

            StringBuilder query = new StringBuilder();

            query.Append(" 1=1  ");

            if (serModel != null)
            {
                #region 排序
                if (serModel.SFTJ == 1)
                {
                    orderByString += " IsHot DESC,";
                }
                if (serModel.DDXL == 1)
                {
                    orderByString += "SaleNum DESC,";
                }
                if (serModel.DDXL == 2)
                {
                    orderByString += "SaleNum ASC,";
                }
                if (serModel.SJPX == 1)
                {
                    orderByString += "CreateDate DESC,";
                }
                else if (serModel.SJPX == 2)
                {
                    orderByString += "CreateDate  ASC,";
                }

                if (serModel.JGPX == 1)
                {
                    orderByString += "AppPrice DESC,";
                }
                if (serModel.JGPX == 2)
                {
                    orderByString += "AppPrice ASC,";
                }

                if (!string.IsNullOrEmpty(orderByString))
                {
                    orderByString = orderByString.TrimEnd(',');
                }
                else
                {
                    orderByString = "IsHot DESC,CreateDate desc";
                }
                #endregion

                if (!string.IsNullOrEmpty(serModel.FavourCode))
                {
                    query.AppendFormat(" and  (FavourCode = '{0}' )", serModel.FavourCode);
                }
                if (serModel.PType > 0)
                {
                    query.AppendFormat(" and  (PType = {0} )", serModel.PType);
                }

                if (serModel.IsAdmin != "1" && !string.IsNullOrEmpty(serModel.AdminName))
                {
                    query.AppendFormat(" and (  charindex('{0}',[AdminName])>0 or  AdminName is null)", serModel.AdminName);
                }

                if (!string.IsNullOrEmpty(serModel.PurductName))
                {
                    query.AppendFormat(" and  ProductName like '%{0}%' ", serModel.PurductName);
                }

                if (!string.IsNullOrEmpty(serModel.PurductType) && serModel.PurductType != "0")
                {
                    query.AppendFormat(" and  ProductType = '{0}' ", serModel.PurductType);
                }
                if (!string.IsNullOrEmpty(serModel.PurductState) && serModel.PurductState != "2")
                {
                    query.AppendFormat(" and  ProductState = '{0}' ", serModel.PurductState);
                }
                if (serModel.Stime.HasValue)
                {
                    query.AppendFormat(" AND datediff(day,'{0}',ValidiDate)>=0 ", serModel.Stime.Value);
                }
                if (serModel.Etime.HasValue)
                {
                    query.AppendFormat(" AND datediff(day,'{0}',ValidiDate)< 0 ", serModel.Etime.Value.AddDays(1));
                }
                if (!serModel.isVisable)
                {
                    query.AppendFormat(" AND ProductState = 0 ");
                }
                if (serModel.isHot.HasValue && serModel.isHot == 1)
                {
                    query.AppendFormat(" and  IsHot = '{0}' ", serModel.isHot);
                }
                else if (serModel.isHot.HasValue && serModel.isHot == 0)
                {
                    query.AppendFormat(" and  (IsHot = '{0}'  or IsHot is null) ", serModel.isHot);
                }

                if (serModel.xianlu != null && serModel.PType == 1)
                {
                    query.AppendFormat(" and  XianLu = '{0}' ", (int)serModel.xianlu);
                }

                if (!string.IsNullOrEmpty(serModel.WeiDianId))
                {
                    query.AppendFormat(" AND EXISTS(SELECT 1 FROM tbl_WeiDianChanPinGuanXi AS A1 WHERE A1.ChanPinId=view_Product.ProductID AND A1.WeiDianId='{0}') ", serModel.WeiDianId);
                }

                if (!string.IsNullOrEmpty(serModel.FaBuRenId))
                {
                    query.AppendFormat(" AND FaBuRenId='{0}' ", serModel.FaBuRenId);
                }
                if (serModel.ShenHeStatus.HasValue)
                {
                    query.AppendFormat(" AND ShenHeStatus={0} ", (int)serModel.ShenHeStatus.Value);
                }
            }
            else
            {
                orderByString = "IsHot DESC,CreateDate desc";
            }

            using (IDataReader dr = DbHelper.ExecuteReader1(this._db, PageSize, PageIndex, ref RecordCount, tableName, fileds, query.ToString(), orderByString, null))
            {
                while (dr.Read())
                {
                    Eyousoft_yhq.Model.Product model = new Eyousoft_yhq.Model.Product();
                    model.ProductID      = dr.GetString(dr.GetOrdinal("ProductID"));;
                    model.ProductName    = dr.GetString(dr.GetOrdinal("ProductName"));
                    model.ProductType    = dr.GetInt32(dr.GetOrdinal("ProductType"));
                    model.TourDate       = dr.IsDBNull(dr.GetOrdinal("TourDate")) ? null : Utils.GetDateTimeNullable(dr.GetDateTime(dr.GetOrdinal("TourDate")).ToString());
                    model.MarketPrice    = dr.GetDecimal(dr.GetOrdinal("MarketPrice"));
                    model.AppPrice       = dr.GetDecimal(dr.GetOrdinal("AppPrice"));
                    model.FavourCode     = dr.GetString(dr.GetOrdinal("FavourCode"));
                    model.LinkTel        = dr.GetString(dr.GetOrdinal("LinkTel"));
                    model.ProductDis     = dr.GetString(dr.GetOrdinal("ProductDis"));
                    model.TourDis        = dr.GetString(dr.GetOrdinal("TourDis"));
                    model.SendTourKnow   = dr.GetString(dr.GetOrdinal("SendTourKnow"));
                    model.ValidiDate     = dr.GetDateTime(dr.GetOrdinal("ValidiDate"));
                    model.ProductState   = dr.GetByte(dr.GetOrdinal("ProductState"));
                    model.IsEveryDay     = dr.IsDBNull(dr.GetOrdinal("IsEveryDay")) ? false : GetBoolean(dr.GetString(dr.GetOrdinal("IsEveryDay")));
                    model.IsHot          = dr.IsDBNull(dr.GetOrdinal("IsHot")) ? 0 : dr.GetByte(dr.GetOrdinal("IsHot"));
                    model.CreateDate     = dr.GetDateTime(dr.GetOrdinal("CreateDate"));
                    model.ServiceQQ      = dr.IsDBNull(dr.GetOrdinal("ServiceQQ")) ? "" : dr.GetString(dr.GetOrdinal("ServiceQQ"));
                    model.ContractType   = (Eyousoft_yhq.Model.ContractType)dr.GetByte(dr.GetOrdinal("ContractType"));
                    model.ControlPeople  = dr.GetInt32(dr.GetOrdinal("ControlPeople"));
                    model.ResidueNum     = dr.GetInt32(dr.GetOrdinal("ResidueNum"));
                    model.SaleNum        = dr.GetInt32(dr.GetOrdinal("SaleNum"));
                    model.ProductOpState = (Eyousoft_yhq.Model.ProductOp)dr.GetByte(dr.GetOrdinal("ProductOpState"));
                    model.ProductSdate   = dr.IsDBNull(dr.GetOrdinal("ProductSdate")) ? DateTime.Now : dr.GetDateTime(dr.GetOrdinal("ProductSdate"));
                    model.ZCodeViaDate   = dr.IsDBNull(dr.GetOrdinal("ZCodeViaDate")) ? DateTime.Now : dr.GetDateTime(dr.GetOrdinal("ZCodeViaDate"));
                    model.PType          = dr.IsDBNull(dr.GetOrdinal("PType")) ? 1 : dr.GetInt32(dr.GetOrdinal("PType"));
                    model.xianlu         = dr.IsDBNull(dr.GetOrdinal("XianLu")) ? Eyousoft_yhq.Model.XianLu.国内游 : (Eyousoft_yhq.Model.XianLu)dr.GetByte(dr.GetOrdinal("XianLu"));
                    model.FaBuRenId      = dr["FaBuRenId"].ToString();
                    model.ShenHeStatus   = (Eyousoft_yhq.Model.ChanPinShenHeStatus)dr.GetInt32(dr.GetOrdinal("ShenHeStatus"));
                    model.FaBuRenName    = dr["FaBuRenName"].ToString();

                    list.Add(model);
                }
            }
            return(list);
        }
예제 #15
0
파일: Index.aspx.cs 프로젝트: uwitec/O2O
        /// <summary>
        /// 初始化页面
        /// </summary>
        protected void InitList()
        {
            Eyousoft_yhq.Model.SerProduct serModel = new Eyousoft_yhq.Model.SerProduct();
            serModel.PType = Utils.GetInt(Utils.GetQueryStringValue("tp"));
            serModel.PurductName = Utils.GetQueryStringValue("keys");
            serModel.SFTJ = Utils.GetInt(Utils.GetQueryStringValue("ishot"));
            serModel.DDXL = Utils.GetInt(Utils.GetQueryStringValue("sale"));
            serModel.SJPX = Utils.GetInt(Utils.GetQueryStringValue("issue"));
            serModel.JGPX = Utils.GetInt(Utils.GetQueryStringValue("price"));
            int Productype = Utils.GetInt(Utils.GetQueryStringValue("routype"));
            serModel.PurductType = Productype > 0 ? Productype.ToString() : "";

            #region 输出样式
            //tj = getClass(serModel.SFTJ);
            xl = getClass(serModel.DDXL);
            zx = getClass(serModel.SJPX);
            jg = getClass(serModel.JGPX);
            #endregion

            pageIndex = UtilsCommons.GetPagingIndex("Page");
            IList<Eyousoft_yhq.Model.Product> list = new Eyousoft_yhq.BLL.Product().GetList(pageSize, pageIndex, ref recordCount, serModel);

            UtilsCommons.Paging(pageSize, ref pageIndex, recordCount);
            string pagingScript = "pagingConfig.pageSize={0};pagingConfig.pageIndex={1};pagingConfig.recordCount={2};";
            if (list != null && list.Count > 0)
            {
                rpt_products.DataSource = list;
                rpt_products.DataBind();

            }
            RegisterScript(string.Format(pagingScript, pageSize, pageIndex, recordCount));
        }
예제 #16
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="serModel"></param>
        /// <returns></returns>
        public IList <Eyousoft_yhq.Model.Product> GetList(Eyousoft_yhq.Model.SerProduct serModel)
        {
            IList <Eyousoft_yhq.Model.Product> list = new List <Eyousoft_yhq.Model.Product>();

            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ProductID,ProductName,ProductType,TourDate,MarketPrice,AppPrice,FavourCode,LinkTel,ProductDis,TourDis,SendTourKnow,ValidiDate,IsEveryDay,IsHot,CreateDate,ServiceQQ, ContractType,ControlPeople,ResidueNum,ProductOpState,ProductSdate,ZCodeViaDate,PType,XianLu   ");
            strSql.AppendFormat("  from view_Product where  1=1 and ProductState=0  AND datediff(day,'{0}',ValidiDate)>=0 ", DateTime.Now);
            if (serModel != null)
            {
                if (serModel.PType > 0)
                {
                    strSql.AppendFormat(" and  PType = {0} ", serModel.PType);
                }
                if (!string.IsNullOrEmpty(serModel.PurductName))
                {
                    strSql.AppendFormat(" and  ProductName like '%{0}%' ", serModel.PurductName);
                }
                if (!string.IsNullOrEmpty(serModel.FavourCode))
                {
                    strSql.AppendFormat(" and  FavourCode = '{0}' ", serModel.FavourCode);
                }
            }
            strSql.Append("  order by IsHot DESC, CreateDate  DESC  ");
            DbCommand cmd = this._db.GetSqlStringCommand(strSql.ToString());



            using (IDataReader dr = DbHelper.ExecuteReader(cmd, this._db))
            {
                while (dr.Read())
                {
                    Eyousoft_yhq.Model.Product model = new Eyousoft_yhq.Model.Product();
                    model.ProductID    = dr.GetString(dr.GetOrdinal("ProductID"));;
                    model.ProductName  = dr.GetString(dr.GetOrdinal("ProductName"));
                    model.ProductType  = dr.GetInt32(dr.GetOrdinal("ProductType"));
                    model.TourDate     = dr.IsDBNull(dr.GetOrdinal("TourDate")) ? null : Utils.GetDateTimeNullable(dr.GetDateTime(dr.GetOrdinal("TourDate")).ToString());
                    model.MarketPrice  = dr.GetDecimal(dr.GetOrdinal("MarketPrice"));
                    model.AppPrice     = dr.GetDecimal(dr.GetOrdinal("AppPrice"));
                    model.FavourCode   = dr.GetString(dr.GetOrdinal("FavourCode"));
                    model.LinkTel      = dr.GetString(dr.GetOrdinal("LinkTel"));
                    model.ProductDis   = dr.GetString(dr.GetOrdinal("ProductDis"));
                    model.TourDis      = dr.GetString(dr.GetOrdinal("TourDis"));
                    model.SendTourKnow = dr.GetString(dr.GetOrdinal("SendTourKnow"));
                    model.ValidiDate   = dr.GetDateTime(dr.GetOrdinal("ValidiDate"));
                    //model.ProductState = dr.GetInt32(dr.GetOrdinal("ProductState"));
                    model.IsEveryDay    = dr.IsDBNull(dr.GetOrdinal("IsEveryDay")) ? false : GetBoolean(dr.GetString(dr.GetOrdinal("IsEveryDay")));
                    model.IsHot         = dr.IsDBNull(dr.GetOrdinal("IsHot")) ? 0 : dr.GetByte(dr.GetOrdinal("IsHot"));
                    model.CreateDate    = dr.GetDateTime(dr.GetOrdinal("CreateDate"));
                    model.ServiceQQ     = dr.IsDBNull(dr.GetOrdinal("ServiceQQ")) ? "" : dr.GetString(dr.GetOrdinal("ServiceQQ"));
                    model.ContractType  = (Eyousoft_yhq.Model.ContractType)dr.GetByte(dr.GetOrdinal("ContractType"));
                    model.ControlPeople = dr.GetInt32(dr.GetOrdinal("ControlPeople"));
                    model.ResidueNum    = dr.GetInt32(dr.GetOrdinal("ResidueNum"));
                    model.ProductSdate  = dr.IsDBNull(dr.GetOrdinal("ProductSdate")) ? DateTime.Now : dr.GetDateTime(dr.GetOrdinal("ProductSdate"));
                    model.ZCodeViaDate  = dr.IsDBNull(dr.GetOrdinal("ZCodeViaDate")) ? DateTime.Now : dr.GetDateTime(dr.GetOrdinal("ZCodeViaDate"));
                    model.xianlu        = (Eyousoft_yhq.Model.XianLu)dr.GetByte(dr.GetOrdinal("XianLu"));

                    list.Add(model);
                }
            }
            return(list);
        }
예제 #17
0
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product bll = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.PurductName = Utils.GetQueryStringValue("productName");
            if (Utils.GetInt(Utils.GetQueryStringValue("tuijian")) == 1) serchModel.isHot = 1;
            if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("xianlu"))) serchModel.xianlu = (Eyousoft_yhq.Model.XianLu)Utils.GetInt(Utils.GetQueryStringValue("xianlu"));

            if (Utils.GetQueryStringValue("proType") == "-2")
            {
                serchModel.PType = 2;
            }
            else if (Utils.GetQueryStringValue("proType") == "-3")
            {
                serchModel.PType = 3;
            }
            else
            {
                serchModel.PurductType = Utils.GetQueryStringValue("proType");
                serchModel.PType = 1;
            }
            serchModel.isVisable = false;
            serchModel.WeiDianId = WeiDianId;

            if (serchModel.isHot.HasValue && serchModel.isHot.Value == 1) serchModel.WeiDianId = string.Empty;

            var list = bll.GetList(pagesize, pageindex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
            }
            else
            {
                PlaceHolder1.Visible = false;
            }
        }
예제 #18
0
        protected void initList()
        {
            Eyousoft_yhq.BLL.Product bll = new Eyousoft_yhq.BLL.Product();
            Eyousoft_yhq.Model.SerProduct serchModel = new Eyousoft_yhq.Model.SerProduct();
            serchModel.PurductName = Utils.GetQueryStringValue("productName");

            if (Utils.GetQueryStringValue("proType") == "-2")
            {
                serchModel.PType = 2;
            }
            else if (Utils.GetQueryStringValue("proType") == "-3")
            {
                serchModel.PType = 3;
            }
            else
            {
                serchModel.PurductType = Utils.GetQueryStringValue("proType");
                serchModel.PType = 1;
            }
            serchModel.isVisable = false;
            var list = bll.GetList(pagesize, pageindex, ref recordCount, serchModel);

            if (list != null && list.Count > 0)
            {
                rpt_list.DataSource = list;
                rpt_list.DataBind();
            }
            else
            {
                PlaceHolder1.Visible = false;
            }
        }