Ejemplo n.º 1
0
        ///
        #endregion
        /// ------------------------------------------------------------------------------------------------
        #region Public Functions, Properties and Methods
        /// ------------------------------------------------------------------------------------------------
        ///
        /// ------------------------------------------------------------------------------------------------
        /// Name		AddCPData
        ///
        /// <summary>	Adds the CPINFO entities that are linked to any of the records.
        /// </summary>
        /// <param name="data">		The CPINFO data.</param>
        ///
        /// <remarks>
        /// </remarks>
        /// ------------------------------------------------------------------------------------------------
        ///
        public void AddCPData(SRiCPInfoData data)
        {
            bool added;

            //
            foreach (var p in data.CPInfos)
            {
                added = false;
                foreach (var rg in RequestGroups)
                {
                    foreach (var r in rg.Records)
                    {
                        if (!string.IsNullOrEmpty(r.Record.XBSubSys) &&
                            !string.IsNullOrEmpty(r.Record.XBKeyVal) &&
                            r.Record.XBSubSys.ToUpper().Equals("CP") &&
                            r.Record.XBKeyVal.Equals(p.CPInfo.KeyVal))
                        {
                            CPInfos.Add(p);
                            PropertyDetails.Add(new SRiPropertyDetail(p, r.Record));
                            added = true;
                            break;
                        }
                    }
                    if (added)
                    {
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void Delete(int id)
        {
            PropertyDetails propertyDetails = _context.Set <PropertyDetails>().SingleOrDefault(c => c.Id == id);

            _context.Entry(propertyDetails).State = Microsoft.EntityFrameworkCore.EntityState.Deleted;
            _context.SaveChanges();
        }
Ejemplo n.º 3
0
 public void WhenIAddedANewProperty()
 {
     //Click on add property
     Driver.driver.FindElement(By.CssSelector("#main-content > div > div:nth-child(1) > div > div:nth-child(4) > div > div.middle.aligned.eight.wide.column > a:nth-child(2)")).Click();
     Thread.Sleep(1000);
     //Add property details
     PropertyDetails.Details();
 }
            public void GoPreviousAndModifyDataAndValidate()
            {
                // creates a toggle for the given test, adds all log events under it
                test = extent.StartTest("GoPreviousAndModifyData");
                PropertyDetails obj = new PropertyDetails();

                obj.GoPreviousAndModify();
            }
            public void AddNewPropertyWithExistingDataAndValidate()
            {
                // creates a toggle for the given test, adds all log events under it
                test = extent.StartTest("AddNewPropertyWithExistingDataAndValidate");
                PropertyDetails obj = new PropertyDetails();

                obj.EnterOwnersPropertiesPage();
                obj.AddAnExistingPropertyAndValidate();
            }
Ejemplo n.º 6
0
        /// <summary>
        /// Updates the property bound to the given property.
        /// </summary>
        /// <param name="property">The property the update came from.</param>
        /// <returns><c>true</c> if the property was updated.</returns>
        public bool UpdateFrom(PropertyDetails property)
        {
            // If this property doesn't match fail update now.
            if (SourceProperty != property && TargetProperty != property)
            {
                return(false);
            }

            return((SourceProperty == property) ? UpdateTargetValue() : UpdateSourceValue());
        }
Ejemplo n.º 7
0
 public void AddItemsToStream <T>(ManualBlittableJsonDocumentBuilder <T> writer)
     where T : struct, IUnmanagedWriteBuffer
 {
     for (var i = 0; i < Count; i++)
     {
         var prop = new PropertyDetails();
         GetPropertyByIndex(i, ref prop);
         writer.WritePropertyName(prop.Name);
         writer.WriteValue(ProcessTokenTypeFlags(prop.Token), prop.Value);
     }
 }
            public void EditTenantWithInvalidData()
            {
                //create a toggle for the given test, adds all log events under it
                test = extent.StartTest("Edit Tenant with invalid data");

                //create an PropertyDetails object
                PropertyDetails obj = new PropertyDetails();

                //call the method to edit tenant with invalid data
                obj.EditTenantWithInvalidData();
            }
            public void EditTenantAndValidate()
            {
                //creates a toggle for the given test, adds all log events under ir
                test = extent.StartTest("Edit Tenant and Validate");

                //create an PropertyDetails object
                PropertyDetails obj = new PropertyDetails();

                //call the method to edit tenant and validate
                obj.EditTenantAndValidate();
            }
Ejemplo n.º 10
0
        public ManageVendorsWindow(ManageVendorsViewModel ViewModel)
        {
            this.ViewModel   = ViewModel ?? new ManageVendorsViewModel();
            this.DataContext = this.ViewModel;

            InitializeComponent();

            // create an instance of our property details creator and pass our container object
            propertyDetails = new PropertyDetails(DetailView);
            propertyDetails.AddDetails(typeof(VendorDetail));
        }
Ejemplo n.º 11
0
        public static bool DoPropertyDetailsMatch(PropertyDetails x, PropertyDetails y)
        {
            if (x == null)
            {
                throw new ArgumentNullException(nameof(x));
            }
            if (y == null)
            {
                throw new ArgumentNullException(nameof(y));
            }

            throw new NotImplementedException(); // TODO
        }
Ejemplo n.º 12
0
 public bool Add(PropertyDetails propertyDetails)
 {
     try
     {
         this.UnitOfWork.PropertyDetailsRepository.Add(propertyDetails);
         this.UnitOfWork.Save();
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
         return(false);
     }
 }
Ejemplo n.º 13
0
        public async Task <PropertyDetailsViewModel> NewAsync(Guid portfolioId)
        {
            var entity = new PropertyDetails
            {
                Created     = DateTime.Now,
                PortfolioId = portfolioId,
                Reference   = "New property"
            };

            await Context.PropertyDetails.AddAsync(entity);

            await Context.SaveChangesAsync();

            return(new PropertyDetailsViewModel(entity));
        }
Ejemplo n.º 14
0
    public override object Evaluate(UnityELEvaluator context)
    {
        PropertyDetails details = ResolveProperty(context);

        if (details == null)
        {
            return(null);
        }
        else if (details.Property == null)
        {
            throw new NoSuchPropertyException(this, $"Property: {details.Name} not found on type: {details.HostType}");
        }

        return(details.Property.GetValue(details.Host));
    }
            public void AddNewPropertyAndValidate()
            {
                // creates a toggle for the given test, adds all log events under it
                test = extent.StartTest("AddNewPropertyAndValidate");
                //test = extent.StartTest("TestCheck");
                PropertyDetails obj = new PropertyDetails();

                obj.AddNewPropertyAndValidate();
                //obj.OwnersPropertiesPage();
                //obj.EnterPropertyDetails();
                //obj.EnterFinancialDetails();
                //obj.EnterTenantDetails();

                //obj.OwnersPropertiesPage();
                //obj.ValidateAddNewProperty();
            }
Ejemplo n.º 16
0
    private PropertyDetails ResolveProperty(UnityELEvaluator context)
    {
        PropertyDetails details = new PropertyDetails();

        details.Host = Host.Evaluate(context);
        if (details.Host == null)
        {
            return(null);
        }

        details.Name     = Property.Value;
        details.HostType = details.Host.GetType();
        details.Property = details.HostType.GetProperty(details.Name);

        return(details);
    }
Ejemplo n.º 17
0
        public static int AddDetails(int price, int space, string detail, Rooms room, int propId)
        {
            var details = new PropertyDetails
            {
                Price       = price,
                SpaceM2     = space,
                RoomsId     = room,
                MoreDetails = detail,
                ID          = propId
            };

            using (var context = new RepositoryPropertyDetails())
            {
                return(context.CreateDetails(details));
            }
        }
        public PropertyBasicDetailsViewModel(PropertyDetails propertyDetails)
        {
            if (propertyDetails == null)
            {
                return;
            }

            Id = propertyDetails.Id;
            PropertyReference     = propertyDetails.Reference;
            PropertyStreetAddress = propertyDetails.PropertyStreetAddress;
            PortfolioId           = propertyDetails.PortfolioId;

            if (propertyDetails.Portfolio != null)
            {
                PortfolioName = propertyDetails.Portfolio.DisplayName;
            }
        }
Ejemplo n.º 19
0
        public PropertyDetails Get(int id)
        {
            PropertyDetails model = new PropertyDetails();

            if (id > 0)
            {
                PropertyDetails proDetails = _context.Set <PropertyDetails>().SingleOrDefault
                                                 (c => c.Id == id);
                if (proDetails != null)
                {
                    model.Id        = proDetails.Id;
                    model.Address   = proDetails.Address;
                    model.Financial = proDetails.Financial;
                    model.Physical  = proDetails.Physical;
                }
            }
            return(model);
        }
Ejemplo n.º 20
0
            public void PO_AddANewProperty(string TestDataSheetName, int TestDataSetNumber)
            {
                // Create a toggle for the test to log events
                test = extent.StartTest("Add a New Property");
                //Set the excel path and sheet name for the test data for the test case
                ExcelLib.PopulateInCollection(Base.ExcelPath, TestDataSheetName);

                // Create a Property Details page object to add a new property
                PropertyDetails PropertyDetailsObj = new PropertyDetails();

                //Verify that the new listing is displayed in the "My Properties" page
                //Proceed to verification if the property was added successfully
                if (PropertyDetailsObj.AddNewProperty(TestDataSetNumber) == true)
                {
                    PropertyOwner PropertyOwnerObj = new PropertyOwner();
                    PropertyOwnerObj.VerifyNewProperty(TestDataSetNumber);
                }
            }
Ejemplo n.º 21
0
        protected void Set <TProperty>(Expression <Func <TProperty> > propertySelector, TProperty value)
        {
            string          name = GetNameFromExpression(propertySelector);
            PropertyDetails data;

            if (!propertyState.TryGetValue(name, out data))
            {
                data = new PropertyDetails()
                {
                    OriginalValue = value, CurrentValue = value, HasChanged = false
                };
                propertyState[name] = data;
            }
            else
            {
                data.CurrentValue = value;
                data.HasChanged   = true;
            }
        }
Ejemplo n.º 22
0
        public IActionResult Add(AddViewModel model)
        {
            var addModel = new PropertyDetails
            {
                Id          = Guid.NewGuid(),
                Rooms       = model.propertyInfos.Rooms,
                Kitchen     = model.propertyInfos.Kitchen.Equals("Yes") ? true : false,
                IsAvailable = true,
                Surface     = model.propertyInfos.Surface,
                Price       = model.propertyInfos.Price,
                Type        = model.propertyInfos.Type,
                Bathroom    = model.propertyInfos.Bathroom,
                urlPhoto    = SeedData.URLImage(null, "upload", model.photosUrl[0]),
                urlPhoto2   = SeedData.URLImage(null, "upload", model.photosUrl[1]),
                urlPhoto3   = SeedData.URLImage(null, "upload", model.photosUrl[2]),
                urlPhoto4   = SeedData.URLImage(null, "upload", model.photosUrl[3]),
            };

            _propertyInfos.Add(addModel);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 23
0
        public void GetPropertyByIndex(int index, ref PropertyDetails prop, bool addObjectToCache = false)
        {
            if (_mem == null)
            {
                ThrowObjectDisposed();
            }

            if (index < 0 || index >= _propCount)
            {
                ThrowOutOfRangeException();
            }

            var metadataSize = (_currentOffsetSize + _currentPropertyIdSize + sizeof(byte));
            BlittableJsonToken token;
            int position;
            int propertyId;

            GetPropertyTypeAndPosition(index, metadataSize, out token, out position, out propertyId);

            var stringValue = GetPropertyName(propertyId);

            prop.Token = token;
            prop.Name  = stringValue;
            object result;

            if (_objectsPathCacheByIndex != null && _objectsPathCacheByIndex.TryGetValue(index, out result))
            {
                prop.Value = result;
                return;
            }

            var value = GetObject(token, (int)(_objStart - _mem - position));

            if (NoCache == false && addObjectToCache)
            {
                AddToCache(stringValue.ToString(), value, index);
            }

            prop.Value = value;
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Executed on first request in order to build some collections
        /// from the meta-data exposed by the Pipeline.
        /// </summary>
        private PipelineConfig PopulateConfig(IPipeline pipeline)
        {
            var config = new PipelineConfig();

            // Populate the collection that contains a list of the
            // properties with names starting with 'SetHeader'
            foreach (var element in pipeline.ElementAvailableProperties)
            {
                foreach (var property in element.Value.Where(p =>
                                                             p.Key.StartsWith(SET_HEADER_PROPERTY_PREFIX, StringComparison.OrdinalIgnoreCase)))
                {
                    PropertyDetails details = new PropertyDetails()
                    {
                        PropertyMetaData   = property.Value,
                        ResponseHeaderName = GetResponseHeaderName(property.Key)
                    };
                    config.SetHeaderProperties.Add(property.Key, details);
                }
            }

            return(config);
        }
Ejemplo n.º 25
0
        public static async Task <PropertyDetails> GetPropertyDetails(string id)
        {
            try
            {
                PropertyDetails propertyDetails = new PropertyDetails();
                string          json;

                using (var httpClient = new HttpClient())
                {
                    json = await httpClient.GetStringAsync("https://www.vablemporium.com/Images/Property/" + id);
                }

                propertyDetails = JsonConvert.DeserializeObject <PropertyDetails>(json);

                return(propertyDetails);
            }
            catch (Exception e)
            {
                Debug.WriteLine("Error in GET Property details: " + e.Message);
                return(null);
            }
        }
Ejemplo n.º 26
0
        private void CreatePropertiesMap(Type objectType, Dictionary <string, PropertyDetails> propertiesDictionary)
        {
            foreach (PropertyInfo propertyInfo in objectType.GetProperties())
            {
                var propertyDetails = new PropertyDetails()
                {
                    Getter = propertyInfo.GetMethod,
                    Name   = propertyInfo.Name
                };

                if (propertyInfo.PropertyType.IsClass &&
                    propertyInfo.PropertyType != typeof(string) &&
                    propertyInfo.PropertyType.GetProperties().Any())
                {
                    propertyDetails.Elements = new Dictionary <string, PropertyDetails>(StringComparer.OrdinalIgnoreCase);
                    propertiesDictionary.Add(propertyInfo.Name, propertyDetails);
                    this.CreatePropertiesMap(propertyInfo.PropertyType, propertyDetails.Elements);
                }
                else
                {
                    propertiesDictionary.Add(propertyInfo.Name, propertyDetails);
                }
            }
        }
Ejemplo n.º 27
0
    public void Assign(UnityELEvaluator context, object value)
    {
        PropertyDetails details = ResolveProperty(context);

        if (details == null)
        {
            throw new ParserException(this, $"Did not resolve host object: {Host}");
        }
        else if (details.Property == null)
        {
            throw new NoSuchPropertyException(this, $"Property: {details.Name} not found on type: {details.HostType}");
        }

        if (!details.Property.CanWrite || details.Property.SetMethod == null ||
            details.Property.SetMethod.IsPrivate)
        {
            throw new ParserException(this, $"Property: {details.Name} on type: {details.HostType} is read only");
        }

        System.Type propertyType = details.Property.PropertyType;
        object      coercedValue = TypeCoercer.CoerceToType(propertyType, this, value);

        details.Property.SetValue(details.Host, coercedValue);
    }
Ejemplo n.º 28
0
 public Login(LoginInfo loginInfo, PropertyDetails propertyDetails, FinanceDetails financeDetails)
 {
     LoginInfo       = loginInfo;
     PropertyDetails = propertyDetails;
     FinanceDetails  = financeDetails;
 }
 public void Add(PropertyDetails property)
 {
     _context.PropertyInfos.Add(property);
     _context.SaveChanges();
 }
Ejemplo n.º 30
0
        /// <summary>
        /// Creates a property binding with the given source property and target property.
        /// </summary>
        /// <param name="sourceProperty">The source property.</param>
        /// <param name="targetProperty">The target property.</param>
        /// <returns>A generated property binding.</returns>
        public static PropertyBinding Create(PropertyDetails sourceProperty, PropertyDetails targetProperty)
        {
            var propertyBindingType = typeof(PropertyBinding <,>).GetGenericType(sourceProperty.Type, targetProperty.Type);

            return((PropertyBinding)propertyBindingType.CreateInstance(sourceProperty, targetProperty));
        }
Ejemplo n.º 31
0
        private static PropertyDetails GetPropertyDetails(object[] stateArray, int propertyIndex, IEntityPersister persister)
        {
            var result = new PropertyDetails
            {
                PropertyName = persister.PropertyNames[propertyIndex]
            };


            var value = stateArray[propertyIndex];
            if (value is IAuditable)
            {
                result.PropertyName = result.PropertyName + "Id";
                result.PropertyValue = (value as IAuditable).IdForAuditing;
                return result;
            }

            if (value == null || value.ToString() == string.Empty)
            {
                result.PropertyValue = NoValueString;
                return result;
            }

            result.PropertyValue = value.ToString();
            return result;

        }
Ejemplo n.º 32
0
        private static PropertyDetails GetPropertyDetails(PostInsertEvent @event, int propertyIndex)
        {
            var result = new PropertyDetails
                             {
                                 PropertyName = @event.Persister.PropertyNames[propertyIndex]
                             };

            var newValue = @event.Persister.GetPropertyValue(@event.Entity, result.PropertyName, EntityMode.Poco);
            if (newValue == null || newValue.ToString() == string.Empty)
            {
                result.PropertyValue = NoValueString;
                return result;
            }

            if (newValue is IAuditable)
            {
                result.PropertyName = result.PropertyName + "Id";
                result.PropertyValue = (newValue as IAuditable).IdForAuditing;
                return result;
            }

            // Are we a collection if so then get all the values
            var collectionType = GetItemTypeFromGenericType(newValue.GetType());
            if (collectionType != null)
            {
                var isAuiditable =
                  collectionType.GetInterfaces().AsEnumerable().Count(x => x.Name == typeof(IAuditable).Name) == 1;
                
                if(isAuiditable)
                {
                    var collectionValues = newValue as IEnumerable;
                    foreach (var collectionValue in collectionValues)
                    {
                        var item = collectionValue as IAuditable;
                        if (result.PropertyValue != null && result.PropertyValue.Length > 0)
                        {
                            result.PropertyValue += ", ";
                        }
                        result.PropertyValue += item.IdForAuditing;
                    }
                    return result;    
                }
                
            }
            
            result.PropertyValue = newValue.ToString();
            return result;
        }