/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcimcomponents(ref DataRow row, Icimcomponents entity) { row.SetField("shipprod", entity.shipprod); row.SetField("proddesc", entity.proddesc); row.SetField("statustype", entity.statustype); row.SetField("qtybundle", entity.qtybundle); row.SetField("length", entity.length); row.SetField("userfield", entity.userfield); }
public static Icimcomponents BuildIcimcomponentsFromRow(DataRow row) { Icimcomponents entity = new Icimcomponents(); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.proddesc = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.qtybundle = row.IsNull("qtybundle") ? decimal.Zero : row.Field <decimal>("qtybundle"); entity.length = row.IsNull("length") ? 0 : row.Field <int>("length"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }