示例#1
0
        public axVisUtils.Styles.objStyleSymbol createSymbol()
        {
            objStyleSymbol s1 = new objStyleSymbol();

            if (comboBox2.SelectedItem != null)
            {
                s1.Shape = Convert.ToUInt32(char.Parse(comboBox2.SelectedItem.ToString()));
            }
            return(s1);
        }
        public void saveStyle(Rekod.DBTablesEdit.StyleControl sc)
        {
            objStyleBrush  brush1  = sc.createBrush();
            objStyleFont   font1   = sc.createFont();
            objStylePen    pen1    = sc.createPen();
            objStyleSymbol symb1   = sc.createSymbol();
            string         bgColor = "";

            if (sc.checkBox1.Enabled && !sc.checkBox1.Checked)
            {
                bgColor = "4294967295";
            }
            else
            {
                bgColor = brush1.bgColor.ToString();
            }
            SqlWork sqlCmd = new SqlWork();

            sqlCmd.sql = "UPDATE " + Program.scheme + ".table_info SET fontname = '" + font1.FontName + "', " +
                         "fontcolor = " + font1.Color.ToString() + ", " +
                         "fontframecolor = " + font1.FrameColor.ToString() + ", " +
                         "fontsize = " + font1.Size.ToString() + ", " +
                         "symbol = " + symb1.Shape.ToString() + ", " +
                         "pencolor = " + pen1.Color.ToString() + ", " +
                         "pentype = " + pen1.Type.ToString() + ", " +
                         "penwidth = " + pen1.Width.ToString() + ", " +
                         "brushbgcolor = " + bgColor + ", " +
                         "brushfgcolor = " + brush1.fgColor.ToString() + ", " +
                         "brushstyle = " + brush1.Style.ToString() + ", " +
                         "brushhatch = " + brush1.Hatch.ToString() + " WHERE id = " + id.ToString();
            sqlCmd.Execute(true);
            sqlCmd.Close();
            sqlCmd     = new SqlWork();
            sqlCmd.sql = "UPDATE " + Program.scheme + ".table_info SET default_style = true WHERE id = " + id.ToString();
            sqlCmd.Execute(true);
            sqlCmd.Close();

            DBTablesEdit.SyncController.ReloadStyle(id);
        }