/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromItemaltwhsetot(ref DataRow row, Itemaltwhsetot entity) { row.SetField("availQty", entity.availQty); row.SetField("resvQty", entity.resvQty); row.SetField("unavQty", entity.unavQty); row.SetField("totQty", entity.totQty); row.SetField("itemaltwhsetotuserfield", entity.itemaltwhsetotuserfield); row.SetField("userfield", entity.userfield); }
public static Itemaltwhsetot BuildItemaltwhsetotFromRow(DataRow row) { Itemaltwhsetot entity = new Itemaltwhsetot(); entity.availQty = row.IsNull("availQty") ? decimal.Zero : row.Field <decimal>("availQty"); entity.resvQty = row.IsNull("resvQty") ? decimal.Zero : row.Field <decimal>("resvQty"); entity.unavQty = row.IsNull("unavQty") ? decimal.Zero : row.Field <decimal>("unavQty"); entity.totQty = row.IsNull("totQty") ? decimal.Zero : row.Field <decimal>("totQty"); entity.itemaltwhsetotuserfield = row.IsNull("itemaltwhsetotuserfield") ? string.Empty : row.Field <string>("itemaltwhsetotuserfield"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }