示例#1
0
        private void editNoPic()
        {
            string title = this.txt_title.Text;

            if (title == null | title.Length <= 0)
            {
                JS.Alert("题目不能为空!");
                return;
            }
            if (title.Length >= 255)
            {
                JS.Alert("题目过长!");
                return;
            }

            string url = this.txt_Url.Text;

            if (url == null | url.Length <= 0)
            {
                JS.Alert("地址不能为空!");
                return;
            }
            if (url.Length >= 255)
            {
                JS.Alert("地址过长!");
                return;
            }
            string content = content2.Value;

            string         strDateTime = this.txt_DateTime.Value;
            string         sqlEdit     = "update t_sample set ptitle=@ptitle,pcontent=@pcontent , purl=@url, pdate=@pdate  where id=" + UID;
            ArrayList      insertValue = new ArrayList();
            OleDbParameter ptitle      = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);



            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);

            OleDbParameter purl = new OleDbParameter("@purl", OleDbType.VarChar);

            purl.Value = url;
            insertValue.Add(purl);

            OleDbParameter pdate = new OleDbParameter("@pdate", OleDbType.Date);

            pdate.Value = strDateTime;
            insertValue.Add(pdate);

            int p = AccessDb.ExecuteNon(sqlEdit, ref insertValue);

            JS.Alert("修改成功!");
        }
示例#2
0
        private void edit()
        {
            string title = this.txt_title.Text;

            if (title == null || title.Length <= 0)
            {
                JS.Alert("题目不能为空!");
                return;
            }
            if (title.Length >= 255)
            {
                JS.Alert("题目过长!");
                return;
            }
            string content = content2.Value;

            if (content == null || content.Length <= 0)
            {
                JS.Alert("内容不能为空!");
                return;
            }



            string FilePath = "";

            FilePath = File1.Value;

            if (FilePath.Length > 0)
            {
                FilePath = FileUp.meUpfile(this.File1, @"~\file\", true);
                FilePath = FilePath.Substring(FilePath.IndexOf('\\') + 1);
            }


            string         sqlEdit     = "update t_plat set ptitle=@ptitle,pcontent=@pcontent  ,purl=@purl  where id=" + UID;
            ArrayList      insertValue = new ArrayList();
            OleDbParameter ptitle      = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);
            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);

            OleDbParameter purl = new OleDbParameter("@purl", OleDbType.LongVarWChar);

            purl.Value = FilePath;
            insertValue.Add(purl);

            int p = AccessDb.ExecuteNon(sqlEdit, ref insertValue);

            JS.Alert("修改成功!");
        }
示例#3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string    content     = content2.Value;
            string    sql         = "update t_about_top set pcontent=@pcontent where pname='s2'";
            ArrayList insertValue = new ArrayList();

            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);
            int p = AccessDb.ExecuteNon(sql, ref insertValue);

            JS.Alert("修改成功!");
        }
示例#4
0
        private bool updatSql(string pic, string title, string url, int sort, bool IsShow, string id)
        {
            string sql = "update t_lunpic set  ppic=@ppic,ptitle=@ptitle , purl=@purl ,psort=@psort,PIsShow=@PIsShow where ID=@pid";

            ArrayList insertValue = new ArrayList();

            OleDbParameter ppic = new OleDbParameter("@ppic", OleDbType.VarChar);

            ppic.Value = pic;
            insertValue.Add(ppic);

            OleDbParameter ptitle = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);

            OleDbParameter purl = new OleDbParameter("@purl", OleDbType.VarChar);

            purl.Value = url;
            insertValue.Add(purl);

            OleDbParameter psort = new OleDbParameter("@psort", OleDbType.Integer);

            psort.Value = sort;
            insertValue.Add(psort);

            OleDbParameter PIsShow = new OleDbParameter("@PIsShow", OleDbType.Boolean);

            PIsShow.Value = IsShow;
            insertValue.Add(PIsShow);

            OleDbParameter pid = new OleDbParameter("@pid", OleDbType.VarChar);

            pid.Value = id;
            insertValue.Add(pid);

            int p = AccessDb.ExecuteNon(sql, ref insertValue);

            if (p == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#5
0
        private void add()
        {
            string         title       = this.txt_title.Text;
            string         content     = content2.Value;
            string         sql         = "insert into t_interface (ptitle,pcontent) values(@ptitle,@pcontent)";
            ArrayList      insertValue = new ArrayList();
            OleDbParameter ptitle      = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);
            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);
            int p = AccessDb.ExecuteNon(sql, ref insertValue);

            JS.Alert("添加成功!");
        }
示例#6
0
        private void editPic(string pic)
        {
            string title = this.txt_title.Text;

            string content    = content2.Value;
            bool   _pAnswered = false;


            if (content != null && content.Length > 0)
            {
                _pAnswered = true;
            }
            else
            {
                _pAnswered = false;
            }

            string         sqlEdit     = "update t_question set ptitle=@ptitle,pcontent=@pcontent ,ppic=@ppic ,pAnswered=@pAnswered where id=" + UID;
            ArrayList      insertValue = new ArrayList();
            OleDbParameter ptitle      = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);


            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);

            OleDbParameter ppic = new OleDbParameter("@ppic", OleDbType.LongVarWChar);

            ppic.Value = pic;
            insertValue.Add(ppic);

            OleDbParameter pAnswered = new OleDbParameter("@pAnswered", OleDbType.Boolean);

            pAnswered.Value = _pAnswered;
            insertValue.Add(pAnswered);

            int p = AccessDb.ExecuteNon(sqlEdit, ref insertValue);

            JS.Alert("修改成功!");
        }
示例#7
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="title"></param>
        /// <param name="url"></param>
        /// <param name="sort"></param>
        /// <param name="IsShow"></param>
        /// <returns></returns>
        private bool AddSqlPic(string pic, string title, string url, int sort, bool IsShow)
        {
            string    sql         = "insert into t_lunpic (ppic,ptitle,purl,psort,PIsShow) values(@ppic,@ptitle,@purl,@psort,@PIsShow)";
            ArrayList insertValue = new ArrayList();

            OleDbParameter ppic = new OleDbParameter("@ppic", OleDbType.VarChar);

            ppic.Value = pic;
            insertValue.Add(ppic);

            OleDbParameter ptitle = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);

            OleDbParameter purl = new OleDbParameter("@purl", OleDbType.VarChar);

            purl.Value = url;
            insertValue.Add(purl);

            OleDbParameter psort = new OleDbParameter("@psort", OleDbType.Integer);

            psort.Value = sort;
            insertValue.Add(psort);

            OleDbParameter PIsShow = new OleDbParameter("@PIsShow", OleDbType.Boolean);

            PIsShow.Value = IsShow;
            insertValue.Add(PIsShow);

            int p = AccessDb.ExecuteNon(sql, ref insertValue);

            if (p == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#8
0
        private void edit()
        {
            string title = this.txt_title.Text;

            string content = content2.Value;

            //string sql = "insert into t_news (ptitle,pcontent,puser,pdate,ptype) values(@ptitle,@pcontent,@puser,@pdate,@ptype)";
            string         sqlEdit     = "update t_interface set ptitle=@ptitle,pcontent=@pcontent  where id=" + UID;
            ArrayList      insertValue = new ArrayList();
            OleDbParameter ptitle      = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);
            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);

            int p = AccessDb.ExecuteNon(sqlEdit, ref insertValue);

            JS.Alert("修改成功!");
        }
示例#9
0
        private void editPic(string pic)
        {
            try
            {
                string title = this.txt_title.Text;
                if (title == null | title.Length <= 0)
                {
                    JS.Alert("题目不能为空!");
                    return;
                }
                if (title.Length >= 255)
                {
                    JS.Alert("题目过长!");
                    return;
                }

                string url = this.txt_Url.Text;
                if (url == null | url.Length <= 0)
                {
                    JS.Alert("地址不能为空!");
                    return;
                }
                if (url.Length >= 255)
                {
                    JS.Alert("地址过长!");
                    return;
                }
                string content = content2.Value;

                string strDateTime = this.txt_DateTime.Value;

                string sqlEdit = "update t_sample set ptitle=@ptitle , pcontent=@pcontent ,  purl=@purl , ppic=@ppic, pdate=@pdate where id=" + UID;

                ArrayList insertValue = new ArrayList();

                OleDbParameter _ptitle = new OleDbParameter("@ptitle", OleDbType.VarChar);
                _ptitle.Value = title;
                insertValue.Add(_ptitle);


                OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);
                pcontent.Value = content;
                insertValue.Add(pcontent);

                OleDbParameter _purl = new OleDbParameter("@purl", OleDbType.VarChar);
                _purl.Value = url;
                insertValue.Add(_purl);

                OleDbParameter _ppic = new OleDbParameter("@ppic", OleDbType.LongVarWChar);
                _ppic.Value = pic;
                insertValue.Add(_ppic);

                OleDbParameter pdate = new OleDbParameter("@pdate", OleDbType.Date);
                pdate.Value = strDateTime;
                insertValue.Add(pdate);

                int p = AccessDb.ExecuteNon(sqlEdit, ref insertValue);
                JS.Alert("修改成功!");
            }
            catch (System.Exception ex)
            {
                JS.Alert("修改错误!错误信息:" + ex.Message);
            }
        }
