public static decimal GetEntityValueDecimal(SqlClientEntity entity, string columnName) { decimal entityValueDecimal = 0; if (!entity.IsColumnNull(columnName)) { try { entityValueDecimal = Convert.ToDecimal(entity.GetColumn(columnName).ToString()); } catch { } } return entityValueDecimal; }
public static int GetEntityValueInt(SqlClientEntity entity, string columnName) { int entityValueInt = 0; if (!entity.IsColumnNull(columnName)) { try { entityValueInt = int.Parse(entity.GetColumn(columnName).ToString()); } catch { } } return entityValueInt; }
public static bool GetEntityValueBool(SqlClientEntity entity, string columnName) { bool entityValueBoll = false; if (!entity.IsColumnNull(columnName)) { try { entityValueBoll = Convert.ToBoolean(entity.GetColumn(columnName).ToString()); } catch { } } return entityValueBoll; }