/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcemcupdateresults(ref DataRow row, Icemcupdateresults entity) { row.SetField("whse", entity.whse); row.SetField("prod", entity.prod); row.SetField("prodnotes", entity.prodnotes); row.SetField("quantity", entity.quantity); row.SetField("unit", entity.unit); row.SetField("lastcostfl", entity.lastcostfl); row.SetField("wrongcost", entity.wrongcost); row.SetField("correctcost", entity.correctcost); row.SetField("lastamt", entity.lastamt); row.SetField("userfield", entity.userfield); }
public static Icemcupdateresults BuildIcemcupdateresultsFromRow(DataRow row) { Icemcupdateresults entity = new Icemcupdateresults(); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.prodnotes = row.IsNull("prodnotes") ? string.Empty : row.Field <string>("prodnotes"); entity.quantity = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.lastcostfl = row.Field <bool>("lastcostfl"); entity.wrongcost = row.IsNull("wrongcost") ? decimal.Zero : row.Field <decimal>("wrongcost"); entity.correctcost = row.IsNull("correctcost") ? decimal.Zero : row.Field <decimal>("correctcost"); entity.lastamt = row.IsNull("lastamt") ? decimal.Zero : row.Field <decimal>("lastamt"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }