Exemplo n.º 1
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            var gift = new FavorableActivityGiftInfo();

            gift.Id          = RequestHelper.GetQueryString <int>("ID");
            gift.Name        = Name.Text;
            gift.Photo       = Photo.Text;
            gift.Description = Description.Text;
            string alertMessage = ShopLanguage.ReadLanguage("AddOK");

            if (gift.Id == int.MinValue)
            {
                CheckAdminPower("AddGift", PowerCheckType.Single);
                int id = FavorableActivityGiftBLL.Add(gift);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("Gift"), id);
            }
            else
            {
                CheckAdminPower("UpdateGift", PowerCheckType.Single);
                FavorableActivityGiftBLL.Update(gift);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("Gift"), gift.Id);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl);
        }
Exemplo n.º 2
0
        public void Update(FavorableActivityGiftInfo entity)
        {
            using (var conn = new SqlConnection(connectString))
            {
                string sql = @"UPDATE FavorableActivityGift SET Name = @Name, Photo = @Photo, Description = @Description
                            where Id=@Id";

                conn.Execute(sql, entity);
            }
        }
Exemplo n.º 3
0
        public int Add(FavorableActivityGiftInfo entity)
        {
            using (var conn = new SqlConnection(connectString))
            {
                string sql = @"INSERT INTO FavorableActivityGift( Name,Photo,Description) VALUES(@Name,@Photo,@Description);
                            select SCOPE_IDENTITY()";

                return(conn.Query <int>(sql, entity).Single());
            }
        }
Exemplo n.º 4
0
        protected bool isPL            = true;//是否已评论

        protected override void PageLoad()
        {
            base.PageLoad();
            //检查用户的待付款订单是否超时失效,超时则更新为失效状态
            OrderBLL.CheckOrderPayTime(base.UserId);
            int orderId = RequestHelper.GetQueryString <int>("id");

            userGradeName = UserGradeBLL.Read(base.GradeID).Name;


            order = OrderBLL.Read(orderId, base.UserId);


            if (order.Id <= 0)
            {
                ScriptHelper.AlertFront("订单不存在", "/user/index.html");
            }
            //礼品
            if (order.GiftId > 0)
            {
                gift = FavorableActivityGiftBLL.Read(order.GiftId);
            }
            orderDetailList = OrderDetailBLL.ReadList(orderId);
            int[] productIds = orderDetailList.Select(k => k.ProductId).ToArray();
            if (productIds.Length > 0)
            {
                int count = 0;
                productList = ProductBLL.SearchList(1, productIds.Length, new ProductSearchInfo {
                    InProductId = string.Join(",", productIds)
                }, ref count);
            }

            #region 判断是否已评论
            List <ProductCommentInfo>[] listPinfoArr = new List <ProductCommentInfo> [productList.Count];
            int pi = 0;
            foreach (ProductInfo item in productList)
            {
                ProductCommentSearchInfo psi = new ProductCommentSearchInfo();
                psi.ProductId    = item.Id;
                psi.UserId       = base.UserId;
                psi.OrderID      = orderId;
                listPinfoArr[pi] = ProductCommentBLL.SearchProductCommentList(psi);
                if (listPinfoArr[pi].Count <= 0)
                {
                    isPL = false;
                }
            }
            #endregion
            Title = "我的订单";
        }
 public static void Update(FavorableActivityGiftInfo entity)
 {
     dal.Update(entity);
 }
 public static int Add(FavorableActivityGiftInfo entity)
 {
     return(dal.Add(entity));
 }