Beispiel #1
0
        protected void CancelComapny()
        {
            if (!IsCompanyCheck)
            {
                Utils.ResponseMeg(false, "对不起,你尚未审核通过!");
                return;
            }
            string companyId = Utils.GetQueryStringValue("companyid");

            if (companyId != "")
            {
                favorBll = EyouSoft.BLL.CompanyStructure.CompanyFavor.CreateInstance();
                if (favorBll.Delete(SiteUserInfo.CompanyID, companyId))
                {
                    Utils.ResponseMeg(true, "取消成功!");
                }
                else
                {
                    Utils.ResponseMegError();
                }
            }
            //获取收藏的公司数
            setCompanyNum = favorBll.GetAllFavorCount(SiteUserInfo.CompanyID);
        }
Beispiel #2
0
        /// <summary>
        /// 设置/取消收藏
        /// </summary>
        private void SetFavors()
        {
            int response = 0;
            int type     = Utils.GetInt(Request.QueryString["SetType"]);

            EyouSoft.Model.CompanyStructure.CompanyFavor favorInfo = new EyouSoft.Model.CompanyStructure.CompanyFavor
            {
                AreaId         = 0,
                CompanyId      = SiteUserInfo.CompanyID,
                FavorCompanyId = Request.QueryString["FavorCompanyId"]
            };

            if (string.IsNullOrEmpty(favorInfo.FavorCompanyId))
            {
                response = 2;
            }

            EyouSoft.IBLL.CompanyStructure.ICompanyFavor bll = EyouSoft.BLL.CompanyStructure.CompanyFavor.CreateInstance();

            if (type == 1)
            {
                response = bll.SaveCompanyFavor(favorInfo) ? 1 : 0;
            }
            else if (type == 0)
            {
                response = bll.Delete(favorInfo.CompanyId, favorInfo.FavorCompanyId) ? 1 : 0;
            }
            else
            {
                response = 3;
            }

            Response.Clear();
            Response.Write(response);
            Response.End();
        }