Пример #1
0
    /// <summary>
    /// 绑定要修改的新闻信息
    /// </summary>
    /// <param name="id">要修改的新闻ID</param>
    private void NewsDataBind(Int64 id)
    {
        newsInfo = new XYECOM.Business.News().GetItem(newsId);

        if (newsInfo != null)
        {
            string newstypeckId = "";
            //新闻类型
            if (newsInfo.Type == XYECOM.Model.NewsType.TextNews)
            {
                this.rbcommonnews.Checked = true;
                this.rbpicnews.Checked = false;
                this.rbcaptionnews.Checked = false;
                newstypeckId = this.rbcommonnews.ClientID;
            }
            else if (newsInfo.Type == XYECOM.Model.NewsType.ImageNews)
            {
                this.rbpicnews.Checked = true;
                this.rbcommonnews.Checked = false;
                this.rbcaptionnews.Checked = false;
                newstypeckId = this.rbpicnews.ClientID;
            }
            else if (newsInfo.Type == XYECOM.Model.NewsType.HeadlineNews)
            {
                this.rbcaptionnews.Checked = true;
                this.rbcommonnews.Checked = false;
                this.rbpicnews.Checked = false;
                newstypeckId = this.rbcaptionnews.ClientID;
            }

            this.tbnewsname.Text = newsInfo.Title;

            //if (newsInfo.FileUrl != "")
            //{
            //    rbfileUrl.Checked = true;
            //    txtfileUrl.Text = newsInfo.FileUrl;
            //}

            if (!newsInfo.TitleStyle.Equals(""))
            {
                string[] strs = newsInfo.TitleStyle.Split(';');

                foreach (string s in strs)
                {
                    if (s.Equals("")) continue;

                    string[] ss = s.Split(':');

                    if (ss.Length != 2) continue;

                    if (ss[0].Equals("color"))
                    {
                        this.txtTitleColor.Value = ss[1];
                        this.selTitleColor.Value = ss[1];
                    }

                    if (ss[0].Equals("font-weight")) this.chkFontBold.Checked = true;

                    if (ss[0].Equals("font-style")) this.chkFontItalic.Checked = true;

                    if (ss[0].Equals("text-decoration")) this.chkFontUnderline.Checked = true;
                }
            }

            if (newsInfo.TypeIds != "")
            {
                this.hdgetid.Value = XYECOM.Core.Utils.RemoveComma(newsInfo.TypeIds.ToString());
            }

            hidTopicID.Value = newsInfo.TopicType;

            this.tbtwoname.Text = newsInfo.SubTitle;
            this.reswords.Text = newsInfo.Keyword;
            this.tbnewsness.Text = newsInfo.Leadin;
            this.tblinkaddress.Text = newsInfo.HeadlineNewsUrl;

            //附件信息
            DataTable tableAttInfo = new XYECOM.Business.Attachment().GetDataTable(newsInfo.NewsId, XYECOM.Model.AttachmentItem.News, XYECOM.Model.UploadFileType.Image);
            string uploadTypeckId = "";
            if (tableAttInfo.Rows.Count > 0 && newsInfo.PicUrl.Equals("Image"))
            {
                this.rbpicupload.Checked = true;
                this.rbpicurl.Checked = false;

                uploadTypeckId = this.rbpicupload.ClientID;
            }
            else
            {
                this.hipictype.Value = "-1";
                this.hdpicurl.Value = newsInfo.PicUrl;
                this.rbpicurl.Checked = true;
                this.rbpicupload.Checked = false;
                this.tbpinurl.Value = newsInfo.PicUrl;
                uploadTypeckId = this.rbpicurl.ClientID;
            }

            this.tbnewsauthor.Text = newsInfo.Author;
            this.ddlnewsauthor.SelectedValue = this.tbnewsauthor.Text.Trim();
            this.tbnewsorigin.Text = newsInfo.Origin;
            this.ddlnewsorigin.SelectedValue = this.tbnewsorigin.Text.Trim();
            this.newsBody.Value = newsInfo.Content;

            if (newsInfo.AddTime != "")
            {
                try
                {
                    this.tbaddtime.Value = Convert.ToDateTime(newsInfo.AddTime).ToShortDateString();
                }
                catch
                {
                    this.tbaddtime.Value = DateTime.Now.ToShortDateString();
                }
            }

            this.tbcount.Text = newsInfo.ClickNumber.ToString();

            this.cbIsFlag.Checked = newsInfo.IsCommend;

            this.cbIsDiscuss.Checked = newsInfo.IsAllowComment;

            this.cbIsTop.Checked = newsInfo.IsTop;

            this.cbIsHot.Checked = newsInfo.IsHot;

            this.cbIsSlide.Checked = newsInfo.IsSlide;

            if (newsInfo.State == XYECOM.Model.AuditingState.NoPass)
            {
                this.cbAuditing.Checked = false;
            }
            if (newsInfo.State == XYECOM.Model.AuditingState.Passed)
            {
                this.cbAuditing.Checked = true;
            }

            if (newsInfo.ChargeState != "1")
            {
                if (newsInfo.HTMLPage != "")
                {
                    this.cbcreate.Checked = true;
                }
            }
            else
            {
                this.cbcreate.Enabled = false;
            }

            if (newsInfo.Contributor.Equals(0))
            {
                this.IsContributor.Visible = false;
            }
            else
            {
                if (newsInfo.Contributor.ToString() == "-1")
                {
                    this.Contributor.InnerHtml = "<a href=\"#\">游客</a>";
                }
                else
                {
                    XYECOM.Business.UserReg urBLL = new UserReg();
                    XYECOM.Model.UserRegInfo urinfo = new XYECOM.Model.UserRegInfo();
                    urinfo = urBLL.GetItem(newsInfo.Contributor);
                    if (!urinfo.Type)
                        this.Contributor.InnerHtml = "<a href=\"../UserManage/IndividualInfo.aspx?U_ID=" + newsInfo.Contributor + "&backURL=../news/AddNews.aspx?id=" + newsId + "&" + XYECOM.Core.XYRequest.GetQueryString("backURL") + "\">" + newsInfo.Author + "(个人会员)</a>";
                    else
                        this.Contributor.InnerHtml = "<a href=\"../UserManage/UserInfo.aspx?U_ID=" + newsInfo.Contributor + "&backURL=../news/AddNews.aspx?id=" + newsId + "&" + XYECOM.Core.XYRequest.GetQueryString("backURL") + "\">" + newsInfo.Author + "(企业会员)</a>";
                }

            }

            this.city.Value = XYECOM.Core.Utils.RemoveComma(newsInfo.AreaIds);

            this.tradeid.Value = XYECOM.Core.Utils.RemoveComma(newsInfo.TradeIds);

            this.offerid.Value = XYECOM.Core.Utils.RemoveComma(newsInfo.ProtypeIds);

            InitOption(newsInfo.FileUrl);

            ClientScript.RegisterStartupScript(GetType(), Guid.NewGuid().ToString(), "myclick('" + newstypeckId + "','click');", true);
            ClientScript.RegisterStartupScript(GetType(), Guid.NewGuid().ToString(), "myclick('" + uploadTypeckId + "','click');", true);

            if (newsInfo.IsScheme == 1)
                this.cbIsScheme.Checked = true;

            if (newsInfo.IsScheme != 0 && newsInfo.ProIds != null)
            {
                string StrHtml = "";
                string[] IdsArry = newsInfo.ProIds.Split(',');
                string ItemStr = "";

                for (int i = 0; i < IdsArry.Length; i++)
                {
                    if (IdsArry[i] != null)
                    {
                        XYECOM.Model.SupplyInfo SupplyInfo = SupplyBLL.GetSupplyById(XYECOM.Core.MyConvert.GetInt32(IdsArry[i]));

                        StrHtml += "<input checked='checked' onclick=\"Selectchange('" + IdsArry[i] + "')\" type='checkbox' id='cbsel_" + IdsArry[i] + "' value='" + IdsArry[i] + "'/><label>" + SupplyInfo.Title + "</label>";
                        ItemStr += IdsArry[i] + ":" + SupplyInfo.Title + ",";
                    }
                }
                this.Infostxt.Text = StrHtml;
                this.HidItemStr.Value = ItemStr.Substring(0, ItemStr.Length - 1);
            }
        }
    }
