public static DateTimeColumnProperties Load(MainDataSet.DynamicColumnsRow row) { DateTimeColumnProperties result = null; /////////////////////////////////////////////////////////////////////////////// if (row != null && !row.IsPropertiesNull()) { var propsJson = row.Properties; if (!String.IsNullOrEmpty(propsJson)) { result = JsonConvert.DeserializeObject <DateTimeColumnProperties>(propsJson); } } /////////////////////////////////////////////////////////////////////////////// if (result == null) { result = new DateTimeColumnProperties { Format = DateTimeColumnFormat.DateOnly, DateFormat = "MM/dd/yy", TimeFormat = "HH:mm:ss (24-hour clock)" }; } /////////////////////////////////////////////////////////////////////////////// return(result); }
public static NumericColumnProperties Load(MainDataSet.DynamicColumnsRow row) { NumericColumnProperties result = null; /////////////////////////////////////////////////////////////////////////////// if (row != null && !row.IsPropertiesNull()) { var propsJson = row.Properties; if (!String.IsNullOrEmpty(propsJson)) { result = JsonConvert.DeserializeObject <NumericColumnProperties>(propsJson); } } /////////////////////////////////////////////////////////////////////////////// if (result == null) { result = new NumericColumnProperties { IsDecimal = false, DecimalPlaces = 1 }; } return(result); }