public static Porrarreptvendchgsingle BuildPorrarreptvendchgsingleFromRow(DataRow row) { Porrarreptvendchgsingle entity = new Porrarreptvendchgsingle(); entity.rowidPoerah = row.Field <byte[]>("rowid-poerah").ToStringEncoded(); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.shipfmno = row.IsNull("shipfmno") ? 0 : row.Field <int>("shipfmno"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.repricefl = row.Field <bool>("repricefl"); entity.usechaindiscfl = row.Field <bool>("usechaindiscfl"); entity.baselistfl = row.Field <bool>("baselistfl"); entity.multiplierdiscfl = row.Field <bool>("multiplierdiscfl"); entity.multiplier = row.IsNull("multiplier") ? decimal.Zero : row.Field <decimal>("multiplier"); entity.disc1 = row.IsNull("disc1") ? 0 : row.Field <int>("disc1"); entity.disc2 = row.IsNull("disc2") ? 0 : row.Field <int>("disc2"); entity.disc3 = row.IsNull("disc3") ? 0 : row.Field <int>("disc3"); entity.disc4 = row.IsNull("disc4") ? 0 : row.Field <int>("disc4"); entity.disc5 = row.IsNull("disc5") ? 0 : row.Field <int>("disc5"); entity.disc6 = row.IsNull("disc6") ? 0 : row.Field <int>("disc6"); entity.disc7 = row.IsNull("disc7") ? 0 : row.Field <int>("disc7"); entity.disc8 = row.IsNull("disc8") ? 0 : row.Field <int>("disc8"); entity.disc9 = row.IsNull("disc9") ? 0 : row.Field <int>("disc9"); entity.disc10 = row.IsNull("disc10") ? 0 : row.Field <int>("disc10"); entity.disc11 = row.IsNull("disc11") ? 0 : row.Field <int>("disc11"); entity.disc12 = row.IsNull("disc12") ? 0 : row.Field <int>("disc12"); entity.disc13 = row.IsNull("disc13") ? 0 : row.Field <int>("disc13"); entity.disc14 = row.IsNull("disc14") ? 0 : row.Field <int>("disc14"); entity.disc15 = row.IsNull("disc15") ? 0 : row.Field <int>("disc15"); entity.disc16 = row.IsNull("disc16") ? 0 : row.Field <int>("disc16"); entity.disc17 = row.IsNull("disc17") ? 0 : row.Field <int>("disc17"); entity.disc18 = row.IsNull("disc18") ? 0 : row.Field <int>("disc18"); entity.disc19 = row.IsNull("disc19") ? 0 : row.Field <int>("disc19"); entity.warningfl = row.Field <bool>("warningfl"); entity.calcpct = row.IsNull("calcpct") ? decimal.Zero : row.Field <decimal>("calcpct"); entity.consty = row.IsNull("consty") ? string.Empty : row.Field <string>("consty"); entity.lookupnm = row.IsNull("lookupnm") ? string.Empty : row.Field <string>("lookupnm"); entity.pcttarget = row.IsNull("pcttarget") ? 0 : row.Field <int>("pcttarget"); entity.totlineamtd = row.IsNull("totlineamtd") ? decimal.Zero : row.Field <decimal>("totlineamtd"); entity.totcubesd = row.IsNull("totcubesd") ? decimal.Zero : row.Field <decimal>("totcubesd"); entity.totweightd = row.IsNull("totweightd") ? decimal.Zero : row.Field <decimal>("totweightd"); entity.totqtyordd = row.IsNull("totqtyordd") ? decimal.Zero : row.Field <decimal>("totqtyordd"); entity.totlineamti = row.IsNull("totlineamti") ? 0 : row.Field <int>("totlineamti"); entity.totcubesi = row.IsNull("totcubesi") ? 0 : row.Field <int>("totcubesi"); entity.totweighti = row.IsNull("totweighti") ? 0 : row.Field <int>("totweighti"); entity.totqtyordi = row.IsNull("totqtyordi") ? 0 : row.Field <int>("totqtyordi"); entity.revcyclin = row.IsNull("revcyclin") ? 0 : row.Field <int>("revcyclin"); entity.lastpowtdt = row.Field <DateTime?>("lastpowtdt"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPorrarreptvendchgsingle(ref DataRow row, Porrarreptvendchgsingle entity) { row.SetField("rowid-poerah", entity.rowidPoerah.ToByteArray()); row.SetField("vendno", entity.vendno); row.SetField("shipfmno", entity.shipfmno); row.SetField("prodline", entity.prodline); row.SetField("repricefl", entity.repricefl); row.SetField("usechaindiscfl", entity.usechaindiscfl); row.SetField("baselistfl", entity.baselistfl); row.SetField("multiplierdiscfl", entity.multiplierdiscfl); row.SetField("multiplier", entity.multiplier); row.SetField("disc1", entity.disc1); row.SetField("disc2", entity.disc2); row.SetField("disc3", entity.disc3); row.SetField("disc4", entity.disc4); row.SetField("disc5", entity.disc5); row.SetField("disc6", entity.disc6); row.SetField("disc7", entity.disc7); row.SetField("disc8", entity.disc8); row.SetField("disc9", entity.disc9); row.SetField("disc10", entity.disc10); row.SetField("disc11", entity.disc11); row.SetField("disc12", entity.disc12); row.SetField("disc13", entity.disc13); row.SetField("disc14", entity.disc14); row.SetField("disc15", entity.disc15); row.SetField("disc16", entity.disc16); row.SetField("disc17", entity.disc17); row.SetField("disc18", entity.disc18); row.SetField("disc19", entity.disc19); row.SetField("warningfl", entity.warningfl); row.SetField("calcpct", entity.calcpct); row.SetField("consty", entity.consty); row.SetField("lookupnm", entity.lookupnm); row.SetField("pcttarget", entity.pcttarget); row.SetField("totlineamtd", entity.totlineamtd); row.SetField("totcubesd", entity.totcubesd); row.SetField("totweightd", entity.totweightd); row.SetField("totqtyordd", entity.totqtyordd); row.SetField("totlineamti", entity.totlineamti); row.SetField("totcubesi", entity.totcubesi); row.SetField("totweighti", entity.totweighti); row.SetField("totqtyordi", entity.totqtyordi); row.SetField("revcyclin", entity.revcyclin); row.SetField("lastpowtdt", entity.lastpowtdt); }