Exemplo n.º 1
0
Arquivo: buy.cs Projeto: ZhaiQuan/Zhai
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            seo.Robots = true;

            if (!pageinfo.IsPost)
            {
                //���ɵĶ���ֵ�����ڿ���ɾ��
                es = offerinfo;
                ed = machininginfo;
                ibi = investmentinfo;
                esi = serviceinfo;

                string infoFlag = XYECOM.Core.XYRequest.GetQueryString("flag");
                int lngInfoId = XYECOM.Core.MyConvert.GetInt32(XYECOM.Core.XYRequest.GetQueryString("infoid"));

                if (lngInfoId <= 0 || infoFlag == "")
                {
                    ShowErrorMsg("��Ϣ�����ڻ��ѱ�ɾ����");
                    return;
                }

                XYECOM.Configuration.SEOInfo seoInfo = null;

                module = moduleConfig.GetItem(infoFlag);

                //����������
                string descTableName = "";

                //����������࣬��Ҫ����SEO
                string allClassName = "";

                //��Ϣ����Id
                long sortId =0;

                //����Ϣ
                if (module.EName.Equals("offer") || module.PEName.Equals("offer"))
                {
                    pageinfo.ModuleFlag = "offer";
                    linkmodule = "buyoffer";
                    descTableName = "i_Supply";

                    offerinfo = new XYECOM.Business.Supply().GetItem(lngInfoId);

                    if (offerinfo == null || offerinfo.AuditingState != XYECOM.Model.AuditingState.Passed)
                    {
                        ShowErrorMsg("��Ϣ�����ڻ�δͨ����ˣ�");
                        return;
                    }

                    //���˹ؼ���
                    FilterKeyWord(offerinfo);

                    sortId = offerinfo.SortID;

                    curInfoUserId = offerinfo.UserID;

                    seoInfo = SEO.GetInfoPageSEO(module.EName);

                    if (seoInfo != null)
                    {
                        seo.Title = seoInfo.Title.Replace("{keyword}", offerinfo.Title);
                        seo.Description = seoInfo.Description.Replace("{keyword}", offerinfo.Title);
                        seo.Keywords = seoInfo.Keywords.Replace("{keyword}", offerinfo.SortName);

                        if (seoInfo.IsMatch)
                        {
                            allClassName = GetAllClassNameForSEO(infoFlag, offerinfo.SortID);

                            seo.Title += "_" + allClassName;
                            seo.Description += "," + allClassName;
                            seo.Keywords += "," + allClassName.Replace("_",",");
                        }
                    }
                    if (seo.Title.Equals("")){ seo.Title = offerinfo.Title; }

                    titleinfo = "�Ҷ�����" + config.WebName + "�����ġ�" + offerinfo.Title + "���ܸ���Ȥ";

                    fieldbody = GetFiledInnerHTML(offerinfo.SortID, module.EName, offerinfo.FieldID);

                }

                //�ӹ���Ϣ
                if (module.EName.Equals("venture") || module.PEName.Equals("venture"))
                {
                    pageinfo.ModuleFlag = "venture";
                    linkmodule = "buymachining";
                    descTableName = "i_Demand";

                    machininginfo = new XYECOM.Business.Demand().GetItem(lngInfoId);

                    if (machininginfo == null || machininginfo.AuditingState != XYECOM.Model.AuditingState.Passed)
                    {
                        ShowErrorMsg("��Ϣ�����ڻ�δͨ����ˣ�");
                        return;
                    }

                    //���˹ؼ���
                    FilterKeyWord(machininginfo);

                    sortId = machininginfo.TypeId;

                    curInfoUserId = machininginfo.UserID;

                    seoInfo = SEO.GetInfoPageSEO(module.EName);

                    if (seoInfo != null)
                    {
                        seo.Title = seoInfo.Title.Replace("{keyword}", machininginfo.Title);
                        seo.Description = seoInfo.Description.Replace("{keyword}", machininginfo.Title);
                        seo.Keywords = seoInfo.Keywords.Replace("{keyword}", machininginfo.SortName);

                        if (seoInfo.IsMatch)
                        {
                            allClassName = GetAllClassNameForSEO(infoFlag, machininginfo.TypeId);

                            seo.Title += "_" + allClassName;
                            seo.Description += "," + allClassName;
                            seo.Keywords += "," + allClassName.Replace("_",",");
                        }
                    }

                    if (seo.Title.Equals("")){seo.Title = machininginfo.Title;}

                    titleinfo = "�Ҷ�����" + config.WebName + "�����ġ�" + machininginfo.Title + "���ܸ���Ȥ";

                    fieldbody = GetFiledInnerHTML(machininginfo.TypeId, module.EName, machininginfo.FieldID);

                }

                //������Ϣ
                if (module.EName.Equals("investment") || module.PEName.Equals("investment"))
                {
                    pageinfo.ModuleFlag = "investment";
                    linkmodule = "buyinvestment";
                    descTableName ="i_InviteBusinessmanInfo";

                    investmentinfo = new XYECOM.Business.InviteBusinessmanInfo().GetItem(lngInfoId);

                    if(investmentinfo ==null || investmentinfo.AuditingState != XYECOM.Model.AuditingState.Passed)
                    {
                        ShowErrorMsg("��Ϣ�����ڻ�δͨ����ˣ�");
                        return;
                    }

                    //���˹ؼ���
                    FilterKeyWord(investmentinfo);

                    sortId = investmentinfo.SortID;

                    curInfoUserId = investmentinfo.UserID;

                    seoInfo = SEO.GetInfoPageSEO(module.EName);

                    if (seoInfo != null)
                    {
                        seo.Title = seoInfo.Title.Replace("{keyword}", investmentinfo.Title);
                        seo.Description = seoInfo.Description.Replace("{keyword}", investmentinfo.Title);
                        seo.Keywords = seoInfo.Keywords.Replace("{keyword}", investmentinfo.SortName);

                        if (seoInfo.IsMatch)
                        {
                            allClassName = GetAllClassNameForSEO(infoFlag, investmentinfo.SortID);

                            seo.Title += "_" + allClassName;
                            seo.Description += "," + allClassName;
                            seo.Keywords += "," + allClassName.Replace("_",",");
                        }
                    }

                    if (seo.Title.Equals("")){seo.Title = investmentinfo.Title;}

                    titleinfo = "�Ҷ�����" + config.WebName + "�����ġ�" + investmentinfo.Title + "���ܸ���Ȥ";

                    fieldbody = GetFiledInnerHTML(investmentinfo.SortID, module.EName, investmentinfo.FieldID);
                }

                //������Ϣ
                if (module.EName.Equals("service") || module.PEName.Equals("service"))
                {
                    pageinfo.ModuleFlag = "service";
                    linkmodule = "buyservice";
                    descTableName ="i_Surrogate";

                    serviceinfo = new XYECOM.Business.ServiceInfo().GetItem(lngInfoId);

                    if (serviceinfo == null || serviceinfo.AuditingState != XYECOM.Model.AuditingState.Passed)
                    {
                        ShowErrorMsg("��Ϣ�����ڻ�δͨ����ˣ�");
                        return;
                    }

                    //���˹ؼ���
                    FilterKeyWord(serviceinfo);

                    sortId = serviceinfo.SortID;

                    curInfoUserId = serviceinfo.UserID;

                    seoInfo = SEO.GetInfoPageSEO(module.EName);

                    if (seoInfo != null)
                    {
                        seo.Title = seoInfo.Title.Replace("{keyword}", serviceinfo.Title);
                        seo.Description = seoInfo.Description.Replace("{keyword}", serviceinfo.Title);
                        seo.Keywords = seoInfo.Keywords.Replace("{keyword}", serviceinfo.SortName);

                        if (seoInfo.IsMatch)
                        {
                            allClassName = GetAllClassNameForSEO(infoFlag, serviceinfo.SortID);

                            seo.Title += "_" + allClassName;
                            seo.Description += "," + allClassName;
                            seo.Keywords += "," + allClassName.Replace("_",",");
                        }
                    }

                    if (seo.Title.Equals("")){seo.Title = serviceinfo.Title;}

                    titleinfo = "�Ҷ�����" + config.WebName + "�����ġ�" + serviceinfo.Title + "���ܸ���Ȥ";

                    fieldbody = GetFiledInnerHTML(serviceinfo.SortID, module.EName, serviceinfo.FieldID);
                }

                UpdateNavigation(module.EName, sortId);

                offerinfo.SellBuy = machininginfo.SellBuy = investmentinfo.SellBuy = serviceinfo.SellBuy = "buy";

                if (lngInfoId > 0)
                {
                    dtimg = XYECOM.Core.Function.GetDataTable(" where DescTabID=" + lngInfoId + " and DescTabName='"+descTableName+"' and At_Index > 1 ", " ", "XYV_Attachment");
                }

                if (SEO.IsAppendWebName)
                {
                    seo.Title = seo.Title + "_" + webInfo.WebName;
                    seo.Description = seo.Description + "," + webInfo.WebName;
                    seo.Keywords = seo.Keywords + "," + webInfo.WebName;
                }

                infoid = lngInfoId +"";

                dtm = GetExpressMessage(module.EName);

                //�û���Ϣ
                if (curInfoUserId > 0)
                {
                    XYECOM.Business.UserInfo ui = new XYECOM.Business.UserInfo();
                    eui = ui.GetItem(Convert.ToInt64(curInfoUserId));

                    try
                    {
                        areaname = eui.AreaInfo.FullNameAll;
                    }
                    catch { }

                    XYECOM.Business.UserReg ur = new XYECOM.Business.UserReg();
                    eu = ur.GetItem(Convert.ToInt64(curInfoUserId));
                    uinformation = eu.InFormation * 2;
                    yearnum = DateTime.Compare(DateTime.Now, eu.RegDate).ToString();
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// ��ȡָ����ŵ����̴������
        /// </summary>
        /// <param name="infoId">Ҫ��ȡ�����̴�����</param>
        /// <returns>�ñ�ű�ʾ�Ķ���</returns>
        public XYECOM.Model.InviteBusinessmanInfo GetItem(int infoId)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@strWhere"," where IBI_ID ="+infoId.ToString()),
                new SqlParameter("@strTableName","XYV_InviteBusinessmanInfo"),
                new SqlParameter("@strOrder","")
            };
            XYECOM.Model.InviteBusinessmanInfo info = null;

            using (SqlDataReader reader = XYECOM.Core.Data.SqlHelper.ExecuteReader(CommandType.StoredProcedure, "XYP_SelectByWhere", param))
            {
                if (reader.Read())
                {
                    info = new XYECOM.Model.InviteBusinessmanInfo();
                    info.InfoID = infoId;
                    info.A_Area = reader["A_Area"].ToString();

                    info.AreaName = "";
                    if ("ȫ��" == info.A_Area || "" == info.A_Area)
                    {
                        info.AreaName = info.A_Area;
                    }
                    else
                    {
                        if ("" != info.A_Area)
                        {
                            List<Model.AreaInfo> arr = new Area().GetItemsByIDs(info.A_Area);
                            bool isok = true;
                            foreach (Model.AreaInfo areainfo in arr)
                            {
                                if (isok)
                                {
                                    info.AreaName = areainfo.Name;
                                    isok = false;
                                }
                                else
                                    info.AreaName += "," + areainfo.Name;
                            }
                        }
                    }

                    if (reader["AuditingState"].ToString() != "")
                    {
                        if (reader["AuditingState"].ToString().Equals("1"))
                            info.AuditingState = XYECOM.Model.AuditingState.Passed;
                        else
                            info.AuditingState = XYECOM.Model.AuditingState.NoPass;
                    }
                    else
                    {
                        info.AuditingState = XYECOM.Model.AuditingState.Null;
                    }
                    //�����ĸ������� ���� 2008-10-18
                    info.ModuleFlag = reader["ModuleName"].ToString();
                    info.Title = reader["IBI_Title"].ToString();
                    info.PublishTime = Core.MyConvert.GetDateTime(reader["IBI_PublishDate"].ToString());
                    info.EndTime = Core.MyConvert.GetDateTime(reader["IBI_EndTime"].ToString());
                    info.InfoContent = reader["IBI_Content"].ToString();
                    info.UserID = Core.MyConvert.GetInt64(reader["U_ID"].ToString());
                    info.SortID = Core.MyConvert.GetInt64(reader["IT_ID"].ToString());
                    info.SortName = reader["IT_Name"].ToString();
                    info.HtmlPage = reader["IBI_HTMLPage"].ToString();
                    info.ClickNum = Core.MyConvert.GetInt64(reader["IBI_ClickNum"].ToString());
                    info.IsCommend = reader["IBI_Vouch"].ToString() == "1";
                    info.MessageNum = Core.MyConvert.GetInt32(reader["IBI_MessageNum"].ToString());
                    info.NotReadingNum = Core.MyConvert.GetInt32(reader["IBI_NoMessageNum"].ToString());
                    info.UseFulDate = Core.MyConvert.GetInt32(reader["IBI_EndDate"].ToString());
                    info.InfoType = Core.MyConvert.GetInt32(reader["IBI_Sign"].ToString());
                    info.FieldID = Core.MyConvert.GetInt64(reader["P_ID"].ToString());
                    info.IsPause = Core.MyConvert.GetBoolean(reader["IBI_Pause"].ToString());
                    //��������
                    info.QuondamProduct = reader["S_Name"].ToString();
                    info.Support = reader["IBI_Support"].ToString();
                    info.Demand = reader["IBI_Demand"].ToString();
                    info.URL = reader["IBI_URL"].ToString();
                    //���ø�����Ϣ
                    info.AttachInfo = new Attachment().GetItems(info.InfoID, "i_invitebusinessmaninfo");
                    //Attachment.SetAttachmentInfo(info, reader);
                }
            }
            return info;
        }