Ejemplo n.º 1
0
        public void TestDiscarding()
        {
            using (var dl = new DisposableList())
            {
                var table = new TableWrapper(TestHelpers.GenUnique(TestConfig.TableName), TestConfig.PrimaryStorageAccount, true);
                dl.Add(table.Delete);

                var entity1 = TestHelpers.CreateStarEntity();
                var entity2 = TestHelpers.CreateStarEntity();
                entity2.Version++;
                entity2.Name = "Entity Version 2 name";
                var entity3 = TestHelpers.CreateStarEntity();
                entity3.Name = "Entity Version 3 name";

                TargetTable  ttable = new TargetTable(table);
                XTableResult result;
                StarEntity   rentity;

                result = ttable.Write(TableConvert.ToDynamicTableEntity(entity1));
                Assert.IsFalse(result.Discarded);
                rentity = table.ReadEntity <StarEntity>(entity3.PartitionKey, entity3.RowKey);
                TestHelpers.AssertEqualStars(entity1, rentity);

                result = ttable.Write(TableConvert.ToDynamicTableEntity(entity2));
                Assert.IsFalse(result.Discarded);
                rentity = table.ReadEntity <StarEntity>(entity3.PartitionKey, entity3.RowKey);
                TestHelpers.AssertEqualStars(entity2, rentity);

                result = ttable.Write(TableConvert.ToDynamicTableEntity(entity3));
                Assert.IsTrue(result.Discarded);
                rentity = table.ReadEntity <StarEntity>(entity3.PartitionKey, entity3.RowKey);
                TestHelpers.AssertEqualStars(entity2, rentity);
            }
        }
Ejemplo n.º 2
0
        public void CreateTable(ConnectionParams cp)
        {
            try
            {
                _initializing         = true;
                this.ConnectionParams = cp;
                TableObj = new TableWrapper();

                //This is a fake column. We need to hack some unknown behaviour of the grid
                ColumnWrapper col = new ColumnWrapper();
                col.Name       = "Column";
                col.DataType   = "nchar";
                col.Width      = "10";
                col.AllowNulls = true;
                col.CollectInitialValues();

                TableObj.Columns.Add(col);

                cmbOwner.SelectedIndex = cmbOwner.FindStringExact("dbo");

                BindTableColumns();
                Mode = EditMode.New;

                RenderAdditionalColumnProperties(bsCols.Current as ColumnWrapper);
                ValidateColumns(ColumnValidationType.All);
            }
            finally
            {
                _initializing = false;
            }
        }
Ejemplo n.º 3
0
        public void ImportListTest_UnequalColumns()
        {
            _TestSingleTon.Instance._SetupForLayoutPanelTests();
            Form             form  = new Form();
            FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false);

            form.Controls.Add(panel);

            // needed else DataGrid does not initialize

            form.Show();
            form.Visible = false;

            //NOTE: For now remember that htis ADDS 1 Extra notes
            panel.NewLayout("mynewpanel", true, null);
            NoteDataXML_Table test = new NoteDataXML_Table(425, 380);

            test.GuidForNote = "thisguid1";
            test.Caption     = "note1";
            panel.SaveLayout();

            string[] newData = new string[3] {
                "1,col2,col3", "2,col2,col3", "3,col2,col3"
            };

            TableWrapper.ImportList(newData, (DataTable)test.dataSource);
            panel.SaveLayout();
            List <string> values = test.GetValuesForColumn(1, "*");

            Assert.AreEqual(3, values.Count);
            Assert.AreEqual("1,col2,col3", values[0]);
            form.Dispose();
        }
Ejemplo n.º 4
0
        public void InitializePrimaryKeys(TableKeyEditorMode mode, bool loadProps, TableWrapper initialTable)
        {
            try
            {
                _initializing = true;
                Mode          = mode;
                DbCmd.PopulatePrimaryKeysCombo(cmbPk, _cp, loadProps, (initialTable != null ? initialTable.ID : -1));
                _initialTable = initialTable;

                DbCmd.PopulateUserDefinedTablesCombo(cmbTables, _cp, (initialTable != null ? initialTable.ID : -1));
            }
            finally
            {
                _initializing = false;
            }

            if (cmbPk.Items.Count > 0)
            {
                cmbPk.SelectedIndex = 0;
            }
            else
            {
                CreateNewKey();
            }
        }
Ejemplo n.º 5
0
        private void PopulateHostColumnsCombo( )
        {
            _tblCols.Clear();
            colHostColumns.DataSource = null;
            _tblHostCols.Clear();

            TableWrapper hostTable = cmbHostTables.SelectedItem as TableWrapper;

            if (hostTable == null)
            {
                return;
            }

            DataRow   row = null;
            DataTable tbl = DbCmd.GetColumnsSimple(_cp, hostTable.NormalizedFullName);

            foreach (DataRow colRow in tbl.Rows)
            {
                row            = _tblHostCols.NewRow();
                row["colName"] = colRow["colName"];
                _tblHostCols.Rows.Add(row);
            }

            colHostColumns.DataSource    = _tblHostCols;
            colHostColumns.DisplayMember = "colName";
            colHostColumns.ValueMember   = "colName";
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Constructor
        /// </summary>
        public TableKeyBase(ConnectionParams cp)
        {
            ConnectionParams = cp;

            _table = new TableWrapper();
            _table.ConnectionParams = cp;
        }
Ejemplo n.º 7
0
        private void cmbTables_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (_initializing || SelectedKey == null)
            {
                return;
            }

            TableWrapper selTable = cmbTables.SelectedItem as TableWrapper;

            if (selTable == null)
            {
                SelectedKey.Table = selTable;
                return;
            }

            TableWrapper tbl = new TableWrapper();

            tbl.ConnectionParams = _cp;
            tbl.ID = selTable.ID;
            tbl.LoadProperties();
            tbl.LoadColumns();
            SelectedKey.Table = tbl;


            lbPkCols.Items.Clear();
            SelectedKey.Columns.Clear();
            InitializeTableColumns();
        }
Ejemplo n.º 8
0
        public void RefreshPrimaryKeys(bool loadProps, TableWrapper initialTable)
        {
            string keyName = String.Empty;

            try
            {
                _initializing = true;
                keyName       = SelectedKey != null?SelectedKey.ToString() : String.Empty;

                DbCmd.PopulatePrimaryKeysCombo(cmbPk, _cp, loadProps, (initialTable != null ? initialTable.ID : -1));
                _initialTable = initialTable;

                DbCmd.PopulateUserDefinedTablesCombo(cmbTables, _cp, (initialTable != null ? initialTable.ID : -1));
            }
            finally
            {
                _initializing = false;
            }

            if (cmbPk.Items.Count > 0)
            {
                cmbPk.SelectedIndex = cmbPk.FindStringExact(keyName);
                if (cmbPk.SelectedIndex < 0)
                {
                    cmbPk.SelectedIndex = 0;
                }
            }
            else
            {
                CreateNewKey();
            }
        }
Ejemplo n.º 9
0
        public void TestETagViolation409()
        {
            using (var dl = new DisposableList())
            {
                var table = new TableWrapper(TestHelpers.GenUnique(TestConfig.TableName), TestConfig.PrimaryStorageAccount, true);
                dl.Add(table.Delete);

                var entity1 = TestHelpers.CreateStarEntity();
                entity1.Version = 1;
                var entity2 = TestHelpers.CreateStarEntity();
                entity2.Version = 2;
                entity2.Name    = "Entity Version 2 name";

                TargetTable  ttable = new TargetTable(table);
                XTableResult result;

                int retryAttempt = 0;
                result = ttable.Write(
                    TableConvert.ToDynamicTableEntity(entity1),
                    () => {
                    if (retryAttempt++ == 0)
                    {
                        result = ttable.Write(TableConvert.ToDynamicTableEntity(entity2));
                        Assert.AreEqual(false, result.Discarded);
                    }
                }
                    );
                Assert.AreEqual(true, result.Discarded);

                var rentity = table.ReadEntity <StarEntity>(entity1.PartitionKey, entity1.RowKey);
                TestHelpers.AssertEqualStars(entity2, rentity);
            }
        }