示例#10
0
        private void add()
        {
            string Pic1 = "";

            Pic1 = File1.Value;

            if (Pic1.Length > 0)
            {
                Pic1 = FileUp.meUpfile(this.File1, @"~\pic\", false);
            }



            string title = this.txt_title.Text;

            if (title == null | title.Length <= 0)
            {
                JS.Alert("题目不能为空!");
                return;
            }
            if (title.Length >= 255)
            {
                JS.Alert("题目过长!");
                return;
            }

            string url = this.txt_Url.Text;

            if (url == null | url.Length <= 0)
            {
                JS.Alert("地址不能为空!");
                return;
            }
            if (url.Length >= 255)
            {
                JS.Alert("地址过长!");
                return;
            }

            string content = content2.Value;

            string strDateTime = this.txt_DateTime.Value;

            string         sql         = "insert into t_sample (ptitle,pcontent,purl,ppic,pdate) values(@ptitle,@pcontent,@url,@ppic,@pdate)";
            ArrayList      insertValue = new ArrayList();
            OleDbParameter ptitle      = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);

            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);

            OleDbParameter purl = new OleDbParameter("@purl", OleDbType.VarChar);

            purl.Value = url;
            insertValue.Add(purl);

            OleDbParameter ppic = new OleDbParameter("@ppic", OleDbType.LongVarWChar);

            ppic.Value = Pic1;
            insertValue.Add(ppic);

            OleDbParameter pdate = new OleDbParameter("@pdate", OleDbType.Date);

            pdate.Value = strDateTime;
            insertValue.Add(pdate);


            int p = AccessDb.ExecuteNon(sql, ref insertValue);

            JS.Alert("添加成功!");

            this.txt_title.Text = "";
            this.txt_Url.Text   = "";
            this.content2.Value = "";
        }
示例#11
0
        private void add()
        {
            string Pic1 = "";

            Pic1 = File1.Value;

            if (Pic1.Length > 0)
            {
                Pic1 = FileUp.meUpfile(this.File1, @"~\pic\", false);
            }

            bool _pAnswered = false;

            string title = this.txt_title.Text;

            if (title == null || title.Length <= 0)
            {
                JS.Alert("问题题目不能为空!");
                return;
            }

            if (title.Length >= 255)
            {
                JS.Alert("问题题目过长!");
                return;
            }
            string content = content2.Value;

            if (content != null && content.Length > 0)
            {
                _pAnswered = true;
            }
            else
            {
                _pAnswered = false;
            }

            string         sql         = "insert into t_question (ptitle,pcontent,ppic,pdate,pAnswered) values(@ptitle,@pcontent,@ppic,@pdate,@pAnswered)";
            ArrayList      insertValue = new ArrayList();
            OleDbParameter ptitle      = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);
            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);

            OleDbParameter ppic = new OleDbParameter("@ppic", OleDbType.LongVarWChar);

            ppic.Value = Pic1;
            insertValue.Add(ppic);

            OleDbParameter pdate = new OleDbParameter("@pdate", OleDbType.Date);

            pdate.Value = DateTime.Now;
            insertValue.Add(pdate);

            OleDbParameter pAnswered = new OleDbParameter("@pAnswered", OleDbType.Boolean);

            pAnswered.Value = _pAnswered;
            insertValue.Add(pAnswered);


            int p = AccessDb.ExecuteNon(sql, ref insertValue);

            JS.Alert("添加成功!");

            this.txt_title.Text = "";
            this.content2.Value = "";
        }
