public static Oereturnupdatelist BuildOereturnupdatelistFromRow(DataRow row) { Oereturnupdatelist entity = new Oereturnupdatelist(); entity.qtyship = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.selectfl = row.Field <bool>("selectfl"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.returnty = row.IsNull("returnty") ? string.Empty : row.Field <string>("returnty"); entity.qtyunavail = row.IsNull("qtyunavail") ? decimal.Zero : row.Field <decimal>("qtyunavail"); entity.reasunavty = row.IsNull("reasunavty") ? string.Empty : row.Field <string>("reasunavty"); entity.restockamt = row.IsNull("restockamt") ? decimal.Zero : row.Field <decimal>("restockamt"); entity.restockfl = row.Field <bool>("restockfl"); entity.restktaxgrp = row.IsNull("restktaxgrp") ? 0 : row.Field <int>("restktaxgrp"); entity.warrtag = row.IsNull("warrtag") ? string.Empty : row.Field <string>("warrtag"); entity.qtyreturn = row.IsNull("qtyreturn") ? decimal.Zero : row.Field <decimal>("qtyreturn"); entity.retorderno = row.IsNull("retorderno") ? 0 : row.Field <int>("retorderno"); entity.retordersuf = row.IsNull("retordersuf") ? 0 : row.Field <int>("retordersuf"); entity.retlineno = row.IsNull("retlineno") ? 0 : row.Field <int>("retlineno"); entity.usagefl = row.Field <bool>("usagefl"); entity.warrstagecd = row.IsNull("warrstagecd") ? 0 : row.Field <int>("warrstagecd"); entity.crreasonty = row.IsNull("crreasonty") ? string.Empty : row.Field <string>("crreasonty"); entity.warrexchgfl = row.Field <bool>("warrexchgfl"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.shipfmno = row.IsNull("shipfmno") ? 0 : row.Field <int>("shipfmno"); entity.createpofl = row.Field <bool>("createpofl"); entity.orderaltno = row.IsNull("orderaltno") ? 0 : row.Field <int>("orderaltno"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.addswoptprodfl = row.Field <bool>("addswoptprodfl"); entity.corertnty = row.IsNull("corertnty") ? string.Empty : row.Field <string>("corertnty"); entity.origcore = row.IsNull("origcore") ? string.Empty : row.Field <string>("origcore"); entity.warrantycore = row.Field <bool>("warrantycore"); entity.vendclaimno = row.IsNull("vendclaimno") ? string.Empty : row.Field <string>("vendclaimno"); entity.commentfl = row.Field <bool>("commentfl"); entity.warrantycd = row.IsNull("warrantycd") ? string.Empty : row.Field <string>("warrantycd"); entity.ehfaddonno = row.IsNull("ehfaddonno") ? 0 : row.Field <int>("ehfaddonno"); entity.ehfamt = row.IsNull("ehfamt") ? decimal.Zero : row.Field <decimal>("ehfamt"); entity.ehfexemptamt = row.IsNull("ehfexemptamt") ? decimal.Zero : row.Field <decimal>("ehfexemptamt"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOereturnupdatelist(ref DataRow row, Oereturnupdatelist entity) { row.SetField("qtyship", entity.qtyship); row.SetField("unit", entity.unit); row.SetField("selectfl", entity.selectfl); row.SetField("prod", entity.prod); row.SetField("returnty", entity.returnty); row.SetField("qtyunavail", entity.qtyunavail); row.SetField("reasunavty", entity.reasunavty); row.SetField("restockamt", entity.restockamt); row.SetField("restockfl", entity.restockfl); row.SetField("restktaxgrp", entity.restktaxgrp); row.SetField("warrtag", entity.warrtag); row.SetField("qtyreturn", entity.qtyreturn); row.SetField("retorderno", entity.retorderno); row.SetField("retordersuf", entity.retordersuf); row.SetField("retlineno", entity.retlineno); row.SetField("usagefl", entity.usagefl); row.SetField("warrstagecd", entity.warrstagecd); row.SetField("crreasonty", entity.crreasonty); row.SetField("warrexchgfl", entity.warrexchgfl); row.SetField("vendno", entity.vendno); row.SetField("shipfmno", entity.shipfmno); row.SetField("createpofl", entity.createpofl); row.SetField("orderaltno", entity.orderaltno); row.SetField("lineno", entity.lineno); row.SetField("addswoptprodfl", entity.addswoptprodfl); row.SetField("corertnty", entity.corertnty); row.SetField("origcore", entity.origcore); row.SetField("warrantycore", entity.warrantycore); row.SetField("vendclaimno", entity.vendclaimno); row.SetField("commentfl", entity.commentfl); row.SetField("warrantycd", entity.warrantycd); row.SetField("ehfaddonno", entity.ehfaddonno); row.SetField("ehfamt", entity.ehfamt); row.SetField("ehfexemptamt", entity.ehfexemptamt); row.SetField("userfield", entity.userfield); }