Ejemplo n.º 10
0
        private void PopulateColumns( )
        {
            _tblCols.Clear();
            TableWrapper      hostTable    = cmbRefTables.SelectedItem as TableWrapper;
            NameIdPair        pkConstraint = cmbRefPk.SelectedItem as NameIdPair;
            ForeignKeyWrapper fk           = cmbFk.SelectedItem as ForeignKeyWrapper;


            if (hostTable == null || pkConstraint == null || fk == null)
            {
                return;
            }

            DataTable tbl    = DbCmd.GetColumnsByForeignKey(_cp, hostTable.ID, pkConstraint.Id);
            DataRow   newRow = null;

            foreach (DataRow row in tbl.Rows)
            {
                newRow            = _tblCols.NewRow();
                newRow["refCol"]  = row["colName"];
                newRow["hostCol"] = fk.GetColumns((string)row["colName"]);
                _tblCols.Rows.Add(newRow);
            }
            bsCols.DataSource = _tblCols;
        }
Ejemplo n.º 11
0
 private void OnUpdateTableExecute(TableWrapper table)
 {
     if (table == null)
     {
         return;
     }
     _tableDetailViewModel.Open(table.Model, _offices);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// will import a listof entries into the table
        ///
        /// December 2008.
        ///
        /// Changing this to be csv format
        ///    r1c1, r1c2, r1c3
        ///    r2c1, r2c2, r2c3
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ImportListClick(object sender, EventArgs e)
        {
            TablePanel_Form_ImportList fList = new TablePanel_Form_ImportList();

            if (fList.ShowDialog() == DialogResult.OK)
            {
                TableWrapper.ImportList(fList.textList.Lines, (DataTable)dataGrid1.DataSource);
            }
        }
Ejemplo n.º 13
0
        public SqlLiteRepository(SqlLiteContext context)
        {
            _context = context;

            Images    = new TableWrapper <Image>(context, c => c.Images);
            Ratings   = new TableWrapper <Rating>(context, c => c.Ratings);
            Tags      = new TableWrapper <Tag>(context, c => c.Tags);
            ImageTags = new TableWrapper <ImageTag>(context, c => c.ImageTags);
        }
Ejemplo n.º 14
0
 public void ResetEditor( )
 {
     _hostTable = null;
     cmbFk.Items.Clear();
     cmbHostTables.Items.Clear();
     cmbRefTables.Items.Clear();
     cmbRefPk.Items.Clear();
     ClearKeyPropertyControls();
 }
Ejemplo n.º 15
0
        public override void Run( )
        {
            base.Run();
            IObjectExplorerService srv = HostServicesSingleton.HostServices.ObjectExplorerService;

            if (srv == null)
            {
                MessageService.ShowError("No object explorer available!");
                return;
            }

            if (srv.SelNode == null || srv.SelNode.ConnParams == null || String.IsNullOrEmpty(srv.SelNode.ConnParams.Database))
            {
                MessageService.ShowError("Database data is not available!");
                return;
            }

            if (srv.SelNode.Type != DBObjectType.UserTable)
            {
                MessageService.ShowError("Selected node is not a user defined table!");
                return;
            }


            ConnectionParams cp = srv.SelNode.ConnParams.CreateCopy();

            cp.Database = srv.SelNode.DatabaseName;

            TableWrapper tbl = new TableWrapper(cp);

            tbl.ID = srv.SelNode.id;
            tbl.LoadProperties();
            //tbl.Name = srv.SelNode.Name;

            string newName = srv.SelNode.Name;

            if (InputDialog.ShowDialog("Rename Table", "New Name", ref newName) != DialogResult.OK)
            {
                return;
            }

            if (tbl.Name.ToLowerInvariant() == newName.ToLowerInvariant())
            {
                return;
            }

            try
            {
                tbl.Rename(newName);
                srv.ChangeObjectName(srv.SelNode.Node, newName);
                srv.LoadNodeData(srv.SelNode.Node, true);
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
        }
Ejemplo n.º 16
0
        public SourceTable(TableWrapper table, IGatewayWriter gateQueueWriter, string gatewayKey)
            : base(table)
        {
            Guard.NotNull(gateQueueWriter, "gateQueueWriter");
            Guard.NotNullOrEmpty(gatewayKey, "gatewayKey");

            _gateQueueWriter = gateQueueWriter;
            _gatewayKey      = gatewayKey;
        }
        /* (non-Javadoc)
         * @see com.itextpdf.html2pdf.attach.ITagWorker#getElementResult()
         */
        public virtual IPropertyContainer GetElementResult()
        {
            TableWrapper tableWrapper = new TableWrapper();

            foreach (Cell cell in rowWrapper.GetCells())
            {
                tableWrapper.AddCell(cell);
            }
            return(tableWrapper.ToTable(null));
        }
        /* (non-Javadoc)
         * @see com.itextpdf.html2pdf.attach.ITagWorker#getElementResult()
         */
        public virtual IPropertyContainer GetElementResult()
        {
            TableWrapper tableWrapper = new TableWrapper();

            foreach (Cell cell in rowWrapper.GetCells())
            {
                AccessiblePropHelper.TrySetLangAttribute(cell, lang);
                tableWrapper.AddCell(cell);
            }
            return(tableWrapper.ToTable(null));
        }
Ejemplo n.º 19
0
 // Constructors
 public PCSDetail()
 {
     lObj = new TableWrapper("PackD");
     Distributor = new Address(
         lObj.Fields["DAd1"],
         lObj.Fields["DAd2"],
         lObj.Fields["DCity"],
         lObj.Fields["DState"],
         lObj.Fields["DZip"],
         lObj.Fields["DName"]
     );
 }
Ejemplo n.º 20
0
        public void BulkOfEntitiesConsistent()
        {
            using (var dl = new DisposableList())
            {
                // create the source table
                var sourceTableWrapper = new TableWrapper(TestHelpers.GenUnique(TestConfig.TableName), TestConfig.PrimaryStorageAccount, true);
                dl.Add(sourceTableWrapper.Delete);

                // initialize the target table and attach it to the disposable container
                var targetTable = new TableWrapper(TestHelpers.GenUnique(TestConfig.TableName), TestConfig.SecondaryStorageAccount, true);
                dl.Add(targetTable.Delete);
                var tableParamsResolver = new InMemoryTargetTableResolver();
                tableParamsResolver.Add(TestHelpers.TableKey, targetTable);

                // create gateway blob storage
                var gateBlob = new InMemoryGatewayBlobStore();

                // create a gateway queue
                var gateQueue       = new QueueWrapper(TestHelpers.GenUnique("gateq"), TestConfig.GatewayStorageAccount);
                var gateQueueWriter = new GatewayQueueWriter(gateQueue, gateBlob);

                var sourceTable = new SourceTable <StarEntity>(sourceTableWrapper, gateQueueWriter, TestHelpers.TableKey);

                // 100 entities to satisfy TableStorage's batch requirements
                var entities = TestHelpers.CreateStarEntities(100);

                sourceTable.Write(entities);

                // Now verify that the entities were synced to the secondary table storage
                TableGatewayQueueProcessor gateQueueProcessor = new TableGatewayQueueProcessor(
                    new GatewayQueueReader(gateQueue, gateBlob),
                    tableParamsResolver
                    );

                bool result = gateQueueProcessor.ProcessNext();

                Assert.IsTrue(result);

                var targetEntities = targetTable.ReadEntities <StarEntity>()
                                     .ToList();
                Assert.AreEqual(entities.Count, targetEntities.Count);
                foreach (var entity in entities)
                {
                    TestHelpers.AssertEqualStars(
                        entity,
                        targetEntities.First(x => x.RowKey == entity.RowKey)
                        );
                }
            }
        }
Ejemplo n.º 21
0
 protected void OnLayerChanged(EventArgs e)
 {
     table = ((FeatureLayer)layer).FeatureClass as ITable;
     if (table != null)
     {
         tableWrapper             = new TableWrapper(table);
         bindingSource.DataSource = tableWrapper;
         dataGridView1.DataSource = bindingSource;
     }
     if (LayerChanged != null)
     {
         LayerChanged(this, e);
     }
 }
Ejemplo n.º 22
0
        public PCSDetail(string insp_ID, int pack_ID)
        {
            lObj = new TableWrapper("PackD");
            Load(insp_ID, pack_ID);

            Distributor = new Address(
                lObj.Fields["DAd1"],
                lObj.Fields["DAd2"],
                lObj.Fields["DCity"],
                lObj.Fields["DState"],
                lObj.Fields["DZip"],
                lObj.Fields["DName"]
            );
        }
Ejemplo n.º 23
0
        public void InitializeForeignKeys(TableKeyEditorMode mode, TableWrapper hostTable, long keyid)
        {
            try
            {
                _initializing = true;


                Mode = mode;

                cmbFk.Items.Clear();

                _hostTable = null;
                _newKey    = null;
                _hostTable = hostTable;

                cmbFk.Enabled = true;

                // Populate host tables. If host table is not null select proper table
                DbCmd.PopulateUserDefinedTablesCombo(cmbHostTables, _cp, ((_hostTable != null && Mode == TableKeyEditorMode.SingleTable) ? _hostTable.ID : -1));

                if (_hostTable != null)
                {
                    cmbHostTables.SelectedIndex = cmbHostTables.FindStringExact(_hostTable.Name);
                    PopulateHostColumnsCombo();
                }
                cmbHostTables.Enabled = (_hostTable != null && Mode == TableKeyEditorMode.SingleTable);

                //Populate reference tables combo
                DbCmd.PopulateUserDefinedTablesCombo(cmbRefTables, _cp, -1);

                ForeignKeyWrapper fk = new ForeignKeyWrapper(_cp);
                fk.ID = keyid;
                fk.LoadProperties();
                fk.GetKey();

                cmbFk.Items.Add(fk);
                cmbFk.SelectedIndex = 0;
                RenderKeyProperties();
            }
            finally
            {
                _initializing = false;
                if (cmbFk.Items.Count == 0)
                {
                    InitializeNewKey();
                }
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Creates a new
        /// <see cref="TableTagWorker"/>
        /// instance.
        /// </summary>
        /// <param name="element">the element</param>
        /// <param name="context">the context</param>
        public TableTagWorker(IElementNode element, ProcessorContext context)
        {
            String str   = element.GetStyles().Get(CssConstants.DIRECTION);
            bool   isRtl = "rtl".Equals(str);

            tableWrapper    = new TableWrapper(isRtl);
            parentTagWorker = context.GetState().Empty() ? null : context.GetState().Top();
            if (parentTagWorker is iText.Html2pdf.Attach.Impl.Tags.TableTagWorker)
            {
                ((iText.Html2pdf.Attach.Impl.Tags.TableTagWorker)parentTagWorker).ApplyColStyles();
            }
            else
            {
                colgroupsHelper = new WaitingColgroupsHelper(element);
            }
            display = element.GetStyles() != null?element.GetStyles().Get(CssConstants.DISPLAY) : null;
        }
Ejemplo n.º 25
0
    public override void ExportFile(string path, string createLogo)
    {
        ByteBuffer fileBuffer  = new ByteBuffer(ConfigDefine.CfgStreamMaxLen);
        ByteBuffer tableBuffer = new ByteBuffer(ConfigDefine.TabStreamMaxLen);

        for (int i = 0; i < _sheet.Tables.Count; i++)
        {
            TableWrapper table = _sheet.Tables[i];

            // 写入行标记
            fileBuffer.WriteShort(ConfigDefine.TabStreamHead);

            // 清空缓存
            tableBuffer.Clear();

            // 写入数据
            for (int j = 0; j < _sheet.Heads.Count; j++)
            {
                HeadWrapper head  = _sheet.Heads[j];
                string      value = table.GetCellValue(head.CellNum);
                WriteCell(tableBuffer, head, value, createLogo);
            }

            // 检测数据大小有效性
            int tabSize = tableBuffer.ReadableBytes;
            if (tabSize == 0)
            {
                throw new Exception($"{_sheet.FileName} tableBuffer readable bytes is zero.");
            }

            // 写入到总缓存
            fileBuffer.WriteInt(tabSize);
            fileBuffer.WriteBytes(tableBuffer.ReadBytes(tabSize));
        }

        // 创建文件
        string filePath = StringHelper.MakeSaveFullPath(path, $"{_sheet.FileName}.bytes");

        using (FileStream fs = new FileStream(filePath, FileMode.Create))
        {
            byte[] data   = fileBuffer.GetBuffer();
            int    length = fileBuffer.ReadableBytes;
            fs.Write(data, 0, length);
        }
    }
Ejemplo n.º 26
0
        public void TestWriteBulkSameRowKeys()
        {
            using (var dl = new DisposableList())
            {
                var table = new TableWrapper(TestHelpers.GenUnique(TestConfig.TableName), TestConfig.PrimaryStorageAccount, true);
                dl.Add(table.Delete);

                List <DynamicTableEntity> entities = new List <DynamicTableEntity>();
                for (int i = 0; i < 350; ++i)
                {
                    var entity = TestHelpers.CreateStarEntity("same");
                    entities.Add(TableConvert.ToDynamicTableEntity(entity));
                }

                TargetTable ttable = new TargetTable(table);
                Assert.Throws <ArgumentException>(() => ttable.Write(entities));
            }
        }
Ejemplo n.º 27
0
        public void ExternalCreateNewKey( )
        {
            _hostTable = null;
            cmbFk.Items.Clear();
            cmbFk.Enabled = true;

            // Populate host tables. If host table is not null select proper table
            DbCmd.PopulateUserDefinedTablesCombo(cmbHostTables, _cp, -1);
            if (cmbHostTables.Items.Count > 0)
            {
                cmbHostTables.SelectedIndex = 0;
            }

            cmbHostTables.Enabled = true;

            //Populate reference tables combo
            DbCmd.PopulateUserDefinedTablesCombo(cmbRefTables, _cp, -1);
            InitializeNewKey();
        }
Ejemplo n.º 28
0
 public void ModifyTable(ConnectionParams cp, long tableId)
 {
     try
     {
         _initializing         = true;
         this.ConnectionParams = cp;
         TableObj = new TableWrapper(tableId);
         PopulateTableData();
         BindTableColumns();
         Mode = EditMode.Modify;
         _primaryKeys.InitializePrimaryKeys(TableKeyEditorMode.SingleTable, true, TableObj);
         _foreignKeys.InitializeForeignKeys(TableKeyEditorMode.SingleTable, TableObj, false);
         cmbFileGroup.Enabled = false;
     }
     finally
     {
         _initializing = false;
     }
 }
Ejemplo n.º 29
0
        public void EntityConsistent()
        {
            using (var dl = new DisposableList())
            {
                // create the source table
                var sourceTableWrapper = new TableWrapper(TestHelpers.GenUnique(TestConfig.TableName), TestConfig.PrimaryStorageAccount, true);
                dl.Add(sourceTableWrapper.Delete);

                // initialize the target table and attach it to the disposable container
                var targetTable = new TableWrapper(TestHelpers.GenUnique(TestConfig.TableName), TestConfig.SecondaryStorageAccount, true);
                dl.Add(targetTable.Delete);
                var tableParamsResolver = new InMemoryTargetTableResolver();
                tableParamsResolver.Add(TestHelpers.TableKey, targetTable);

                // create gateway blob storage
                var gateBlob = new InMemoryGatewayBlobStore();

                // create a gateway queue
                var gateQueue       = new QueueWrapper(TestHelpers.GenUnique("gateq"), TestConfig.GatewayStorageAccount);
                var gateQueueWriter = new GatewayQueueWriter(gateQueue, gateBlob);

                var sourceTable = new SourceTable <StarEntity>(sourceTableWrapper, gateQueueWriter, TestHelpers.TableKey);

                var entity = TestHelpers.CreateStarEntity();

                // write the entity
                sourceTable.Write(entity);

                // now verify that the entity was synced to the secondary table storage
                TableGatewayQueueProcessor gateQueueProcessor = new TableGatewayQueueProcessor(
                    new GatewayQueueReader(gateQueue, gateBlob),
                    tableParamsResolver
                    );

                bool result = gateQueueProcessor.ProcessNext();

                Assert.IsTrue(result);

                var targetEntity = targetTable.ReadEntity <StarEntity>(entity.PartitionKey, entity.RowKey);
                TestHelpers.AssertEqualStars(entity, targetEntity);
            }
        }
Ejemplo n.º 30
0
        private void ModifySelectedForeignKey( )
        {
            if (grd.CurrentRow == null)
            {
                KeyPanelVisible = false;
                return;
            }

            DataGridViewRow row = grd.CurrentRow;

            long         tableId = (int)row.Cells[1].Value;
            TableWrapper hostTbl = new TableWrapper(tableId);

            hostTbl.ConnectionParams = _cp;
            hostTbl.LoadProperties();
            _foreignKeyEdit.InitializeForeignKeys(TableKeyEditorMode.SingleTable, hostTbl, (int)row.Cells[0].Value);

            UpdateHeaderText();
            KeyPanelVisible = true;
        }
Ejemplo n.º 31
0
        private void PopulateReferenceTablePrimaryKeys(string refPk)
        {
            TableWrapper refTbl = cmbRefTables.SelectedItem as TableWrapper;

            if (refTbl == null)
            {
                cmbRefPk.Items.Clear();
                return;
            }

            _tblCols.Clear();
            DbCmd.PopulateReferenceTablePKCombo(cmbRefPk, _cp, refTbl.ID);
            if (!String.IsNullOrEmpty(refPk))
            {
                cmbRefPk.SelectedIndex = cmbRefPk.FindStringExact(refPk);
            }
            else if (cmbRefPk.Items.Count > 0)
            {
                cmbRefPk.SelectedIndex = 0;
            }
        }
Ejemplo n.º 32
0
        public void TestWriteBulk()
        {
            using (var dl = new DisposableList())
            {
                var table = new TableWrapper(TestHelpers.GenUnique(TestConfig.TableName), TestConfig.PrimaryStorageAccount, true);
                dl.Add(table.Delete);

                List <DynamicTableEntity> entities = new List <DynamicTableEntity>();
                for (int i = 0; i < 350; ++i)
                {
                    entities.Add(
                        TableConvert.ToDynamicTableEntity(
                            TestHelpers.CreateStarEntity(i.ToString())
                            ));
                }

                TargetTable ttable  = new TargetTable(table);
                var         results = ttable.Write(entities);
                Assert.AreEqual(entities.Count, results.Count);
                Assert.IsTrue(results.All(x => !x.Discarded));
            }
        }
Ejemplo n.º 33
0
        public Business(string ID)
        {
            lObj = new TableWrapper("Business");
            lObj.Fields["Bus_ID"].Value = ID;
            lObj.Load();

            PhysicalAddress = new Address(
                lObj.Fields["Addr1"],
                lObj.Fields["Addr2"],
                lObj.Fields["City"],
                lObj.Fields["State"],
                lObj.Fields["Zip"],
                lObj.Fields["Contact"]
                );

            MailingAddress = new Address(
                lObj.Fields["BAddr1"],
                lObj.Fields["BAddr2"],
                lObj.Fields["B_City"],
                lObj.Fields["B_State"],
                lObj.Fields["B_Zip"],
                lObj.Fields["BContact"]
                );

            BillingAddress = new Address(
                lObj.Fields["MAddr1"],
                lObj.Fields["MAddr2"],
                lObj.Fields["M_City"],
                lObj.Fields["M_State"],
                lObj.Fields["M_Zip"],
                lObj.Fields["MContact"]
                );

            m_custom = new BusinessCustom();
            m_custom.Initialize();
            m_custom.Load(ID);
        }
Ejemplo n.º 34
0
 public PCSTest()
 {
     lObj = new TableWrapper("PackTest");
 }
Ejemplo n.º 35
0
 public UPCDetail(string insp_ID, int UPC_ID)
 {
     lObj = new TableWrapper("UPCD");
     Load(insp_ID, UPC_ID);
 }
Ejemplo n.º 36
0
 public Business()
 {
     lObj = new TableWrapper("Business");
     m_custom = new BusinessCustom();
     m_custom.Initialize();
 }
Ejemplo n.º 37
0
 public DEVDetail()
 {
     lObj = new TableWrapper("DevD");
 }
Ejemplo n.º 38
0
 public DEVDetail(string insp_ID, int dev_ID)
 {
     lObj = new TableWrapper("DevD");
     Load(insp_ID, dev_ID);
 }
Ejemplo n.º 39
0
 public PCSTest(string insp_ID, int pack_ID, int test_id)
 {
     lObj = new TableWrapper("PackTest");
     Load(insp_ID, pack_ID, test_id);
 }
Ejemplo n.º 40
0
 public UPCDetail()
 {
     lObj = new TableWrapper("UPCD");
 }