示例#12
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string FilePath = "";

            FilePath = File1.Value;
            if (FilePath.Length > 0)
            {
                FilePath = FileUp.meUpfile(this.File1, @"~\file\", true);
                FilePath = FilePath.Substring(FilePath.IndexOf('\\') + 1);
            }

            string title = this.txt_title.Text;

            if (title == null || title.Length <= 0)
            {
                JS.Alert("标题不能为空!");
                return;
            }
            if (title.Length >= 255)
            {
                JS.Alert("标题过长!");
                return;
            }
            string author = this.txt_author.Text;

            if (author.Length >= 255)
            {
                JS.Alert("作者名称过长!");
                return;
            }

            string strDateTime = this.txt_DateTime.Value;
            string content     = this.content2.Value;

            string         type        = UID == "news" ? "平台动态" : "标准规范";
            string         sql         = "insert into t_news (ptitle,pcontent,puser,pdate,ptype,purl) values(@ptitle,@pcontent,@puser,@pdate,@ptype,@purl)";
            ArrayList      insertValue = new ArrayList();
            OleDbParameter ptitle      = new OleDbParameter("@ptitle", OleDbType.VarChar);

            ptitle.Value = title;
            insertValue.Add(ptitle);
            OleDbParameter pcontent = new OleDbParameter("@pcontent", OleDbType.LongVarWChar);

            pcontent.Value = content;
            insertValue.Add(pcontent);
            OleDbParameter puser = new OleDbParameter("@puser", OleDbType.VarChar);

            puser.Value = author;
            insertValue.Add(puser);
            OleDbParameter pdate = new OleDbParameter("@pdate", OleDbType.VarChar);

            pdate.Value = strDateTime;
            insertValue.Add(pdate);

            OleDbParameter ptype = new OleDbParameter("@ptype", OleDbType.VarChar);

            ptype.Value = type;
            insertValue.Add(ptype);

            OleDbParameter purl = new OleDbParameter("@purl", OleDbType.LongVarWChar);

            purl.Value = FilePath;
            insertValue.Add(purl);

            int p = AccessDb.ExecuteNon(sql, ref insertValue);

            JS.Alert("添加成功!");
            this.txt_author.Text    = "";
            this.txt_title.Text     = "";
            this.content2.Value     = "";
            this.txt_DateTime.Value = DateTime.Now.ToUniversalTime().ToString();
        }
示例#13
0
        private void edit()
        {
            try
            {
                string title = this.txt_title.Text;

                if (title == null || title.Length <= 0)
                {
                    JS.Alert("资源标题不能为空!");
                    return;
                }
                if (title.Length >= 255)
                {
                    JS.Alert("资源标题过长!");
                    return;
                }
                string unit = this.txt_unit.Text;

                if (unit.Length >= 255)
                {
                    JS.Alert("资源单位过长!");
                    return;
                }
                string url = this.txt_url.Text;
                if (unit.Length >= 255)
                {
                    JS.Alert("资源地址过长!");
                    return;
                }

                string servicetype = this.txt_servicetype.Text;
                if (unit.Length >= 255)
                {
                    JS.Alert("资源服务类型过长!");
                    return;
                }
                string remark = this.txt_remark.Text;
                if (unit.Length >= 255)
                {
                    JS.Alert("资源服务简介过长!");
                    return;
                }

                string redu = this.txt_redu.Text;
                try
                {
                    int intredu = Convert.ToInt32(redu);
                }
                catch (System.Exception ex)
                {
                    JS.Alert("热度值应为数字!");
                    return;
                }
                string strDateTime = this.txt_DateTime.Value;

                string sqlEdit = "update t_service set ptitle=@stitle, unit=@sunit, surl=@surl, servicetype=@sservicetype, remark=@sremark ,setdate=@ssetdate, redu=@sredu where ID=" + UID;

                ArrayList insertValue = new ArrayList();

                OleDbParameter stitle = new OleDbParameter("@stitle", OleDbType.VarChar);
                stitle.Value = title;
                insertValue.Add(stitle);

                OleDbParameter sunit = new OleDbParameter("@sunit", OleDbType.VarChar);
                sunit.Value = unit;
                insertValue.Add(sunit);

                OleDbParameter surl = new OleDbParameter("@surl", OleDbType.VarChar);
                surl.Value = url;
                insertValue.Add(surl);

                OleDbParameter sservicetype = new OleDbParameter("@sservicetype", OleDbType.VarChar);
                sservicetype.Value = servicetype;
                insertValue.Add(sservicetype);

                OleDbParameter sremark = new OleDbParameter("@sremark", OleDbType.VarChar);
                sremark.Value = remark;
                insertValue.Add(sremark);


                OleDbParameter ssetdate = new OleDbParameter("@ssetdate", OleDbType.VarChar);
                ssetdate.Value = strDateTime;
                insertValue.Add(ssetdate);

                OleDbParameter sredu = new OleDbParameter("@sredu", OleDbType.Integer);
                sredu.Value = redu;
                insertValue.Add(sredu);



                int p = AccessDb.ExecuteNon(sqlEdit, ref insertValue);
                JS.Alert("修改成功!");
            }
            catch (System.Exception ex)
            {
                JS.Alert("修改失败!错误信息:" + ex.Message);
            }
        }