/// #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; } } } }
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(); }
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(); }
/// <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()); }
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(); }
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)); }
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 }
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); } }
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)); }
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(); }
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); }
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; } }
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); }
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); } }
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; } }
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")); }
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; }
/// <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); }
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); } }
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); } } }
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); }
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(); }
/// <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)); }
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; }
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; }