예제 #1
0
        public ActionResult DeleteStoreGroupsBatch(int type, string[] id, string[] storeid = null)
        {
            MiniappState s = MiniappState.待审核;

            if (type == -1)
            {
                s = MiniappState.除;
            }
            else if (type == 0)
            {
                s = MiniappState.待审核;
            }
            else if (type == 1)
            {
                s = MiniappState.通过;
            }
            else if (type == -2)
            {
                s = MiniappState.彻底删除;
            }

            if (GroupsBLL.SingleModel.StoreDiscount_DeleteBacth(s, id))
            {
                return(Json(new { Success = true, Msg = "成功" }));
            }
            else
            {
                return(Json(new { Success = false, Msg = "失败" }));
            }
        }
예제 #2
0
        /// <summary>
        /// 删除优惠拼团(批量)
        /// </summary>
        /// <param name="state"></param>
        /// <param name="id"></param>
        /// <param name="cityAreaCode"></param>
        /// <returns></returns>
        public bool StoreDiscount_DeleteBacth(MiniappState state, string[] id, int cityAreaCode = 0)
        {
            string sql    = $"update groups set State={(int)state} where Id in ({string.Join(",", id)})";
            int    result = SqlMySql.ExecuteNonQuery(connName, CommandType.Text, sql, null);

            if (cityAreaCode > 0)
            {
                RemoveCache(cityAreaCode);
            }
            return(result > 0);
        }
예제 #3
0
        /// <summary>
        /// 审核团购
        /// </summary>
        /// <param name="type"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult DeleteStoreGroup(int type, int id, int storeid = 0)
        {
            MiniappState s = MiniappState.待审核;

            if (type == -1)
            {
                s = MiniappState.除;

                //查询是否有正在团购的活动
                int groupsporcount = GroupSponsorBLL.SingleModel.GetCount($"GroupId in ({id}) and State=1");
                if (groupsporcount > 0)
                {
                    return(Json(new { Success = false, Msg = "删除失败,该商品还有未结束的团购活动" }));
                }
            }
            else if (type == 0)
            {
                s = MiniappState.待审核;
            }
            else if (type == 1)
            {
                s = MiniappState.通过;
            }
            else if (type == -2)
            {
                s = MiniappState.彻底删除;
            }

            Groups group = GroupsBLL.SingleModel.GetModel(id);

            if (group == null)
            {
                return(Json(new { Success = false, Msg = "删除失败,请刷新重试" }));
            }

            group.State = (int)s;
            if (GroupsBLL.SingleModel.Update(group, "state"))
            {
                return(Json(new { Success = true, Msg = "成功" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { Success = false, Msg = "失败" }, JsonRequestBehavior.AllowGet));
            }
        }