Пример #2
0
    private void BindData(Int64 uid)
    {
        string moneyformat = "n"; //货币转换格式

        XYECOM.Business.UserReg userRegBLL = new XYECOM.Business.UserReg();
        XYECOM.Model.UserRegInfo userRegInfo = new XYECOM.Model.UserRegInfo();
        userRegInfo = userRegBLL.GetItem(uid);
        if (!object.Equals(null, userRegInfo))
        {
            this.tdusername.Text = userRegInfo.LoginName; //用户名
            this.tdemail.Text = userRegInfo.Email;   //电子邮件
            this.bgdate.Value = userRegInfo.RegDate.ToShortDateString(); //注册时间
            txtQuestion.Text = userRegInfo.Question;
            txtAnswer.Text = userRegInfo.Answer;
        }
        else
        {
            Alert("该会员信息有误,请重新选择.", backURL);
        }

        XYECOM.Business.UserInfo userInfoBLL = new XYECOM.Business.UserInfo();
        XYECOM.Model.UserInfo userInfo = new XYECOM.Model.UserInfo();
        userInfo=userInfoBLL.GetItem(uid);
        if (!object.Equals(null, userInfo))
        {
            this.tdrealname.Text = userInfo.LinkMan; //真实姓名
            if (userInfo.Sex == true)                     //性别
                this.tdsex.Text = "1";
            else
                this.tdsex.Text = "0";

            tdIM.InnerHtml = XYECOM.Configuration.FreeCode.Instance.IM.Name + ":";
            txtIM.Text = userInfo.IM;
            this.tdmobil.Text = userInfo.Mobile; //手机
            this.tdsection.Text = userInfo.Section; //所在部门
            this.tdpost.Text = userInfo.Post;    //所任职位

            this.companyname.Text = userInfo.Name; //企业名称

            areatypeid.Value = userInfo.AreaId.ToString();
            txtTelephone.Text = userInfo.Telephone;
            txtFax.Text = userInfo.Fax;
            this.tdpostcode.Text = userInfo.Postcode; //邮政编码
            this.tdhomepage.Text = userInfo.HomePage.Trim(); //企业网址
            this.tdlinkadress.Text = userInfo.Address; //联系地址
            this.tdcharacter.Text = userInfo.Character; //企业性质

            companyid.Value = userInfo.UserTypeId.ToString();
            //this.tdsupply.Text = userInfo.U_SupplyProduct; //提供的产品.服务

            this.tdsupply.Text = userInfo.MainProduct;
            this.tdbuy.Text = userInfo.BuyPro; //需要的产品/服务

            if (userInfo.RegisteredCapital.ToString() != "")
                this.tdmoney.Text = Convert.ToDecimal(userInfo.RegisteredCapital).ToString(moneyformat);
            else
                this.tdmoney.Text = userInfo.Mode;     //注册资金

            this.tdmoneytype.Text = userInfo.MoneyType; //注册资金类别

            tdumode.DataSource = new XYECOM.Business.Mode().GetDataTable();
            tdumode.DataTextField = "M_Type";
            tdumode.DataValueField = "M_Type";
            tdumode.DataBind();

            string[] modes = userInfo.Mode.Split(',');

            foreach (string s in modes)
            {
                for (int i = 0; i < tdumode.Items.Count; i++)
                {
                    if (tdumode.Items[i].Value.Equals(s))
                    {
                        tdumode.Items[i].Selected = true;
                        break;
                    }
                }
            }

            this.lbyear.Text = userInfo.RegYear.ToString(); //注册时间
            this.lbarea.Text = userInfo.BusinessAddress; //主要经营地点
            this.lbaddress.Value = userInfo.RegAreaId.ToString(); //企业注册地
            //this.tdptype.Text = userInfo.U_PType; //主营产品/服务
            this.lbnumber.Text = userInfo.EmployeeTotal; //企业人数
            this.tdsynopsis.Text = userInfo.Synopsis; //企业简介

        }
        else
        {
            Alert("该会员信息有误,请重新选择.", backURL);
        }
    }
Пример #3
0
    protected string Link(string id)
    {
        if (id == "-1")
        {
            return "游客";
        }

        XYECOM.Business.UserReg urBLL = new UserReg();
        XYECOM.Model.UserRegInfo urinfo = new XYECOM.Model.UserRegInfo();

        urinfo = urBLL.GetItem(XYECOM.Core.MyConvert.GetInt64(id));

        if (urinfo == null)
        {
            return "用户已删除";
        }

        if (!urinfo.Type)
            return "<a href='../UserManage/IndividualInfo.aspx?U_ID=" + id + "&backURL=../news/ContributorList.aspx'>" + urinfo.LoginName + "</a><br/>(个人会员)";
        else
            return "<a href='../UserManage/UserInfo.aspx?U_ID=" + id + "&backURL=../news/ContributorList.aspx'>" + urinfo.LoginName + "</a><br/>(企业会员)";
    }