/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWlitcriteria(ref DataRow row, Wlitcriteria entity) { row.SetField("cono", entity.cono); row.SetField("whse", entity.whse); row.SetField("statustype", entity.statustype); row.SetField("processty", entity.processty); row.SetField("fmcreatedt", entity.fmcreatedt); row.SetField("tocreatedt", entity.tocreatedt); row.SetField("transtype", entity.transtype); row.SetField("updatety", entity.updatety); row.SetField("vendno", entity.vendno); row.SetField("shipfmno", entity.shipfmno); row.SetField("setno", entity.setno); row.SetField("errormess", entity.errormess); row.SetField("orderno", entity.orderno); row.SetField("ordersuf", entity.ordersuf); row.SetField("ordertype", entity.ordertype); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("nonstockfl", entity.nonstockfl); row.SetField("prodno", entity.prodno); row.SetField("function", entity.function); row.SetField("recordcountlimit", entity.recordcountlimit); row.SetField("userfield", entity.userfield); }
public static Wlitcriteria BuildWlitcriteriaFromRow(DataRow row) { Wlitcriteria entity = new Wlitcriteria(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.processty = row.IsNull("processty") ? string.Empty : row.Field <string>("processty"); entity.fmcreatedt = row.Field <DateTime?>("fmcreatedt"); entity.tocreatedt = row.Field <DateTime?>("tocreatedt"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.updatety = row.IsNull("updatety") ? string.Empty : row.Field <string>("updatety"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.shipfmno = row.IsNull("shipfmno") ? 0 : row.Field <int>("shipfmno"); entity.setno = row.IsNull("setno") ? string.Empty : row.Field <string>("setno"); entity.errormess = row.IsNull("errormess") ? string.Empty : row.Field <string>("errormess"); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.ordertype = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.nonstockfl = row.Field <bool>("nonstockfl"); entity.prodno = row.IsNull("prodno") ? string.Empty : row.Field <string>("prodno"); entity.function = row.IsNull("function") ? string.Empty : row.Field <string>("function"); entity.recordcountlimit = row.IsNull("recordcountlimit") ? 0 : row.Field <int>("recordcountlimit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }