Exemplo n.º 1
0
        private static IStoreNOSQLStrategy _storenosql = BMAData.StoreNOSQL;//店铺非关系型数据库

        #region 辅助方法

        /// <summary>
        /// 从IDataReader创建StoreReviewInfo
        /// </summary>
        public static StoreReviewInfo BuildStoreReviewFromReader(IDataReader reader)
        {
            StoreReviewInfo storeReviewInfo = new StoreReviewInfo();

            storeReviewInfo.ReviewId = TypeHelper.ObjectToInt(reader["reviewid"]);
            storeReviewInfo.Oid = TypeHelper.ObjectToInt(reader["oid"]);
            storeReviewInfo.StoreId = TypeHelper.ObjectToInt(reader["storeid"]);
            storeReviewInfo.DescriptionStar = TypeHelper.ObjectToInt(reader["descriptionstar"]);
            storeReviewInfo.ServiceStar = TypeHelper.ObjectToInt(reader["servicestar"]);
            storeReviewInfo.ShipStar = TypeHelper.ObjectToInt(reader["shipstar"]);
            storeReviewInfo.Uid = TypeHelper.ObjectToInt(reader["uid"]);
            storeReviewInfo.ReviewTime = TypeHelper.ObjectToDateTime(reader["reviewtime"]);
            storeReviewInfo.IP = reader["ip"].ToString();

            return storeReviewInfo;
        }
Exemplo n.º 2
0
 /// <summary>
 /// 创建店铺评价
 /// </summary>
 /// <param name="storeReviewInfo">店铺评价信息</param>
 public static void CreateStoreReview(StoreReviewInfo storeReviewInfo)
 {
     BrnMall.Data.Stores.CreateStoreReview(storeReviewInfo);
 }
Exemplo n.º 3
0
        /// <summary>
        /// 评价店铺
        /// </summary>
        public ActionResult ReviewStore()
        {
            int oid = WebHelper.GetQueryInt("oid");//订单id
            int descriptionStar = WebHelper.GetFormInt("descriptionStar");//商品描述星星
            int serviceStar = WebHelper.GetFormInt("serviceStar");//商家服务星星
            int shipStar = WebHelper.GetFormInt("shipStar");//商家配送星星

            if (descriptionStar > 5 || descriptionStar < 0)
                return AjaxResult("wrongdescriptionstar", "请选择正确的商品描述星星");
            if (serviceStar > 5 || serviceStar < 0)
                return AjaxResult("wrongservicestar", "请选择正确的商家服务星星");
            if (shipStar > 5 || shipStar < 0)
                return AjaxResult("wrongshipstar", "请选择正确的商家配送星星");

            OrderInfo orderInfo = Orders.GetOrderByOid(oid);
            if (orderInfo == null || orderInfo.Uid != WorkContext.Uid)
                return AjaxResult("noexistorder", "订单不存在");
            if (orderInfo.OrderState != (int)OrderState.Completed)
                return AjaxResult("nocomplete", "订单还未完成,不能评价");

            StoreReviewInfo storeReviewInfo = Stores.GetStoreReviewByOid(oid);
            if (storeReviewInfo != null)
                return AjaxResult("reviewed", "店铺已经评价");

            storeReviewInfo = new StoreReviewInfo()
            {
                Oid = oid,
                StoreId = orderInfo.StoreId,
                DescriptionStar = descriptionStar,
                ServiceStar = serviceStar,
                ShipStar = shipStar,
                Uid = WorkContext.Uid,
                ReviewTime = DateTime.Now,
                IP = WorkContext.IP
            };
            Stores.CreateStoreReview(storeReviewInfo);

            if (Orders.IsReviewAllOrderProduct(Orders.GetOrderProductList(oid)))
                Orders.UpdateOrderIsReview(oid, 1);

            return AjaxResult("success", "店铺评价成功");
        }
Exemplo n.º 4
0
 /// <summary>
 /// 创建店铺评价
 /// </summary>
 /// <param name="storeReviewInfo">店铺评价信息</param>
 public static void CreateStoreReview(StoreReviewInfo storeReviewInfo)
 {
     BrnMall.Core.BMAData.RDBS.CreateStoreReview(storeReviewInfo);
 }
Exemplo n.º 5
0
        /// <summary>
        /// 创建店铺评价
        /// </summary>
        /// <param name="storeReviewInfo">店铺评价信息</param>
        public void CreateStoreReview(StoreReviewInfo storeReviewInfo)
        {
            DbParameter[] parms = {
	                                 GenerateInParam("@oid", SqlDbType.Int, 4, storeReviewInfo.Oid),
	                                 GenerateInParam("@storeid", SqlDbType.Int, 4, storeReviewInfo.StoreId),
	                                 GenerateInParam("@descriptionstar", SqlDbType.TinyInt, 1, storeReviewInfo.DescriptionStar),
	                                 GenerateInParam("@servicestar", SqlDbType.TinyInt, 1, storeReviewInfo.ServiceStar),
	                                 GenerateInParam("@shipstar", SqlDbType.TinyInt, 1, storeReviewInfo.ShipStar),
	                                 GenerateInParam("@uid", SqlDbType.Int, 4, storeReviewInfo.Uid),
	                                 GenerateInParam("@reviewtime", SqlDbType.DateTime, 8, storeReviewInfo.ReviewTime),
	                                 GenerateInParam("@ip", SqlDbType.VarChar, 15, storeReviewInfo.IP)
                                    };
            RDBSHelper.ExecuteNonQuery(CommandType.StoredProcedure,
                                       string.Format("{0}createstorereview", RDBSHelper.RDBSTablePre),
                                       parms);
        }