当前位置: 首页>>代码示例>>C#>>正文


C# IType.PrepareValueProperty方法代码示例

本文整理汇总了C#中IType.PrepareValueProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IType.PrepareValueProperty方法的具体用法?C# IType.PrepareValueProperty怎么用?C# IType.PrepareValueProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IType的用法示例。


在下文中一共展示了IType.PrepareValueProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetObject

 public virtual IType SetObject(DataRow drow, IType iType)
 {
     foreach (PropertyInfo pi in iType.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic))
     {
         PropertyAttribute[] pAttribute = (PropertyAttribute[])pi.GetCustomAttributes(typeof(PropertyAttribute), false);
         if (pAttribute != null && pAttribute.Length > 0 && (pAttribute[0].IsFieldBase))
         {
             object value = DBNull.Value;
             try { value = drow[CType.GetPropertyName(pi)]; }
             catch { }
             pi.SetValue(iType, iType.PrepareValueProperty(value, pi.PropertyType), null);
         }
     }
     iType.IsFull = true;
     return iType;
 }
开发者ID:Didox,项目名称:MVC_e_Velocit_app,代码行数:16,代码来源:CData.cs

示例2: Save

 /// <summary>
 /// Salva os dados na base através de parâmetros
 /// </summary>
 public virtual void Save(ref IType iType)
 {
     try
     {
         Cmd = DataBaseGeneric.CreateCommand(BaseType);
         Cmd.CommandType = CommandType.StoredProcedure;
         Cmd.CommandText = "sp_SYS_" + iType.GetType().Name + "_Salvar";
         PropertyInfo cPk = SetParanSave(iType);
         OpenConnectionTrans(iType);
         if (cPk != null && cPk.GetValue(iType, null) == null)
             cPk.SetValue(iType, iType.PrepareValueProperty(Cmd.ExecuteScalar(), cPk.PropertyType), null);
         else Cmd.ExecuteNonQuery();
     }
     catch (Exception ex) { throw ex; }
     finally { CloseConnection(iType); }
 }
开发者ID:Didox,项目名称:MVC_e_Velocit_app,代码行数:19,代码来源:CData.cs

示例3: setDefaultValue

 private static void setDefaultValue(IType objiType, PropertyAttribute[] pAttrProperty, PropertyInfo pi, ref string invalidFields, ref object value)
 {
     if (!string.IsNullOrEmpty(pAttrProperty[0].DefaultValue))
     {
         pi.SetValue(objiType, objiType.PrepareValueProperty(pAttrProperty[0].DefaultValue, pi.PropertyType), null);
         value = pi.GetValue(objiType, null);
     }
     else invalidFields += pi.Name + " Não pode ser vazio \n";
 }
开发者ID:Didox,项目名称:MVC_e_Velocit_app,代码行数:9,代码来源:CType.cs

示例4: setProperty

 private void setProperty(IType iType)
 {
     foreach (PropertyInfo pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic))
     {
         PropertyAttribute[] pAttProperty = (PropertyAttribute[])pi.GetCustomAttributes(typeof(PropertyAttribute), false);
         if (pAttProperty != null && pAttProperty.Length > 0)
         {
             if (pAttProperty[0].IsPk && pi.GetValue(iType, null) == null) return;
             if (pAttProperty[0].IsFieldBase)
                 pi.SetValue(this, iType.PrepareValueProperty(pi.GetValue(iType, null), pi.PropertyType), null);
         }
     }
 }
开发者ID:Didox,项目名称:MVC_e_Velocit_app,代码行数:13,代码来源:CType.cs

示例5: Get

        public static void Get(IType objiTypeValues, IType iType, string namePropertyId, string namePropertyName)
        {
            var pTipo = objiTypeValues.GetType().GetProperty(namePropertyId);
            var pName = objiTypeValues.GetType().GetProperty(namePropertyName);

            if (pTipo.GetValue(objiTypeValues, null) == null) throw new TradeVisionValidationError("IDTipo obrigatório para a ação GET");
            var tipoTabelaColuna = new TipoTabelaColuna(iType);
            tipoTabelaColuna.Get();
            if (tipoTabelaColuna.IDTipoTabelaColuna != null)
            {
                var tipo = new Tipo();
                tipo.TipoTabelaColuna = tipoTabelaColuna;
                tipo.IDTipo = (int?)pTipo.GetValue(objiTypeValues, null);
                tipo.Get();

                if (tipo.IDTipo != null)
                    pName.SetValue(objiTypeValues, objiTypeValues.PrepareValueProperty(tipo.Nome, pName.PropertyType), null);
            }
        }
开发者ID:Didox,项目名称:MVC_e_Velocit_app,代码行数:19,代码来源:Tipos.cs


注:本文中的IType.PrepareValueProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。