Ejemplo n.º 1
0
        public void CanUpdateOwnProduct()
        {
            var entityPropertyCollection = OwnProductProperties.Get();
            var properties = entityPropertyCollection.Properties.ToList();

            properties.RemoveAll(p => p.Name == "ImportCode" || p.Name == "Name");
            entityPropertyCollection.Properties = properties;
            entityPropertyCollection.PrimaryEntityColumnName   = "OwnSiteID";
            entityPropertyCollection.PrimaryEntityTableName    = "PNOwnSite";
            entityPropertyCollection.PrimaryEntityIds          = new int[] { 1, 2 };
            entityPropertyCollection.SecondaryEntityColumnName = "GlobalProductID";
            entityPropertyCollection.SecondaryEntityIds        = new int[] { 1 };
            entityPropertyCollection.SecondaryEntityTableName  = "PNGlobalProduct";
            Test(entityPropertyCollection);
            var p1 = entityPropertyCollection.Properties.First();

            p1.InitialValue = false;
            //foreach (var property in entityPropertyCollection.Properties)
            //{
            //    property.in
            //}
            var command = PriceNetSqlGenerator.GenerateUpdateCommand(entityPropertyCollection);

            ParseSql(command.CommandText);
            TestCommand(command);
        }
        public void CanInsertOwnProduct()
        {
            var entityPropertyCollection = OwnProductProperties.Get();
            var command = PriceNetSqlGenerator.GenerateInsertCommand(entityPropertyCollection);

            ParseSql(command.CommandText);
            TestCommand(command);
        }