Example #1
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            XYECOM.Business.UserReg userRegBLL = new XYECOM.Business.UserReg();

            Model.GeneralUserInfo guInfo = XYECOM.Business.CheckUser.UserInfo;

            string oldPwd = Core.SecurityUtil.MD5(this.txtOldPwd.Text, XYECOM.Configuration.Security.Instance.Md5value);
            Model.UserRegInfo regInfo = userRegBLL.GetItem(guInfo.LoginName, oldPwd);
            if (regInfo == null)
            {
                //密码错误
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('密码错误,请重试!');", true);
                return;
            }

            int num = userRegBLL.UpdatePassWord(guInfo.userid, Core.SecurityUtil.MD5(this.txtNewPwd.Text, XYECOM.Configuration.Security.Instance.Md5value));
            this.txtNewPwd.Text = string.Empty;
            this.txtNewPwd1.Text = string.Empty;
            this.txtOldPwd.Text = string.Empty;
            if (num > 0)
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('保存成功,重新登录!');location.href='/LogOut.aspx';", true);
            }
            else
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('保存失败,请重试!');", true);
            }
        }
Example #2
0
File: buy.cs Project: 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();
                }
            }
        }
Example #3
0
        /// <summary>
        /// �Ƿ���Բ鿴��ϵ��ʽ
        /// </summary>
        /// <param name="infoUserId">��Ϣ������Id</param>
        /// <param name="loginUserId">��ǰ��¼�û�Id</param>
        /// <param name="item">��ϵ��ʽ�����������ҳ�棩</param>
        /// <returns>�Ƿ���Բ鿴��ϵ��ʽ</returns>
        public static Model.ContactsControlRetrunValue IsViewContact(long infoUserId, long loginUserId, XYECOM.Model.ContactsControlItem item)
        {
            if (infoUserId <= 0) return XYECOM.Model.ContactsControlRetrunValue.CanNotSee;

            if (item == XYECOM.Model.ContactsControlItem.Null) return XYECOM.Model.ContactsControlRetrunValue.CanNotSee;

            if (infoUserId == loginUserId) return XYECOM.Model.ContactsControlRetrunValue.CanSee;

            XYECOM.Business.UserReg userRegBLL = new XYECOM.Business.UserReg();

            XYECOM.Configuration.WebInfo webInfo = XYECOM.Configuration.WebInfo.Instance;

            //��ǰ��Ϣ�����ߵ�ע����Ϣ
            XYECOM.Model.UserRegInfo infoUserRegInfo = userRegBLL.GetItem(infoUserId);
            //��ǰ��¼�û���ע����Ϣ
            XYECOM.Model.UserRegInfo curLoginUserRegInfo = null;

            Model.ContactsControlRetrunValue returnValue = XYECOM.Model.ContactsControlRetrunValue.Null;

            bool isLogin = false;

            if (loginUserId > 0)
            {
                //��ǰ��¼�û���ע����Ϣ
                curLoginUserRegInfo = userRegBLL.GetItem(loginUserId);

                if (curLoginUserRegInfo != null) isLogin = true;
            }

            if (!isLogin)
            {
                if (webInfo.IsGuestLookLinkInfo)
                    returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;//���Բ鿴
                else
                    returnValue = XYECOM.Model.ContactsControlRetrunValue.CanNotSee;//�����Բ鿴
            }

            //��ǰ��Ϣ�����߲�Ϊ���ҵ�ǰ��¼�û�Ϊ��ҵ��Աʱ
            if (infoUserRegInfo != null)
            {
                //�����˶��ܲ鿴
                switch (item)
                {
                    case XYECOM.Model.ContactsControlItem.SellOffer:
                        //��Ӧ
                        if (infoUserRegInfo.GradePopedomInfo.SeeBySellOffer) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.BuyOffer:
                        //��
                        if (infoUserRegInfo.GradePopedomInfo.SeeByBuyOffer) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.SellMachining:
                        //�ṩ�ӹ�
                        if (infoUserRegInfo.GradePopedomInfo.SeeBySellMachining) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.BuyMaching:
                        //Ѱ��ӹ�
                        if (infoUserRegInfo.GradePopedomInfo.SeeByBuyMachining) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.SellInvestment:
                        //����
                        if (infoUserRegInfo.GradePopedomInfo.SeeBySellBusiness) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.BuyInvestment:
                        //����
                        if (infoUserRegInfo.GradePopedomInfo.SeeByBuyBusiness) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.SellService:
                        //�ṩ����
                        if (infoUserRegInfo.GradePopedomInfo.SeeBySellService) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.BuyService:
                        // Ѱ�����
                        if (infoUserRegInfo.GradePopedomInfo.SeeByBuyService) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.Brand:
                        // Ʒ��
                        if (infoUserRegInfo.GradePopedomInfo.SeeByBrand) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    case XYECOM.Model.ContactsControlItem.Company:
                        // ��ҵ
                        if (infoUserRegInfo.GradePopedomInfo.SeeByCompany) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                        break;
                    default:
                        returnValue = XYECOM.Model.ContactsControlRetrunValue.CanNotSee;
                        break;
                }
            }

            //�����ǰ�û��ѵ�¼��Ϊ���˻�Աʱ�����������ϵ��ʽ
            if (curLoginUserRegInfo != null && !curLoginUserRegInfo.Type) returnValue = XYECOM.Model.ContactsControlRetrunValue.PopedomTooLow;

            //��ǰ�û��ѵ�¼��Ϊ��ҵ��Ա������֮ǰ�жϽ��Ϊ���ܲ鿴��ϵ��ʽʱ�����ж�
            if (isLogin && curLoginUserRegInfo.Type && returnValue != XYECOM.Model.ContactsControlRetrunValue.CanSee)
            {
                if (curLoginUserRegInfo != null)
                {
                    //loginuid = curLoginUserRegInfo.U_ID;
                    //if (id == 0) uid = curLoginUserRegInfo.U_ID;

                    returnValue = XYECOM.Model.ContactsControlRetrunValue.PopedomTooLow;

                    switch (item)
                    {
                        case XYECOM.Model.ContactsControlItem.SellOffer:
                            //��Ӧ
                            if(curLoginUserRegInfo.GradePopedomInfo.UGP_IsSupplyLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.BuyOffer:
                            //��
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsBuyLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.SellMachining:
                            //�ṩ�ӹ�
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsSupplyMachiningLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.BuyMaching:
                            //Ѱ��ӹ�
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsBuyMachiningLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.SellInvestment:
                            //����
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsBuinessLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.BuyInvestment:
                            //����
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsSurrogateLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.SellService:
                            //�ṩ����
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsSupplyServerLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.BuyService:
                            // Ѱ�����
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsBuyServerLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.Brand:
                            // Ʒ��
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsBrandLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.Job:
                            // �˲�
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsJobLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                        case XYECOM.Model.ContactsControlItem.Company:
                            // ��ҵ
                            if (curLoginUserRegInfo.GradePopedomInfo.UGP_IsCompanyLinkMathod) returnValue = XYECOM.Model.ContactsControlRetrunValue.CanSee;
                            break;
                    }
                }
            }

            //�жϿ��Բ鿴������ҵ����
            if (isLogin
                && returnValue == XYECOM.Model.ContactsControlRetrunValue.CanSee
                && curLoginUserRegInfo.Type
                && !curLoginUserRegInfo.GradePopedomInfo.SeeContactsNum.Equals(0))
            {
                if (returnValue == XYECOM.Model.ContactsControlRetrunValue.CanSee)
                {
                    XYECOM.Business.UserData userdataBLL = new XYECOM.Business.UserData();
                    XYECOM.Model.UserData userdatainfo = new XYECOM.Model.UserData();
                    userdatainfo = userdataBLL.GetItem(loginUserId);
                    if (userdatainfo == null)
                    {
                        XYECOM.Model.UserData udinfo = new XYECOM.Model.UserData();
                        udinfo.Uid = loginUserId;
                        udinfo.Companyids = infoUserId + ",";
                        userdataBLL.Insert(udinfo);
                    }
                    else
                    {
                        String[] ids = userdatainfo.Companyids.Split(',');
                        String isHave = "";
                        for (int k = 0; k < (ids.Length - 1); k++)
                        {
                            if (ids[k].Equals(infoUserId.ToString()))
                            {
                                isHave = "1";
                                break;
                            }
                        }
                        if (!isHave.Equals("1"))
                        {
                            XYECOM.Business.UserInfo infoBLL = new XYECOM.Business.UserInfo();
                            XYECOM.Model.UserInfo uinfo = new XYECOM.Model.UserInfo();
                            uinfo = infoBLL.GetItem(Convert.ToInt64(loginUserId));
                            int num = XYECOM.Business.UserGradePopedom.SeeContactsNum(uinfo.RegInfo.GradeId);
                            if ((userdatainfo.Companyids.Split(',').Length) <= num)
                            {
                                userdatainfo.Uid = loginUserId;
                                userdatainfo.Companyids = userdatainfo.Companyids + infoUserId + ",";
                                userdataBLL.Insert(userdatainfo);
                            }
                            else
                            {
                                returnValue = XYECOM.Model.ContactsControlRetrunValue.PopedomTooLow;
                            }
                        }
                    }
                }
            }

            return returnValue;
        }