Exemple #1
0
        public void openDefault()
        {
            templateCreateForm cf = new templateCreateForm();

            if (cf.ShowDialog() == DialogResult.OK)
            {
                name        = cf.textBox1.Text;
                description = cf.textBox2.Text;
                this.setDocNameDesp();
                loadDefault();
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     connectString = "";
     type = 0;
     templateCreateForm cf = new templateCreateForm();
     if (cf.ShowDialog() == DialogResult.OK)
     {
         tname = cf.textBox1.Text;
         tdescription = cf.textBox2.Text;
         this.Close();
     }
 }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            connectString = "";
            type          = 0;
            templateCreateForm cf = new templateCreateForm();

            if (cf.ShowDialog() == DialogResult.OK)
            {
                tname        = cf.textBox1.Text;
                tdescription = cf.textBox2.Text;
                this.Close();
            }
        }
Exemple #4
0
        public void saveToDB()
        {
            templateCreateForm tcf = new templateCreateForm();

            tcf.textBox1.Text = this.name;
            tcf.textBox2.Text = this.description;
            if (tcf.ShowDialog() != DialogResult.OK)
            {
                return;
            }


            IfacesEnumsStructsClasses.IHTMLDocument2 doc = pform.cEXWB1.GetActiveDocument();
            IfacesEnumsStructsClasses.IHTMLElement   bd  = (IfacesEnumsStructsClasses.IHTMLElement)doc.body;
            this.name        = tcf.textBox1.Text;
            this.description = tcf.textBox2.Text;

            pform.Text = "模版:" + name;

            /*  object o = bd.getAttribute("tname", 1);
             * if (o != null && !o.ToString().Equals(""))
             *    name = o.ToString();
             *
             *
             * o = bd.getAttribute("tdescription", 1);
             * if (o != null && !o.ToString().Equals(""))
             *    description = o.ToString();
             *
             *
             * o = bd.getAttribute("ID", 1);
             * if (o != null && !o.ToString().Equals(""))
             *    ID = o.ToString();*/

            this.setDocNameDesp();


            string s = doc.body.outerHTML;

            //   Encoding ec = Encoding.GetEncoding("gb2312");
            //   s ="<html>"  + ec.GetString(System.Text.Encoding.Default.GetBytes(s)) + "</html>";
            s = "<html>" + s + "</html>";

            if (dbTools.dbTool.saveTemplate(name, s, description, ""))
            {
                MessageBox.Show("数据存储成功");
            }
            else
            {
                MessageBox.Show("数据存储失败");
            }
        }
Exemple #5
0
        public void setTemplate()
        {
            templateCreateForm tcf = new templateCreateForm();

            tcf.textBox1.Text = this.name;
            tcf.textBox2.Text = this.description;
            if (tcf.ShowDialog() != DialogResult.OK)
            {
                return;
            }



            this.name        = tcf.textBox1.Text;
            this.description = tcf.textBox2.Text;



            this.setDocNameDesp();
        }
        public void setTemplate()
        {
            templateCreateForm tcf = new templateCreateForm();
            tcf.textBox1.Text = this.name;
            tcf.textBox2.Text = this.description;
            if (tcf.ShowDialog() != DialogResult.OK)
                return;

            this.name = tcf.textBox1.Text;
            this.description = tcf.textBox2.Text;

            this.setDocNameDesp();
        }
        public void saveToDB()
        {
            /* SaveForm save = new SaveForm();
            if (save.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }*/
            templateCreateForm tcf = new templateCreateForm();
            tcf.textBox1.Text = this.name;
            tcf.textBox2.Text = this.description;
            if (tcf.ShowDialog() != DialogResult.OK)
                return;

            IfacesEnumsStructsClasses.IHTMLDocument2 doc = pform.cEXWB1.GetActiveDocument();
            IfacesEnumsStructsClasses.IHTMLElement bd = (IfacesEnumsStructsClasses.IHTMLElement)doc.body;
            this.name = tcf.textBox1.Text;
            this.description = tcf.textBox2.Text;

            pform.Text = "模版:" + name;
              /*  object o = bd.getAttribute("tname", 1);
            if (o != null && !o.ToString().Equals(""))
                name = o.ToString();

            o = bd.getAttribute("tdescription", 1);
            if (o != null && !o.ToString().Equals(""))
                description = o.ToString();

            o = bd.getAttribute("ID", 1);
            if (o != null && !o.ToString().Equals(""))
                ID = o.ToString();*/

            this.setDocNameDesp();

            string s =    doc.body.outerHTML  ;

            //Encoding ec = Encoding.GetEncoding("gb2312");
               // s ="<html>"  + ec.GetString(System.Text.Encoding.Default.GetBytes(s)) + "</html>";
            s = "<html>" + s;
            /*if (save.time.Text == "")
            {
                s = s + "<endtime> template </endtime>";
            }
            else
            {
                s = s + save.time.Text;
            }
            if (save.Expert.Text == "")
            {
                s = s + "<expert> template </expert>";
            }else
            {
                s = s + save.Expert.Text;
            }*/
            /*foreach (var key in s)
            {

            }*/
            s = s +"</html>";

            if (dbTools.dbTool.saveTemplate(name, s, description, ""))
                MessageBox.Show("数据存储成功");
            else MessageBox.Show("数据存储失败");
        }
 public void openDefault()
 {
     templateCreateForm cf = new templateCreateForm();
     if (cf.ShowDialog() == DialogResult.OK)
     {
         name = cf.textBox1.Text;
         description = cf.textBox2.Text;
         this.setDocNameDesp();
         loadDefault();
     }
 }
Exemple #9
0
        public void saveToDB()
        {
            /* SaveForm save = new SaveForm();
             * if (save.ShowDialog() != System.Windows.Forms.DialogResult.OK)
             * {
             *   return;
             * }*/
            templateCreateForm tcf = new templateCreateForm();

            tcf.textBox1.Text = this.name;
            tcf.textBox2.Text = this.description;
            tcf.templatetype.SelectedIndex = templateBase.getSelectedIndex(this.type);

            if (tcf.ShowDialog() != DialogResult.OK)
            {
                return;
            }


            IfacesEnumsStructsClasses.IHTMLDocument2 doc = pform.cEXWB1.GetActiveDocument();
            IfacesEnumsStructsClasses.IHTMLElement   bd  = (IfacesEnumsStructsClasses.IHTMLElement)doc.body;
            this.name        = tcf.textBox1.Text;
            this.description = tcf.textBox2.Text;
            this.type        = tcf.typeStr;

            pform.Text = "模版:" + name;

            /*  object o = bd.getAttribute("tname", 1);
             * if (o != null && !o.ToString().Equals(""))
             *    name = o.ToString();
             *
             *
             * o = bd.getAttribute("tdescription", 1);
             * if (o != null && !o.ToString().Equals(""))
             *    description = o.ToString();
             *
             *
             * o = bd.getAttribute("ID", 1);
             * if (o != null && !o.ToString().Equals(""))
             *    ID = o.ToString();*/
            this.setDocNameDesp();
            //bd.setAttribute("tname", name, 1);
            //bd.setAttribute("tdescription", description, 1);
            //bd.setAttribute("ID", ID, 1);
            //pform.Text = "模版:" + name;


            string s = doc.body.outerHTML;

            //Encoding ec = Encoding.GetEncoding("gb2312");
            // s ="<html>"  + ec.GetString(System.Text.Encoding.Default.GetBytes(s)) + "</html>";
            s = "<html>" + s;

            /*if (save.time.Text == "")
             * {
             *  s = s + "<endtime> template </endtime>";
             * }
             * else
             * {
             *  s = s + save.time.Text;
             * }
             * if (save.Expert.Text == "")
             * {
             *  s = s + "<expert> template </expert>";
             * }else
             * {
             *  s = s + save.Expert.Text;
             * }*/
            /*foreach (var key in s)
             * {
             *
             * }*/
            s = s + "</html>";

            if (dbTools.dbTool.saveTemplate(name, s, description, type, "1"))
            {
                MessageBox.Show("数据存储成功");
            }
            else
            {
                MessageBox.Show("数据存储失败");
            }
        }