/// <summary>
        /// 添加/编辑
        /// </summary>
        /// <returns></returns>
        public ActionResult AdertEdit()
        {
            //绑定广告位置
            BLL.AdertPositionBase apbll = new BLL.AdertPositionBase();
            List<Model.AdertPositionBase> listadert= apbll.GetModelList(" p_Delete=0 and p_Status=0 ");
            List<SelectListItem> seltype = new List<SelectListItem>();
            seltype = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "-1" } };
            for (int i = 0; i < listadert.Count; i++)
            {
                seltype.Add(new SelectListItem
                {
                    Value = listadert[i].p_ID.ToString(),
                    Text = listadert[i].p_PositionName
                });
            }
            ViewData["AdertPosition"] = new SelectList(seltype, "Value", "Text", "请选择");

            //绑定广告分类
            BLL.ProductTypeBase ptbll = new BLL.ProductTypeBase();
            List<Model.ProductTypeBase> modelType = ptbll.GetModelList(" pt_ParentId = 0  and pt_IsDel=0 and pt_StatusCode=0");

            List<SelectListItem> selectType = new List<SelectListItem>();
            selectType = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "-1" } };
            for (int i = 0; i < modelType.Count; i++)
            {
                selectType.Add(new SelectListItem
                {
                    Value = modelType[i].pt_ID.ToString(),
                    Text = modelType[i].pt_Name
                });
            }
            ViewData["AdertFenLeiPosition"] = new SelectList(selectType, "Value", "Text", "请选择");

            ViewData["otype"] = RequestBase.GetString("otype");
            if (RequestBase.GetString("a_ID") != null && RequestBase.GetString("a_ID") != "")
            {
                Model.Adert adert = new BLL.Adert().GetModel(int.Parse(RequestBase.GetString("a_ID")));
                ViewData["AdertPosition"] = new SelectList(seltype, "Value", "Text", adert.a_PID);

                if (adert.a_spare2 != null)
                {
                    ViewData["AdertFenLeiPosition"] = new SelectList(selectType, "Value", "Text", adert.a_spare2);
                }
                else {

                }

                ViewData["picurl"] = adert.a_Image;
                return View(adert);
            }
            else {
                return View();
            }
        }
        public ActionResult groupBuyDetails()
        {
            string gpid = Request.QueryString["gpid"] == null ? "" : Request.QueryString["gpid"].ToString();
            Model.vm_GBDetails model = new BLL.vm_GBDetails().GetModel(int.Parse(gpid));
            List<Model.ProductInfoBase> list = new BLL.ProductInfoBase().GetModelList(" pin_isdel=0 and pin_statuscode=0 and p_ID="+model.p_ID);
            List<Model.Adert> adlist = new BLL.Adert().GetModelList(string.Format(" a_PID=27 and a_Delete=0 and  a_spare2=(select pt_parentid from ProductTypeBase where pt_ID = (select pt_ParentId from ProductTypeBase where pt_ID={0})) ", model.pt_ID));
            var modellist = new ListModel();
            //System.Web.HttpContext.Current.Application.Lock();
            //System.Web.HttpContext.Current.Application["UserCount"] = Int32.Parse(System.Web.HttpContext.Current.Application["UserCount"].ToString()) + 1;
            //System.Web.HttpContext.Current.Application.UnLock();
            modellist.path = "<a href=\"/groupBuy/index\"><strong>团购列表</strong></a> > "+model.p_Name;
            modellist.pinfoList = list;
            modellist.gbmodel = model;
            modellist.adlist = adlist;

            List<Model.vw_PInfo> pinfo = new BLL.vw_PInfo().getguanzhu(" sku_ID in(select distinct sku_ID  from VipCollectionBase)", 1, 5);
            ViewBag.pinfo = pinfo.ToList();
            List<Model.vw_PInfo> pinfo2 = new BLL.vw_PInfo().getguanzhu(" sku_ID in(select distinct sku_ID  from VipCollectionBase)", 2, 5);
            ViewBag.pinfo2 = pinfo2.ToList();
            return View(modellist);
        }
        /// <summary>
        /// 获取广告
        /// </summary>
        /// <param name="viewName">view名称</param>
        /// <param name="ptID">分类ID</param>
        /// <param name="isBottom">是否底部</param>
        public void GetProductTypeAds(string viewName, int ptID, bool isBottom)
        {
            BLL.AdertPositionBase adp = new BLL.AdertPositionBase();
            string sql = string.Empty;
            if (isBottom)
            {
                sql = "p_Status = 0 and p_Delete = 0 and p_producttype = " + ptID + "and p_showposition = 1";
            }
            else
            {
                sql = "p_Status = 0 and p_Delete = 0 and p_producttype = " + ptID + "and p_showposition = 0";
            }

            var model = adp.GetModelList(sql).FirstOrDefault();
            if (model != null)
            {
                var list = new BLL.Adert().GetModelList(" a_Status = 0 and a_Delete = 0 and a_PID = " + model.p_ID);
                ViewData[viewName] = list;
            }
        }
 /// <summary>
 /// 获取首页轮播图
 /// </summary>
 private void adert()
 {
     ViewData["pc首页轮播图"] = new BLL.Adert().GetModelList(" a_Status = 0 and a_Delete = 0 and a_PID =37 ");
 }