/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromInvrepl(ref DataRow row, Invrepl entity) { row.SetField("urgent", entity.urgent); row.SetField("bin_from", entity.binFrom); row.SetField("zone_to", entity.zoneTo); row.SetField("quantity", entity.quantity); row.SetField("dept_num", entity.deptNum); row.SetField("lot", entity.lot); row.SetField("movemstRowID", entity.movemstRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Invrepl BuildInvreplFromRow(DataRow row) { Invrepl entity = new Invrepl(); entity.urgent = row.Field <bool>("urgent"); entity.binFrom = row.IsNull("bin_from") ? string.Empty : row.Field <string>("bin_from"); entity.zoneTo = row.IsNull("zone_to") ? string.Empty : row.Field <string>("zone_to"); entity.quantity = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity"); entity.deptNum = row.IsNull("dept_num") ? 0 : row.Field <int>("dept_num"); entity.lot = row.IsNull("lot") ? string.Empty : row.Field <string>("lot"); entity.movemstRowID = row.Field <byte[]>("movemstRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }