/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromKpiwloadheaderresults(ref DataRow row, Kpiwloadheaderresults entity) { row.SetField("refer", entity.refer); row.SetField("qtyord", entity.qtyord); row.SetField("unit", entity.unit); row.SetField("prodcat", entity.prodcat); row.SetField("descrip", entity.descrip); row.SetField("qtyship", entity.qtyship); row.SetField("jrnlno", entity.jrnlno); row.SetField("setno", entity.setno); row.SetField("stkqtyord", entity.stkqtyord); row.SetField("bofl", entity.bofl); row.SetField("stkqtyship", entity.stkqtyship); row.SetField("prodcost", entity.prodcost); row.SetField("lblwtorderno", entity.lblwtorderno); row.SetField("lblorderno", entity.lblorderno); row.SetField("lblwoorderno", entity.lblwoorderno); row.SetField("rrarinit", entity.rrarinit); row.SetField("transtype", entity.transtype); row.SetField("corderaltno", entity.corderaltno); row.SetField("linealtno", entity.linealtno); row.SetField("operinit", entity.operinit); row.SetField("transdt", entity.transdt); row.SetField("transtm", entity.transtm); row.SetField("ordname", entity.ordname); row.SetField("lblwtordernohidden", entity.lblwtordernohidden); row.SetField("lblordernohidden", entity.lblordernohidden); row.SetField("lblwoordernohidden", entity.lblwoordernohidden); row.SetField("verno", entity.verno); row.SetField("userfield", entity.userfield); }
public static Kpiwloadheaderresults BuildKpiwloadheaderresultsFromRow(DataRow row) { Kpiwloadheaderresults entity = new Kpiwloadheaderresults(); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.descrip = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip"); entity.qtyship = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.setno = row.IsNull("setno") ? 0 : row.Field <int>("setno"); entity.stkqtyord = row.IsNull("stkqtyord") ? decimal.Zero : row.Field <decimal>("stkqtyord"); entity.bofl = row.Field <bool>("bofl"); entity.stkqtyship = row.IsNull("stkqtyship") ? decimal.Zero : row.Field <decimal>("stkqtyship"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost"); entity.lblwtorderno = row.IsNull("lblwtorderno") ? string.Empty : row.Field <string>("lblwtorderno"); entity.lblorderno = row.IsNull("lblorderno") ? string.Empty : row.Field <string>("lblorderno"); entity.lblwoorderno = row.IsNull("lblwoorderno") ? string.Empty : row.Field <string>("lblwoorderno"); entity.rrarinit = row.IsNull("rrarinit") ? string.Empty : row.Field <string>("rrarinit"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.corderaltno = row.IsNull("corderaltno") ? string.Empty : row.Field <string>("corderaltno"); entity.linealtno = row.IsNull("linealtno") ? 0 : row.Field <int>("linealtno"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.transdt = row.Field <DateTime?>("transdt"); entity.transtm = row.IsNull("transtm") ? string.Empty : row.Field <string>("transtm"); entity.ordname = row.IsNull("ordname") ? string.Empty : row.Field <string>("ordname"); entity.lblwtordernohidden = row.Field <bool>("lblwtordernohidden"); entity.lblordernohidden = row.Field <bool>("lblordernohidden"); entity.lblwoordernohidden = row.Field <bool>("lblwoordernohidden"); entity.verno = row.IsNull("verno") ? 0 : row.Field <int>("verno"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }