Esempio n. 1
0
 private object GetPropModelValue(PropModelConfig propModelConfig, string propertyName)
 {
     PropertyInfo property = propModelConfig.GetType().GetProperty(propertyName);
     object propNameByID = property.GetValue(propModelConfig, null);
     if (property.Name == "PropModelID")
     {
         propNameByID = NECommon.GetPropNameByID(Convert.ToInt32(propNameByID), this.m_PropaCollection.GetPropagationModelList());
     }
     return propNameByID;
 }
Esempio n. 2
0
 private void FillPropModleValue(PropModelConfig propModel, object value, string propertyName, string splitKey, CollectionsModel model)
 {
     if (propertyName.StartsWith(splitKey))
     {
         string name = propertyName.Split(new string[] { splitKey }, StringSplitOptions.RemoveEmptyEntries)[0];
         PropertyInfo property = propModel.GetType().GetProperty(name);
         object propIDByName = null;
         if (property.Name.EndsWith("ID"))
         {
             propIDByName = NECommon.GetPropIDByName(value.ToString(), model.PropagetionColl.GetPropagationModelList());
         }
         else
         {
             int result = 0;
             if (int.TryParse(this.IsCurrency(value.ToString()), out result))
             {
                 propIDByName = result;
             }
         }
         property.SetValue(propModel, propIDByName, null);
     }
 }