<%@ WebHandler Language="C#" Class="Sax_count" %>

using System;
using System.Web;
using BLL;
using Model;
using System.Data;

/// <summary>
/// 比较 店铺规定商品数  实际商品数
/// </summary>
public class Sax_count : IHttpHandler {

    BLLCommodity_Type bll = new BLLCommodity_Type();
    BLLCommodity bllc = new BLLCommodity();
    ShopBLL blls = new ShopBLL();
    BLLTab bllt = new BLLTab();
    public void ProcessRequest (HttpContext context) {

        string str = "";
        int shopId = int.Parse(context.Request["shopId"].ToString());
        DataSet shopds = new DataSet();
        shopds = blls.SelById(shopId);
        int max = int.Parse(shopds.Tables[0].Rows[0]["smax"].ToString());
        int count = bllc.shopCountCommodity(shopId);
        //如果超过去 就提示 信息
        if (count >= max)
        {
            str = "<label id='lblMsg' runat='server' >您选择的店铺商品数已达到规定限度，不能再添加商品了</lable>";
        }
        context.Response.Write(str);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}