/// <summary> /// 通过本地数据转为实体 /// </summary> /// <param name="row">DataTable中的一行数据</param> /// <returns></returns> public override FormValueArg FromRow(DataRow row) { try { IDCard = SqlTypeConvertor.ToString(row["IDCard"]); YuShouUserName = SqlTypeConvertor.ToString(row["YuShouUserName"]); Amount = SqlTypeConvertor.ToDecimal(row["Amount"]); PersonCount = SqlTypeConvertor.ToInt32(row["PersonCount"]); CheckedCount = SqlTypeConvertor.ToInt32(row["CheckedCount"]); WarnInfo = SqlTypeConvertor.ToString(row["WarnInfo"]); string strIsShowWarnBox = SqlTypeConvertor.ToString(row["Buckup1"]); int isShowWarnBox = 0; if (int.TryParse(strIsShowWarnBox, out isShowWarnBox)) { IsShowWarnBox = isShowWarnBox; } else { IsShowWarnBox = 0; } return(this); } catch (Exception ex) { Logger.WriteLog("数据转换错误1" + ex.Message); return(null); } }
/// <summary> /// 通过本地数据转为实体 /// </summary> /// <param name="row">DataTable中的一行数据</param> /// <returns></returns> public override FormValueArg FromRow(DataRow row) { try { Title = SqlTypeConvertor.ToString(row["Title"]); IDCard = SqlTypeConvertor.ToString(row["IDCard"]); InfoTitle = SqlTypeConvertor.ToString(row["InfoTitle"]); Info = SqlTypeConvertor.ToString(row["Info"]); WarnInfo = SqlTypeConvertor.ToString(row["WarnInfo"]); return(this); } catch (Exception ex) { Logger.WriteLog("数据转换错误2" + ex.Message); return(null); } }