Example #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (this.Action == "add")
            {
                LinkModel info = new LinkModel();
                info.possymbol  = possymbol;
                info.includepic = this.txtincludepic.Text.Trim();
                info.linkurl    = this.txtlinkurl.Text.Trim();
                info.orderno    = Int32.Parse(this.txtorderno.Text.Trim());
                info.linkname   = this.txttitle.Text.Trim();
                info.createtime = DateTime.Now;

                LinkFactory.Add(info);

                ClientScript.RegisterStartupScript(this.GetType(), "AddEditTips", "<script language=\"javascript\">alert('添加成功!');window.location='linklist.aspx?pb=" + possymbol + "';</script>");
            }
            else if (this.Action == "edit")
            {
                int       linkid = HYRequest.GetInt("linkid", 0);
                LinkModel info   = LinkFactory.Get(linkid);

                info.includepic = this.txtincludepic.Text.Trim();
                info.linkurl    = this.txtlinkurl.Text.Trim();
                info.orderno    = Int32.Parse(this.txtorderno.Text.Trim());
                info.linkname   = this.txttitle.Text.Trim();

                LinkFactory.Update(info);
                ClientScript.RegisterStartupScript(this.GetType(), "AddEditTips", "<script language=\"javascript\">alert('修改成功!');window.location='linklist.aspx?pb=" + possymbol + "';</script>");
            }
        }
Example #2
0
        public string getadlinks(int linkid)
        {
            LinkModel l = LinkFactory.Get(linkid);

            if (l != null)
            {
                return(string.Format("<a href='{0}' target='_blank'><img src='{1}' width='1000' height='80' /></a>", l.linkurl, l.includepic));
            }

            return(string.Empty);
        }
Example #3
0
        public string getadlinks(int linkid, string tpl)
        {
            LinkModel l = LinkFactory.Get(linkid);

            if (l != null)
            {
                return(string.Format(tpl, l.linkurl, l.includepic));
            }

            return(string.Empty);
        }
Example #4
0
        public string getadlinks(int linkid)
        {
            LinkModel l = LinkFactory.Get(linkid);

            if (l != null)
            {
                return(string.Format("<a href=\"{0}\" target=\"_blank\"><img src=\"{1}\" width=\"1000\" height=\"80\" /></a>", l.linkurl, l.includepic));
            }

            return(string.Empty);
        }
Example #5
0
        private void LoadData()
        {
            if (this.Action == "edit")
            {
                int       linkid = HYRequest.GetInt("linkid", 0);
                LinkModel info   = LinkFactory.Get(linkid);

                this.txtincludepic.Text = info.includepic;
                this.txtlinkurl.Text    = info.linkurl;
                this.txtorderno.Text    = info.orderno.ToString();
                this.txttitle.Text      = info.linkname;
            }
        }