/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPocoreallocationresults(ref DataRow row, Pocoreallocationresults entity) { row.SetField("pono", entity.pono); row.SetField("posuf", entity.posuf); row.SetField("lineno", entity.lineno); row.SetField("qty", entity.qty); row.SetField("qtyalloc", entity.qtyalloc); row.SetField("oldalloc", entity.oldalloc); row.SetField("receiptdt", entity.receiptdt); row.SetField("stagecd", entity.stagecd); row.SetField("coreduedt", entity.coreduedt); row.SetField("modifyfl", entity.modifyfl); row.SetField("whse", entity.whse); row.SetField("prod", entity.prod); row.SetField("coreprod", entity.coreprod); row.SetField("expirefl", entity.expirefl); row.SetField("recno", entity.recno); row.SetField("cStageCd", entity.cStageCd); row.SetField("userfield", entity.userfield); }
public static Pocoreallocationresults BuildPocoreallocationresultsFromRow(DataRow row) { Pocoreallocationresults entity = new Pocoreallocationresults(); entity.pono = row.IsNull("pono") ? 0 : row.Field <int>("pono"); entity.posuf = row.IsNull("posuf") ? 0 : row.Field <int>("posuf"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.qty = row.IsNull("qty") ? decimal.Zero : row.Field <decimal>("qty"); entity.qtyalloc = row.IsNull("qtyalloc") ? decimal.Zero : row.Field <decimal>("qtyalloc"); entity.oldalloc = row.IsNull("oldalloc") ? decimal.Zero : row.Field <decimal>("oldalloc"); entity.receiptdt = row.Field <DateTime?>("receiptdt"); entity.stagecd = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd"); entity.coreduedt = row.Field <DateTime?>("coreduedt"); entity.modifyfl = row.Field <bool>("modifyfl"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.coreprod = row.IsNull("coreprod") ? string.Empty : row.Field <string>("coreprod"); entity.expirefl = row.Field <bool>("expirefl"); entity.recno = row.IsNull("recno") ? 0 : row.Field <int>("recno"); entity.cStageCd = row.IsNull("cStageCd") ? string.Empty : row.Field <string>("cStageCd"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }