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);
        }
Пример #2
0
        public itemsTableGridForm(int idT1, int?goToObject = null, bool isSelected = false, int?callerTableId = null, int?callerObjectId = null, bool setOwner = true)
        {
            InitializeComponent();

            //Rekod.Services.ServiceClass.ActivateOwnerOnClose(this);
            if (setOwner)
            {
                classesOfMetods.SetFormOwner(this);
            }

            tablesInfo table = classesOfMetods.getTableInfo(idT1);

            this.UControl = Plugins.GetControl(goToObject, isSelected, table, this, callerTableId, callerObjectId);
            if (UControl != null)
            {
                UControl.CloseForm += (o, e) =>
                {
                    if (isSelected)
                    {
                        object pk = UControl.ViewModel.GetType().GetProperty("CurrentPK").GetValue(UControl.ViewModel, null);
                        if (pk != null && int.TryParse(pk.ToString(), out _idObj))
                        {
                            DialogResult = System.Windows.Forms.DialogResult.OK;
                        }
                    }
                    s_CloseForm(o, e);
                };
                var uc = UControl.GetUserControl();
                uc.Dock   = DockStyle.Fill;
                this.Text = UControl.Title;
                this.Controls.Add(uc);
            }
            else
            {
                this.control = new UcTableObjects(table, goToObject, isSelected: isSelected);
                this.Controls.Add(control);
                this.Text = string.Format(Rekod.Properties.Resources.ITGF_DataTable + " \"{0}\"", table.nameMap);
            }
        }