/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOeeraddrselect(ref DataRow row, Oeeraddrselect entity) { row.SetField("selecttype", entity.selecttype); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("vendno", entity.vendno); row.SetField("shipfmno", entity.shipfmno); row.SetField("prosno", entity.prosno); row.SetField("contactid", entity.contactid); row.SetField("userfield", entity.userfield); }
public static Oeeraddrselect BuildOeeraddrselectFromRow(DataRow row) { Oeeraddrselect entity = new Oeeraddrselect(); entity.selecttype = row.IsNull("selecttype") ? string.Empty : row.Field <string>("selecttype"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.shipfmno = row.IsNull("shipfmno") ? 0 : row.Field <int>("shipfmno"); entity.prosno = row.IsNull("prosno") ? decimal.Zero : row.Field <decimal>("prosno"); entity.contactid = row.IsNull("contactid") ? 0 : row.Field <int>("contactid"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }