Exemplo n.º 1
0
        /// <summary>
        /// 分页得到搜索页运营位全部列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public IEnumerable <SWfsAppOperatingPosition> GetAppOperatingPositionList(int pageIndex, int pageSize, out int count)
        {
            IEnumerable <SWfsAppOperatingPosition> list = DapperUtil.Query <SWfsAppOperatingPosition>("ComBeziWfs_SWfsAppOperatingPosition_GetList", new { pageIndex = pageIndex, pageSize = pageSize });

            count = DapperUtil.Query <int>("ComBeziWfs_SWfsAppOperatingPosition_GetCount").First <int>();
            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 生成微码
        /// </summary>
        /// <param name="passport"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public ActionResult CreateVCode(SWfsVActivityCodesRef obj)
        {
            //ServiceResult result = new ServiceResult();
            string activityId = Request.Form["ActivityId"];
            int    count      = int.Parse(Request.Form["CreateCount"]);
            //V码类型,1:独享 2:共享
            short vcodeType = short.Parse(Request.Form["VCodeType"]);

            var dapp = DapperUtil.Query <SWfsVActivity>("ComBeziWfs_SWfsVActivity_ID", new { ActivityId = activityId });

            string code = string.Empty;

            for (int i = 0; i < count; i++)
            {
                code = dapp.FirstOrDefault().ActivityCode + GetRandomCodeII(6);
                //obj.ActivityCodesId = int.Parse(Request.QueryString["ActivityCodesId"]);
                obj.ActivityId = activityId;
                obj.VCode      = code;
                obj.VCodeType  = vcodeType;
                obj.Source     = "系统生成";
                obj.DateCreate = DateTime.Now;
                obj.OperatorId = PresentationHelper.GetPassport().UserName;
                Vcode.CreateCrode(obj);
            }
            return(Redirect("VCodeManagement.html?activityId=" + activityId));
        }
Exemplo n.º 3
0
        public void BetchInsertComment(string sql)
        {
            var dic = new Dictionary <string, object>();

            dic.Add("SQL", sql);
            var abc = DapperUtil.Query <int>("ComBeziWfs_SWfsProductComment_BetchInsertComment", dic);
        }
Exemplo n.º 4
0
        ///// <summary>
        ///// 测试
        ///// </summary>
        ///// <param name="productNos"></param>
        ///// <returns></returns>
        //public string GetInventoryProductNosByProductNos(string productNos)
        //{
        //    string newProductNos = string.Empty;
        //     newProductNos = "13237769,12237374,12237350 ";
        //    StockWebService.StockWebService stock = new StockWebService.StockWebService();
        //    stock.Url = AppSettingManager.AppSettings["ErpInventoryService"];
        //    string aa = stock.GetInventorySumByProductNos(newProductNos);


        //    return newProductNos;
        //}



        /// <summary>
        /// 根据商品编号获得其所在活动
        /// </summary>
        /// <param name="productNo"></param>
        /// <returns></returns>
        public IList <SWfsNewSubjectCategory> GetSubjectCategoryByProductNo(string productNo, string status)
        {
            var dic = new Dictionary <string, object>();

            dic.Add("Status", status == null ? "" : status);
            return(DapperUtil.Query <SWfsNewSubjectCategory>("ComBeziWfs_SWfsNewSubjectCategory_SelectSubjectCategoryListByProductNo", dic, new { ProductNo = productNo }).ToList());
        }
Exemplo n.º 5
0
        //添加商品
        public int AddShelfProduct(string productNoStr, string UserID, string NewArrivalId, string IsOneRow)
        {
            productNoStr = productNoStr.TrimEnd(',');
            string[]      ProductNoList = productNoStr.Split(',');
            StringBuilder str           = new StringBuilder();
            //找出当前品牌的当前上架时间排序最大值的商品
            int MaxSort = MaxSortProduct(NewArrivalId, IsOneRow);
            int count   = MaxSort;

            foreach (string item in ProductNoList)
            {
                count++;
                str.Append("insert into SwfsFlagShipNewArrivalProductList values(" + NewArrivalId + ",'" + item + "','',''," + IsOneRow + "," + count + ",'" + System.DateTime.Now + "',1,1,'" + UserID + "','" + UserID + "','" + System.DateTime.Now + "');");
            }
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("sqlstring", str);
            try
            {
                return(DapperUtil.Query <int>("ComBeziWfs_SwfsFlagShipNewArrivalProductList_InsertsProduct", dic).FirstOrDefault());
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 6
0
        public ProductInfoNew SelectSpfSkuPrice(ProductInfoNew Product, string ProductNo)//商品价格的信息
        {
            //取最小价格
            List <ProductInfoNew> Mininfo = DapperUtil.Query <ProductInfoNew>("ComBeziWfs_SwfsFlagShipNewArrivalProductList_SpfSkuPriceAll", new { ProductNo = ProductNo }).ToList();

            if (Mininfo != null && Mininfo.Count() != 0)
            {
                Product.MinSellPrice      = Mininfo.Min(p => p.SellPrice);      //最小黄金价
                Product.MinPlatinumPrice  = Mininfo.Min(p => p.PlatinumPrice);  //最小白金价
                Product.MinDiamondPrice   = Mininfo.Min(p => p.DiamondPrice);   //最小钻石价
                Product.MinLimitedPrice   = Mininfo.Min(p => p.LimitedPrice);   //最小尚品价格
                Product.MinMarketPrice    = Mininfo.Min(p => p.MarketPrice);    //最小钻石价
                Product.MinPromotionPrice = Mininfo.Min(p => p.PromotionPrice); //最小尚品价格

                Product.MaxSellPrice      = Mininfo.Max(p => p.SellPrice);      //最大黄金价
                Product.MaxPlatinumPrice  = Mininfo.Max(p => p.PlatinumPrice);  //最大白金价
                Product.MaxDiamondPrice   = Mininfo.Max(p => p.DiamondPrice);   //最大钻石价
                Product.MaxLimitedPrice   = Mininfo.Max(p => p.LimitedPrice);   //最大尚品价格
                Product.MaxMarketPrice    = Mininfo.Max(p => p.MarketPrice);    //最大钻石价
                Product.MaxPromotionPrice = Mininfo.Max(p => p.PromotionPrice); //最大尚品价格
            }



            return(Product);
        }
        /// <summary>
        /// 秒杀位置图
        /// </summary>
        /// <param name="gender"></param>
        /// <returns></returns>
        public SWfsHomeSecKill GetSWfsHomeSecKillSingle(int gender)
        {
            string channelNo = gender == 1 ? "A02" : "A01";

            return(DapperUtil.Query <SWfsHomeSecKill>("ComBeziWfs_SWfsHomeSecKill_GetSWfsHomeSecKillByChannelNO",
                                                      new { ChannelNo = channelNo }).FirstOrDefault());
        }
Exemplo n.º 8
0
 //按模板编号查询模板
 public SWfsProductTemplate GetSProductTemplateObjByNo(string tempNO)
 {
     return(DapperUtil.Query <SWfsProductTemplate>("ComBeziWfs_SWfsProductTemplate_GetProductTemplateByTempNO", new
     {
         TemplateNO = tempNO
     }).FirstOrDefault());
 }
Exemplo n.º 9
0
 //获取商品的title
 public string GetProductTitle(string productNo)
 {
     return(DapperUtil.Query <string>("ComBeziWfs_SWfsProductRef_GetProductTitle", new
     {
         ProductNO = productNo
     }).FirstOrDefault());
 }
Exemplo n.º 10
0
 //按产品编号查询商品编辑块内容
 public SWfsProductRef GetProductRefByProductNO(string pNO)
 {
     return(DapperUtil.Query <SWfsProductRef>("ComBeziWfs_SWfsProductRef_GetSWfsProductRefHtmlCodeByProductNo", new
     {
         ProductNO = pNO
     }).FirstOrDefault());
 }
Exemplo n.º 11
0
 //按ID查询模板
 public SWfsProductTemplate GetTemplateObj(int id)
 {
     return(DapperUtil.Query <SWfsProductTemplate>("ComBeziWfs_SWfsProductTemplate_GetProductTemplateById", new
     {
         TemplateID = id
     }).FirstOrDefault());
 }
Exemplo n.º 12
0
        public string GetSate(string ip)
        {
            #region 数据库状态测试状态

            string sql1 = "ComBeziWfs_TestDB_LiveTesting";
            string sql2 = "ComBeziWfsSub_TestDB_LiveTesting";
            string sql3 = "ComBeziCommon_TestDB_LiveTesting";
            string sql5 = "ComBeziPic_TestDB_LiveTesting";
            //string sql6 = "ComShangPinMarketingAnalytics_TestDB_LiveTesting";
            //string sql7 = "ShangPinDWPlatform_TestDB_LiveTesting";

            var lst1 = DapperUtil.Query <int>(sql1).FirstOrDefault();
            var lst2 = DapperUtil.Query <int>(sql2).FirstOrDefault();
            var lst3 = DapperUtil.Query <int>(sql3).FirstOrDefault();

            var lst5 = DapperUtil.Query <int>(sql5).FirstOrDefault();
            //var lst6 = DapperUtil.Query<int>(sql6).FirstOrDefault();
            //var lst7 = DapperUtil.Query<int>(sql7).FirstOrDefault();

            #endregion

            #region 应用级缓存测试状态
            //cacheKey=IP地址+PID(进程号)
            string cacheKey = string.Format("{0}{1}", ip, System.Diagnostics.Process.GetCurrentProcess().Id);

            //cacheKey = HttpContext.Current.Request.ServerVariables["Remote_Addr"].ToString();

            #region Memcached

            var value = EnyimMemcachedClient.Instance.Get <string>(cacheKey);//获取缓存

            if (string.IsNullOrEmpty(value))
            {
                #region 设置缓存值
                value = "1";
                #endregion

                //缓存数据
                EnyimMemcachedClient.Instance.Set(cacheKey, value, TimeSpan.FromDays(1));
            }

            #endregion

            #region RedisCache

            value = RedisCacheProvider.Instance.Get <string>(cacheKey);
            if (string.IsNullOrEmpty(value))
            {
                #region 设置缓存值
                value = "1";
                #endregion
                RedisCacheProvider.Instance.Set(cacheKey, value, TimeSpan.FromDays(1));
            }

            #endregion

            #endregion

            return("OK!");
        }
Exemplo n.º 13
0
 public SWfsNewSubject GetSubjectByNo(string subjectNo)
 {
     return(DapperUtil.Query <SWfsNewSubject>("ComBeziWfs_SWfsAppAlterPic_GetAppSubjectByNo", new
     {
         SubjectNo = subjectNo
     }).FirstOrDefault());
 }
Exemplo n.º 14
0
        public IEnumerable <SWfsAppAlterPic> AlterLists(int pageIndex, int pageSize, Dictionary <string, object> dic, out int count)
        {
            IEnumerable <SWfsAppAlterPic> list = DapperUtil.Query <SWfsAppAlterPic>("ComBeziWfs_SWfsAppAlterPic_GetSWfsAppAlterPicList", dic, new { AlterType = dic["AlterType"], Name = dic["Name"] + "", RefType = dic["RefType"], Sort = dic["Sort"], beginTime = dic["beginTime"] + "", endTime = dic["endTime"] + "", pageIndex = pageIndex, pageSize = pageSize }).ToList();

            count = DapperUtil.Query <int>("ComBeziWfs_SWfsAppAlterPic_GetSWfsAppAlterPicCount", dic, new { AlterType = dic["AlterType"], Name = dic["Name"] + "", RefType = dic["RefType"], Sort = dic["Sort"], beginTime = dic["beginTime"] + "", endTime = dic["endTime"] + "", pageIndex = pageIndex, pageSize = pageSize }).First <int>();
            return(list);
        }
Exemplo n.º 15
0
        /// <summary>
        /// 查找当前品牌下所有15天内上新的商品
        /// </summary>
        /// <param name="brandNo"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public List <ProductInfoNew> BrandNewShelfProductList(string brandNo, int pageIndex, int pageSize, DateTime DateShelf, string keyword, string categoryNo, string gender, string startDate, string endDate, out int count)
        {
            var    dic          = new Dictionary <string, object>();
            string dayStartDate = DateShelf.ToString("yyyy-MM-dd");                                                       //当天开始时间
            string dayEndtDate  = DateTime.Parse(dayStartDate).AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss"); //当结束时间

            startDate = startDate == null || startDate == "" || Convert.ToDateTime(startDate) < DateShelf.AddDays(-15) ? DateShelf.AddDays(-15).ToString() : startDate;
            endDate   = endDate == null || endDate == "" || Convert.ToDateTime(endDate) > DateShelf?DateShelf.ToString() : endDate;

            //startDate = startDate == null || startDate == "" || Convert.ToDateTime(startDate) < System.DateTime.Now.AddDays(-15) ? System.DateTime.Now.AddDays(-15).ToString() : startDate;
            //endDate = endDate == null || endDate == "" || Convert.ToDateTime(endDate) > System.DateTime.Now ? System.DateTime.Now.ToString() : endDate;
            //string startDate = DateShelf.AddDays(-15).ToString("yyyy-MM-dd");//15天前的时间
            //DateTime endDate = DateShelf;//当前时间
            dic.Add("Keyword", keyword == null ? "" : keyword);
            dic.Add("Gender", gender == null ? "" : gender);
            dic.Add("CategoryNo", categoryNo == null ? "" : categoryNo);
            count = DapperUtil.Query <int>("ComBeziWfs_WfsProduct_BrandTop15DayNewShelfProductCount", dic, new { BrandNo = brandNo, startDate = startDate, endDate = endDate, dayStartDate = dayStartDate, dayEndtDate = dayEndtDate, KeyWord = keyword, Gender = gender, CategoryNo = categoryNo }).FirstOrDefault();
            List <ProductInfoNew> list = new List <ProductInfoNew>();

            list = DapperUtil.Query <ProductInfoNew>("ComBeziWfs_WfsProduct_BrandTop15DayNewShelfProduct", dic, new { BrandNo = brandNo, startDate = startDate, endDate = endDate, pageIndex = pageIndex, pageSize = pageSize, dayStartDate = dayStartDate, dayEndtDate = dayEndtDate, KeyWord = keyword, Gender = gender, CategoryNo = categoryNo }).ToList();
            for (int i = 0; i < list.Count(); i++)//循环去取商品价格的信息
            {
                list[i] = SelectSpfSkuPrice(list[i], list[i].ProductNo);
            }
            return(list);
        }
Exemplo n.º 16
0
 //按ID获取结构
 public SWfsProductRefTemplate GetStructById(int structId)
 {
     return(DapperUtil.Query <SWfsProductRefTemplate>("ComBeziWfs_SWfsProductRef_ParentStructById", new
     {
         ProductRefTemplateID = structId
     }).FirstOrDefault());
 }
Exemplo n.º 17
0
        //根据上新商品管理表中的id删除操作
        public int DeleteNewProductList(string idStr, string brandNo, DateTime DateShelf, int IsCount10)
        {
            StringBuilder str = new StringBuilder();

            str.Append("Delete from SWfsNewProductManage where Id in(");
            str.Append("" + idStr + ");");
            if (IsCount10 == 0)//等于0代表数据已经不足十条
            {
                str.Append("Delete from SWfsNewBrandProductManage where DateShelf='" + DateShelf + "' and brandNo='" + brandNo + "';");
            }
            //string startDate = DateShelf.ToString("yyyy-MM-dd");//当天开始时间
            //string EndtDate = DateTime.Parse(startDate).AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss"); //当结束时间
            //修改SWfsNewProductManage的BrandAmout数量
            //str.Append("update SWfsNewProductManage set BrandAmout=(select  count(*) from SWfsNewProductManage where brandNo='" + brandNo + "' and DateShelf between '" + startDate + "'  and '" + EndtDate + "')");
            //str.Append(" where brandNo='" + brandNo + "' and DateShelf between '" + startDate + "'  and '" + EndtDate + "'");
            //修改SWfsNewBrandProductManage的BrandAmout数量
            //str.Append("update SWfsNewBrandProductManage set NewShelfAmount=(select  count(*) from SWfsNewProductManage where brandNo='" + brandNo + "' and DateShelf between '" + startDate + "'  and '" + EndtDate + "')");
            //str.Append(" where brandNo='" + brandNo + "' and DateShelf between '" + startDate + "'  and '" + EndtDate + "'");
            string sql = str.ToString();
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("sqlstring", sql);
            try
            {
                return(DapperUtil.Query <int>("ComBeziWfs_SWfsNewProductManage_Deletes", dic).FirstOrDefault());
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 18
0
 //按模板编号获取模板代码
 public string GetTemplateCodeByTempNO(string tempNO)
 {
     return(DapperUtil.Query <string>("ComBeziWfs_SWfsProductTemplate_GetProductTemplateCodeByTempNO", new
     {
         TemplateNO = tempNO
     }).FirstOrDefault());
 }
        /// <summary>
        /// 底部运营位置图片
        /// </summary>
        /// <param name="gender"></param>
        /// <returns></returns>
        public IList <SWfsPictureManager> GetButtonPagePositionNew(int gender)
        {
            var q = DapperUtil.Query <SWfsPictureManager>("ComBeziWfs_SWfsPictureManager_GetSWfsPictureManagerByGenderBottonNew",
                                                          new { gender = gender }).ToList();

            return(q);
        }
Exemplo n.º 20
0
 //验证是否存在重复模板编号
 private int IsExistsTemplateNO(string tempNO)
 {
     return(DapperUtil.Query <int>("ComBeziWfs_SWfsProductTemplate_IsExistProductTemplateByTempNO", new
     {
         TemplateNO = tempNO
     }).FirstOrDefault());
 }
        /// <summary>
        /// 获取首页推荐品牌
        /// </summary>
        /// <param name="gender"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public IEnumerable <ChannelRecommendBrandExtends> GetHomeRecommendBrand(string channelNo, string brandNoAndBrandName, string startTime, string endTime, int pageIndex, int pageSize, out int total)
        {
            var dic = new Dictionary <string, object>();

            dic.Add("channelNo", channelNo);
            dic.Add("startTime", string.IsNullOrEmpty(startTime) ? "" : startTime);
            dic.Add("endTime", string.IsNullOrEmpty(endTime) ? "" : endTime);
            dic.Add("brandNoAndBrandName", string.IsNullOrEmpty(brandNoAndBrandName) ? "" : brandNoAndBrandName);
            total = DapperUtil.Query <int>("ComBeziWfs_SWfsSpChannelRecommendBrand_GetHomeRecommendByChannelNoTotalCount", dic, new
            {
                channelNo           = channelNo,
                startTime           = startTime,
                endTime             = string.IsNullOrEmpty(endTime) ? endTime : DateTime.Parse(endTime).AddDays(1).ToString(),
                brandNoAndBrandName = brandNoAndBrandName,
                pageIndex           = pageIndex,
                pageSize            = pageSize
            }).FirstOrDefault();
            return(DapperUtil.Query <ChannelRecommendBrandExtends>("ComBeziWfs_SWfsSpChannelRecommendBrand_GetHomeRecommendByChannelNo", dic, new
            {
                channelNo = channelNo,
                startTime = startTime,
                endTime = string.IsNullOrEmpty(endTime) ? endTime : DateTime.Parse(endTime).AddDays(1).ToString(),
                brandNoAndBrandName = brandNoAndBrandName,
                pageIndex = pageIndex,
                pageSize = pageSize
            }));
        }
Exemplo n.º 22
0
 //验证结构是否存在按名称查询
 public int IsExistsStructName(string structName)
 {
     return(DapperUtil.Query <int>("ComBeziWfs_SWfsProductRefTemplate_IsExistsStructName", new
     {
         ModuleName = structName
     }).FirstOrDefault());
 }
Exemplo n.º 23
0
        public ActionResult VSinsList(int pageIndex = 1, int pageSize = 10)
        {
            VsinsService vsins = new VsinsService();
            Dictionary <string, object> dicStr = new Dictionary <string, object>();
            string productNo = Rq.GetStringForm("productNo");
            string time      = Rq.GetStringForm("datetime");

            if (!string.IsNullOrEmpty(productNo))
            {
                dicStr.Add("ProductNo", productNo);
            }
            else
            {
                dicStr.Add("ProductNo", "");
            }

            if (!string.IsNullOrEmpty(time))
            {
                dicStr.Add("SelectTime", time);
            }
            else
            {
                dicStr.Add("SelectTime", "");
            }
            List <VsinsHotProduct> list = vsins.SelectHotProducts(dicStr, pageIndex, pageSize).ToList();
            int count = DapperUtil.Query <int>("ComBeziWfs_SWfsHotProduct_SelectAllcount", dicStr, new{ ProductNo = dicStr["ProductNo"].ToString(), SelectTime = dicStr["SelectTime"].ToString() }).FirstOrDefault();

            ViewBag.PageIndex  = pageIndex;
            ViewBag.totalcount = count;
            ViewBag.ProductNo  = productNo;
            ViewBag.Time       = time;
            return(View(list));
        }
Exemplo n.º 24
0
 //验证模板名称是否重复
 private IEnumerable <int> IsExistsTemplateName(string tName)
 {
     return(DapperUtil.Query <int>("ComBeziWfs_SWfsProductTemplate_IsExistProductTemplateByTempName", new
     {
         TemplateName = tName
     }));
 }
Exemplo n.º 25
0
 /// <summary>
 /// 操作最新上架
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int OperationNewShelf(SwfsFlagShipNewArrival model, int NewArrivalId, string UserId)
 {
     //判断ID如果为空,那就是添加
     if (NewArrivalId == 0)
     {
         model.OperateUserId    = UserId;
         model.NewArrivalTitle  = "新品上架";
         model.PageNo           = "index";
         model.PagePositionNo   = "top";
         model.PagePositionName = "新品上架";
         model.CreateDate       = System.DateTime.Now;
         model.SortValue        = 0;
         model.Status           = 1;
         model.DataState        = 1;
         model.UpdateDate       = System.DateTime.Now;
         return(DapperUtil.Insert <SwfsFlagShipNewArrival>(model));
     }
     else//否则就是修改
     {
         model.UpdateDate   = System.DateTime.Now;
         model.NewArrivalId = NewArrivalId;
         string str = "update SwfsFlagShipNewArrival set NewShelfDate='" + model.NewShelfDate + "',UpdateOperateUserId='" + model.UpdateOperateUserId + "',UpdateDate='" + model.UpdateDate + "' where NewArrivalId=" + model.NewArrivalId;
         Dictionary <string, object> dic = new Dictionary <string, object>();
         dic.Add("sqlstring", str);
         return(DapperUtil.Query <int>("ComBeziWfs_SwfsFlagShipNewArrivalProductList_InsertsProduct", dic).FirstOrDefault());
     }
 }
Exemplo n.º 26
0
        public static IEnumerable <Room> GetRooms(String accountName)
        {
            var rooms = DapperUtil.Query <Room>(@"
				SELECT
					RoomId
					,Author
					,Title
					,Description
					,Tags
					,IdVisible
					,AnonymousOnly
					,StartTime
					,ListenerCount
				FROM
					Room
				WHERE
					Author = @Author
				ORDER BY
					StartTime DESC
				;
			"            , new {
                Author = accountName,
            });

            return(rooms);
        }
Exemplo n.º 27
0
        //获评论列表
        public IEnumerable <SWfsProductCommentExtends> GetSWfsProductCommentList(string status, string brandNO, string categoryNo, string keyword, string starLevel, string commentKeyWord, string userName, string startTime, string endTime, string orderNo, string isResult, int pageIndex, int pageSize, out int total)
        {
            var dic = new Dictionary <string, object>();

            dic.Add("Keyword", keyword == null ? "" : keyword);
            dic.Add("Status", status == null ? "" : status);
            dic.Add("CategoryNo", categoryNo == null ? "" : categoryNo);
            dic.Add("BrandNO", brandNO == null ? "" : brandNO);
            dic.Add("StarLevel", starLevel == null ? "" : starLevel);
            dic.Add("CommentKeyWord", commentKeyWord == null ? "" : commentKeyWord);
            dic.Add("UserName", userName == null ? "" : userName);
            dic.Add("StartTime", startTime == null ? "" : startTime);
            dic.Add("EndTime", endTime == null ? "" : endTime);
            dic.Add("OrderNo", orderNo == null ? "" : orderNo);
            dic.Add("IsResult", isResult == null ? "" : isResult);
            total = DapperUtil.Query <int>("ComBeziWfs_SWfsProductComment_SelectSWfsProductCommentCount", dic, new { Status = status, KeyWord = keyword, BrandNO = brandNO, StarLevel = starLevel, CategoryNo = categoryNo, CommentKeyWord = commentKeyWord, UserName = userName, StartTime = startTime, EndTime = endTime, OrderNo = orderNo, IsResult = isResult }).FirstOrDefault();
            var commentList = DapperUtil.Query <SWfsProductCommentExtends>("ComBeziWfs_SWfsProductComment_SelectSWfsProductCommentList", dic, new { Status = status, KeyWord = keyword, BrandNO = brandNO, StarLevel = starLevel, CategoryNo = categoryNo, CommentKeyWord = commentKeyWord, UserName = userName, StartTime = startTime, EndTime = endTime, OrderNo = orderNo, IsResult = isResult, pageIndex = pageIndex, pageSize = pageSize }).ToList();

            foreach (var item in commentList)
            {
                if (string.IsNullOrEmpty(item.NickName))
                {
                    if (string.IsNullOrEmpty(item.UserName))
                    {
                        item.NickName = item.MailAddress;
                    }
                    else
                    {
                        item.NickName = item.UserName;
                    }
                }
                if (string.IsNullOrEmpty(item.LevelName))
                {
                    switch (item.UserLevel)
                    {
                    case "0000":
                        item.LevelName = "注册用户";
                        break;

                    case "0001":
                        item.LevelName = "正式会员";
                        break;

                    case "0002":
                        item.LevelName = "黄金会员";
                        break;

                    case "0003":
                        item.LevelName = "白金会员";
                        break;

                    case "0004":
                        item.LevelName = "钻石会员";
                        break;
                    }
                }
                item.CommentPictures = GetProductCommentPicRef(item.CommentId);
            }
            return(commentList);
        }
Exemplo n.º 28
0
        /// <summary>
        /// 找出已经生成好的某天的某个品牌的上架商品总数
        /// </summary>
        /// <param name="brandNo"></param>
        /// <param name="dateShelf"></param>
        /// <returns></returns>
        public int NewProductListCount(string brandNo, DateTime dateShelf)
        {
            string startDate = dateShelf.ToString("yyyy-MM-dd");
            string endDate   = DateTime.Parse(startDate).AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");

            return(DapperUtil.Query <int>("ComBeziWfs_SWfsNewProductManage_NewProductListCount", new { BrandNo = brandNo, startDate = startDate, endDate = endDate }).FirstOrDefault());
        }
Exemplo n.º 29
0
        public IEnumerable <SwfsFlagShipFlash> AlterLists(int pageIndex, int pageSize, Dictionary <string, object> dic, out int count)
        {
            IEnumerable <SwfsFlagShipFlash> list = DapperUtil.Query <SwfsFlagShipFlash>("ComBeziWfs_SwfsFlagShipFlash_GetList", dic, new
            {
                BrandNo      = dic["BrandNo"],
                PictureName  = dic["PictureName"],
                State        = dic["State"],
                PictureIndex = dic["PictureIndex"],
                beginTime    = dic["beginTime"] + "",
                endTime      = dic["endTime"] + "",
                pageIndex    = pageIndex,
                pageSize     = pageSize
            }).ToList();

            count = DapperUtil.Query <int>("ComBeziWfs_SwfsFlagShipFlash_GetList_count", dic, new
            {
                BrandNo      = dic["BrandNo"],
                PictureName  = dic["PictureName"],
                State        = dic["State"],
                PictureIndex = dic["PictureIndex"],
                beginTime    = dic["beginTime"] + "",
                endTime      = dic["endTime"] + ""
            }).First <int>();
            return(list);
        }
Exemplo n.º 30
0
        /// <summary>
        /// 根据商品编号所得其所在专题
        /// </summary>
        /// <param name="productNo"></param>
        /// <returns></returns>
        public Dictionary <string, IList <SWfsTopicProductRef> > GetTopicProductByProductNoList(Array productNolist)
        {
            var dic  = new Dictionary <string, IList <SWfsTopicProductRef> >();
            var list = DapperUtil.Query <SWfsTopicProductRef>("ComBeziWfs_SWfsTopicProductRef_SelectTopic", new { ProductNoList = productNolist }).ToList();

            return(dic);
        }