/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromArcustomercopy(ref DataRow row, Arcustomercopy entity) { row.SetField("fromcustno", entity.fromcustno); row.SetField("tocustno", entity.tocustno); row.SetField("name", entity.name); row.SetField("lookupnm", entity.lookupnm); row.SetField("lookupnmenterablefl", entity.lookupnmenterablefl); row.SetField("divno", entity.divno); row.SetField("divnoenterablefl", entity.divnoenterablefl); row.SetField("createdby", entity.createdby); row.SetField("createddt", entity.createddt); row.SetField("createdproc", entity.createdproc); row.SetField("createdtm", entity.createdtm); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Arcustomercopy BuildArcustomercopyFromRow(DataRow row) { Arcustomercopy entity = new Arcustomercopy(); entity.fromcustno = row.IsNull("fromcustno") ? decimal.Zero : row.Field <decimal>("fromcustno"); entity.tocustno = row.IsNull("tocustno") ? decimal.Zero : row.Field <decimal>("tocustno"); entity.name = row.IsNull("name") ? string.Empty : row.Field <string>("name"); entity.lookupnm = row.IsNull("lookupnm") ? string.Empty : row.Field <string>("lookupnm"); entity.lookupnmenterablefl = row.Field <bool>("lookupnmenterablefl"); entity.divno = row.IsNull("divno") ? 0 : row.Field <int>("divno"); entity.divnoenterablefl = row.Field <bool>("divnoenterablefl"); entity.createdby = row.IsNull("createdby") ? string.Empty : row.Field <string>("createdby"); entity.createddt = row.Field <DateTime?>("createddt"); entity.createdproc = row.IsNull("createdproc") ? string.Empty : row.Field <string>("createdproc"); entity.createdtm = row.IsNull("createdtm") ? string.Empty : row.Field <string>("createdtm"); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }