private bool IsShopAdmin(int id) { BLL.wx_diancai_admin dBll = new BLL.wx_diancai_admin(); Model.wx_diancai_admin shopAdmin = dBll.GetModel(id); //餐饮 商铺管理员 if (shopAdmin != null) { //Session[MXKeys.WEIXIN_DIANCAI_SHOPID] = shopAdmin.ShopId; //Utils.WriteCookie(MXKeys.WEIXIN_DIANCAI_SHOPID, "WeiXinPF", shopAdmin.ShopId.ToString()); return(true); } BLL.wx_diancai_shop_user suBll = new BLL.wx_diancai_shop_user(); Model.wx_diancai_shop_user shopUser = suBll.GetModel(id); if (shopUser != null) { //Session[MXKeys.WEIXIN_DIANCAI_SHOPID] = shopUser.ShopId; //Utils.WriteCookie(MXKeys.WEIXIN_DIANCAI_SHOPID, "WeiXinPF", shopUser.ShopId.ToString()); return(true); } return(false); }
public int GetShopId() { if (IsAdminLogin()) { Model.manager admin = GetAdminInfo(); BLL.wx_diancai_admin shopAdminBll = new BLL.wx_diancai_admin(); Model.wx_diancai_admin shopAdmin = shopAdminBll.GetModel(admin.id); if (shopAdmin != null) { return(shopAdmin.ShopId); } BLL.wx_diancai_shop_user suBll = new BLL.wx_diancai_shop_user(); Model.wx_diancai_shop_user shopUser = suBll.GetModel(admin.id); if (shopUser != null) { return(shopUser.ShopId); } return(0); } return(0); }