Exemplo n.º 1
0
 /// <summary>
 /// Tipo de dato del campo.
 /// </summary>
 /// <param name="name">Nombre del campo por defecto.(En textbox)</param>
 /// <param name="searchCategoryName">Nombre de categoria del campo para busqueda.</param>
 /// <param name="searchName">Nombre del campo para busqueda.</param>
 /// <param name="bName">Nombre del campo para Bogus.</param>
 /// <param name="bCategoryName">Categoria del campo para Bogus.</param>
 /// <param name="example">Ejemplo para mostrar en la lista de seleccion.</param>
 /// <param name="columnType">Ejemplo para mostrar en la lista de seleccion.</param>
 public FieldType(
     string name,
     string columnType,
     EFieldName searchName,
     ECategory searchCategoryName = ECategory.Basico,
     EBCategory bCategoryName     = EBCategory.Basico,
     EBFieldType bName            = EBFieldType.id,
     string example = "Null")
 {
     ColumName          = name;
     ColumnType         = columnType;
     SearchName         = searchName;
     SearchCategoryName = searchCategoryName;
     BName         = bName;
     BCategoryName = bCategoryName;
     Example       = example;
 }
Exemplo n.º 2
0
        public OptionsNumberType(EBCategory ebcat, EBFieldType ebfld)
        {
            EBCat = ebcat;
            EBFld = ebfld;

            if (EBFld == EBFieldType.Number)
            {
                Label lblMin = new Label_("Min");
                TBMin = new TextBox {
                    Width = 70, Text = "1", MaxLength = 20
                };
                Label lblMax = new Label_("Max");
                TBMax = new TextBox {
                    Width = 70, Text = "100", MaxLength = 20
                };
                Label lblDec = new Label_("Decimales");
                TBDec = new TextBox {
                    Width = 20, Text = "0", MaxLength = 1
                };

                panelControls.InsertRange(0, new Control[] { lblMin, TBMin, lblMax, TBMax, lblDec, TBDec });
            }
        }
Exemplo n.º 3
0
 public BaseOptionsType(EBCategory ebcat, EBFieldType ebfld)
 {
     panelControls.AddRange(new Control[] { lblBlanks, NullsCount, lblPrcnt });
     EBCat = ebcat;
     EBFld = ebfld;
 }
Exemplo n.º 4
0
        public FieldPanel(FlowLayoutPanel parent, FieldType fType, string fName = "")
        {
            MainView mainview = parent.Parent as MainView;

            Size        = new Size(parent.Width - 10, 50);
            BorderStyle = BorderStyle.FixedSingle;
            Padding     = new Padding(4);
            BackColor   = Color.Gainsboro;
            Cursor      = Cursors.Hand;

            Panel ConstantPanel = new Panel
            {
                MaximumSize = new Size(370, 42),
                MinimumSize = new Size(370, 0),
                Dock        = DockStyle.Left,
                Padding     = new Padding(0),
                Cursor      = Cursors.Hand,
            };

            FieldType     = fType;
            FieldCategory = fType.BCategoryName;


            ResourceManager resources = Resources.ResourceManager;

            //Texbox de nombre del campo.
            TBFieldName = new TextBox
            {
                Width    = 170,
                Location = new Point(10, 9),
            };

            //En caso de que se modifique el tipo de campo, conservar el
            //nombre que tenia anteriormente.
            if (fName != "")
            {
                FieldName = fName;
            }
            else
            {
                FieldName = fType.ColumName.ToLower();
            }

            //Boton para seleccionar el tipo de campo.
            SelectType = new Button
            {
                Cursor     = Cursors.Hand,
                Location   = new Point(211, 8),
                Text       = fType.SearchName.ToString(),
                TextAlign  = ContentAlignment.MiddleLeft,
                Image      = (Bitmap)resources.GetObject("Open Folder_50px"),
                ImageAlign = ContentAlignment.MiddleRight,
                Size       = new Size(140, 23),
                FlatStyle  = FlatStyle.Flat,
                BackColor  = Color.White,
            };

            //Añadir evento de cambiar tipo de campo.
            SelectType.Click += new EventHandler(mainview.ChangeField);
            ConstantPanel.Controls.AddRange(new Control[] { TBFieldName, SelectType });

            //Panel de opciones del campo.
            OptionsPanel = new OptionsPanel(FieldType);

            //Añadir evento para que se seleccione el campo
            ConstantPanel.Click += new EventHandler((object o, EventArgs e) => OnClick(e));
            OptionsPanel.Click  += new EventHandler((object o, EventArgs e) => OnClick(e));

            //Boton de elimiar el campo.
            RemoveSelf = new PictureBox
            {
                Cursor = Cursors.Hand,
                Width  = 40,
                Height = 40,
                Anchor = AnchorStyles.Right,
                BackgroundImageLayout = ImageLayout.Zoom,
                BackgroundImage       = (Bitmap)resources.GetObject("Cancel_48px"),
                Margin   = new Padding(5),
                Location = new Point(parent.Width - 53, 5),
                Dock     = DockStyle.Right,
            };

            RemoveSelf.Click += new EventHandler((object o, EventArgs e) => { (parent.Parent as MainView).RemoveField(this, e); });

            Controls.AddRange(new Control[] { OptionsPanel, RemoveSelf, ConstantPanel, });
        }