/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPderupdateitem(ref DataRow row, Pderupdateitem entity) { row.SetField("statustype", entity.statustype); row.SetField("actstkqty", entity.actstkqty); row.SetField("rebateamt", entity.rebateamt); row.SetField("rowidpder", entity.rowidpder.ToByteArray()); row.SetField("secure", entity.secure); row.SetField("userfield", entity.userfield); }
public static Pderupdateitem BuildPderupdateitemFromRow(DataRow row) { Pderupdateitem entity = new Pderupdateitem(); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.actstkqty = row.IsNull("actstkqty") ? decimal.Zero : row.Field <decimal>("actstkqty"); entity.rebateamt = row.IsNull("rebateamt") ? decimal.Zero : row.Field <decimal>("rebateamt"); entity.rowidpder = row.Field <byte[]>("rowidpder").ToStringEncoded(); entity.secure = row.IsNull("secure") ? 0 : row.Field <int>("secure"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }