/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApshipfromcopy(ref DataRow row, Apshipfromcopy entity) { row.SetField("fromvendno", entity.fromvendno); row.SetField("fromshipfmno", entity.fromshipfmno); row.SetField("tovendno", entity.tovendno); row.SetField("toshipfmno", entity.toshipfmno); row.SetField("name", entity.name); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Apshipfromcopy BuildApshipfromcopyFromRow(DataRow row) { Apshipfromcopy entity = new Apshipfromcopy(); entity.fromvendno = row.IsNull("fromvendno") ? decimal.Zero : row.Field <decimal>("fromvendno"); entity.fromshipfmno = row.IsNull("fromshipfmno") ? 0 : row.Field <int>("fromshipfmno"); entity.tovendno = row.IsNull("tovendno") ? decimal.Zero : row.Field <decimal>("tovendno"); entity.toshipfmno = row.IsNull("toshipfmno") ? 0 : row.Field <int>("toshipfmno"); entity.name = row.IsNull("name") ? string.Empty : row.Field <string>("name"); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }