/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcspccriteria(ref DataRow row, Icspccriteria entity) { row.SetField("setuptype", entity.setuptype); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("shiptogrp", entity.shiptogrp); row.SetField("whse", entity.whse); row.SetField("begstartdt", entity.begstartdt); row.SetField("endstartdt", entity.endstartdt); row.SetField("begexpiredt", entity.begexpiredt); row.SetField("endexpiredt", entity.endexpiredt); row.SetField("statuscd", entity.statuscd); row.SetField("refer", entity.refer); row.SetField("contractno", entity.contractno); row.SetField("product", entity.product); row.SetField("pullqtycd", entity.pullqtycd); row.SetField("recordlimit", entity.recordlimit); row.SetField("userfield", entity.userfield); }
public static Icspccriteria BuildIcspccriteriaFromRow(DataRow row) { Icspccriteria entity = new Icspccriteria(); entity.setuptype = row.IsNull("setuptype") ? string.Empty : row.Field <string>("setuptype"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.shiptogrp = row.IsNull("shiptogrp") ? string.Empty : row.Field <string>("shiptogrp"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.begstartdt = row.Field <DateTime?>("begstartdt"); entity.endstartdt = row.Field <DateTime?>("endstartdt"); entity.begexpiredt = row.Field <DateTime?>("begexpiredt"); entity.endexpiredt = row.Field <DateTime?>("endexpiredt"); entity.statuscd = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.product = row.IsNull("product") ? string.Empty : row.Field <string>("product"); entity.pullqtycd = row.IsNull("pullqtycd") ? string.Empty : row.Field <string>("pullqtycd"); entity.recordlimit = row.IsNull("recordlimit") ? 0 : row.Field <int>("recordlimit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }