private void button3_Click(object sender, EventArgs e) { parent.CloseElemsAfter(this, false); tablesInfo tInfo = classesOfMetods.getTableInfo(id); Rekod.DBTablesEdit.GeomType gType = DBTablesEdit.GeomType.point; if (tInfo.GeomType_GC.ToUpper().Contains("LINESTRING")) { gType = DBTablesEdit.GeomType.line; } else if (tInfo.GeomType_GC.ToUpper().Contains("POLYGON")) { gType = DBTablesEdit.GeomType.polygon; } Rekod.DBTablesEdit.StyleControl cs = new Rekod.DBTablesEdit.StyleControl(parent, this, gType, DBTablesEdit.SyncController.HasRight(id)); cs.setStyles(setStyleFromDB(id)); parent.AddNewElemModal(cs, Rekod.Properties.Resources.PTC_Styles); }
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); }