/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromLoadwteeresults(ref DataRow row, Loadwteeresults entity) { row.SetField("wtno", entity.wtno); row.SetField("wtsuf", entity.wtsuf); row.SetField("wtnox", entity.wtnox); row.SetField("notesfl", entity.notesfl); row.SetField("stagecd", entity.stagecd); row.SetField("stagecdx", entity.stagecdx); row.SetField("transtype", entity.transtype); row.SetField("orderdt", entity.orderdt); row.SetField("receiptdt", entity.receiptdt); row.SetField("duedt", entity.duedt); row.SetField("shipfmwhse", entity.shipfmwhse); row.SetField("shipfmname", entity.shipfmname); row.SetField("shiptowhse", entity.shiptowhse); row.SetField("shiptoname", entity.shiptoname); row.SetField("sortdt1", entity.sortdt1); row.SetField("sortdt2", entity.sortdt2); row.SetField("sortfld", entity.sortfld); row.SetField("amounti", entity.amounti); }
public static Loadwteeresults BuildLoadwteeresultsFromRow(DataRow row) { Loadwteeresults entity = new Loadwteeresults(); entity.wtno = row.IsNull("wtno") ? 0 : row.Field <int>("wtno"); entity.wtsuf = row.IsNull("wtsuf") ? 0 : row.Field <int>("wtsuf"); entity.wtnox = row.IsNull("wtnox") ? string.Empty : row.Field <string>("wtnox"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.stagecd = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd"); entity.stagecdx = row.IsNull("stagecdx") ? string.Empty : row.Field <string>("stagecdx"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.orderdt = row.Field <DateTime?>("orderdt"); entity.receiptdt = row.Field <DateTime?>("receiptdt"); entity.duedt = row.Field <DateTime?>("duedt"); entity.shipfmwhse = row.IsNull("shipfmwhse") ? string.Empty : row.Field <string>("shipfmwhse"); entity.shipfmname = row.IsNull("shipfmname") ? string.Empty : row.Field <string>("shipfmname"); entity.shiptowhse = row.IsNull("shiptowhse") ? string.Empty : row.Field <string>("shiptowhse"); entity.shiptoname = row.IsNull("shiptoname") ? string.Empty : row.Field <string>("shiptoname"); entity.sortdt1 = row.Field <DateTime?>("sortdt1"); entity.sortdt2 = row.Field <DateTime?>("sortdt2"); entity.sortfld = row.IsNull("sortfld") ? string.Empty : row.Field <string>("sortfld"); entity.amounti = row.IsNull("amounti") ? 0 : row.Field <int>("amounti"); return(entity); }