Esempio n. 1
0
        public PaintObject <string, OracleParameter> CreatePaintObject(string storeName, Color connectorColor)
        {
            using (var ctrlSA = new SAController())
            {
                DataContainer container;

                ctrlSA.ExecuteSQL(out container, "SELECT * FROM USER_ARGUMENTS WHERE OBJECT_NAME = '" + storeName + "' ORDER BY POSITION");

                var table = container.DataTable;

                var oracleParams = (from DataRow row in table.Rows
                                    select new OracleParameter
                {
                    ParameterName = (string)row["ARGUMENT_NAME"],
                    ParameterType = (OracleParameterType)Enum.Parse(typeof(OracleParameterType), (string)row["IN_OUT"])
                }).ToList();

                var storePaintObject = new PaintObject <string, OracleParameter>
                {
                    Title          = storeName,
                    Parent         = storeName,
                    Childs         = (from oracleParam in oracleParams select oracleParam).ToList(),
                    Icon           = Resources.Database,
                    BeginEnd       = BeginEndMode.Begin,
                    ConnectorColor = connectorColor
                };

                storePaintObject.CustomLabel += storePaintObject_CustomLabel;
                return(storePaintObject);
            }
        }
Esempio n. 2
0
        private void cboTablesName_SelectedValueChanged(object sender, EventArgs e)
        {
            using (var ctrlSA = new SAController())
            {
                var tableName = (string)cboTablesName.EditValue;
                reMain.EndPaintObjects.Clear();
                DataContainer container;
                ctrlSA.ExecuteSQL(out container, "SELECT * FROM USER_TAB_COLS WHERE TABLE_NAME = '" + tableName + "' ORDER BY COLUMN_ID");

                var table            = container.DataTable;
                var tablePaintObject = new PaintObject <string, ColumnInfo>
                {
                    BeginEnd = BeginEndMode.End,
                    Childs   = (from DataRow row in table.Rows
                                select new ColumnInfo
                    {
                        ColumnType = ColumnType.COLUMN,
                        ColumnName = (string)row["COLUMN_NAME"]
                    }).ToList(),
                    ConnectorColor = Color.Red,
                    Icon           = Resources.Database,
                    Parent         = tableName,
                    Title          = tableName
                };

                tablePaintObject.CustomLabel += tablePaintObject_CustomLabel;
                reMain.EndPaintObjects.Add(tablePaintObject);
            }
        }
Esempio n. 3
0
 static void storePaintObject_CustomLabel(object sender, PaintObject <string, OracleParameter> .CustomLabelEventArgs e)
 {
     e.Text = e.Child.GetLabel();
     if (e.Text.StartsWith("(SYS)") || e.Text.StartsWith("(OUT)"))
     {
         e.ForeColor = Color.DarkGray;
     }
     else if (e.Text.StartsWith("(NEW)"))
     {
         e.ForeColor = Color.Blue;
     }
 }
Esempio n. 4
0
 static void tablePaintObject_CustomLabel(object sender, PaintObject <string, ColumnInfo> .CustomLabelEventArgs e)
 {
     e.Text = "(" + e.Child.ColumnType + ")" + e.Child.ColumnName;
     if (e.Child.ColumnType == ColumnType.FILTER || e.Child.ColumnType == ColumnType.FILTERVAL)
     {
         e.ForeColor = Color.Red;
     }
     else if (e.Child.ColumnType == ColumnType.VALUE)
     {
         e.ForeColor = Color.Blue;
     }
 }
Esempio n. 5
0
        public PaintObject <ModuleInfo, ModuleFieldInfo> CreatePaintObject(string title, List <ModuleFieldInfo> fields, ModuleInfo module)
        {
            var modulePaintObject = new PaintObject <ModuleInfo, ModuleFieldInfo>
            {
                Title  = title,
                Parent = module,
                Childs = (from field in fields
                          where field.ControlType != CODES.DEFMODFLD.CTRLTYPE.DEFINEDGROUP
                          select field).ToList(),
                Icon           = Resources.Form,
                BeginEnd       = BeginEndMode.Begin,
                ConnectorColor = Color.Black
            };

            modulePaintObject.CustomLabel += modulePaintObject_CustomLabel;
            return(modulePaintObject);
        }
Esempio n. 6
0
        static void modulePaintObject_CustomLabel(object sender, PaintObject <ModuleInfo, ModuleFieldInfo> .CustomLabelEventArgs e)
        {
            if (e.Parent.SubModule == CODES.DEFMOD.SUBMOD.MAINTAIN_EDIT)
            {
                e.Text = string.Format("({0}){1}", e.Child.ReadOnlyOnEdit, e.Child.FieldName);
            }
            else if (e.Parent.SubModule == CODES.DEFMOD.SUBMOD.MAINTAIN_ADD)
            {
                e.Text = string.Format("({0}){1}", e.Child.ReadOnlyOnAdd, e.Child.FieldName);
            }
            else if (e.Parent.SubModule == CODES.DEFMOD.SUBMOD.MAINTAIN_VIEW)
            {
                e.Text = string.Format("({0}){1}", e.Child.ReadOnlyOnView, e.Child.FieldName);
            }
            else
            {
                e.Text = string.Format("(RO){0}", e.Child.FieldName);
            }

            if (e.Text.StartsWith("(RO)"))
            {
                e.ForeColor = Color.Red;
            }
        }