/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromCreatelotsttresults(ref DataRow row, Createlotsttresults entity) { row.SetField("lotno", entity.lotno); row.SetField("quantity", entity.quantity); row.SetField("cprodcost", entity.cprodcost); row.SetField("qtycosted", entity.qtycosted); row.SetField("opendt", entity.opendt); row.SetField("closedt", entity.closedt); row.SetField("expiredt", entity.expiredt); row.SetField("qtyunavail", entity.qtyunavail); row.SetField("reasunavty", entity.reasunavty); row.SetField("whse", entity.whse); row.SetField("lotcutenabledfl", entity.lotcutenabledfl); row.SetField("userfield", entity.userfield); }
public static Createlotsttresults BuildCreatelotsttresultsFromRow(DataRow row) { Createlotsttresults entity = new Createlotsttresults(); entity.lotno = row.IsNull("lotno") ? string.Empty : row.Field<string>("lotno"); entity.quantity = row.IsNull("quantity") ? decimal.Zero : row.Field<decimal>("quantity"); entity.cprodcost = row.IsNull("cprodcost") ? string.Empty : row.Field<string>("cprodcost"); entity.qtycosted = row.IsNull("qtycosted") ? decimal.Zero : row.Field<decimal>("qtycosted"); entity.opendt = row.Field<DateTime?>("opendt"); entity.closedt = row.Field<DateTime?>("closedt"); entity.expiredt = row.Field<DateTime?>("expiredt"); entity.qtyunavail = row.IsNull("qtyunavail") ? decimal.Zero : row.Field<decimal>("qtyunavail"); entity.reasunavty = row.IsNull("reasunavty") ? string.Empty : row.Field<string>("reasunavty"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field<string>("whse"); entity.lotcutenabledfl = row.Field<bool>("lotcutenabledfl"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field<string>("userfield"); return entity; }