public static Loadleadtimehistresults BuildLoadleadtimehistresultsFromRow(DataRow row) { Loadleadtimehistresults entity = new Loadleadtimehistresults(); entity.receiptdt = row.Field <DateTime?>("receiptdt"); entity.pono = row.IsNull("pono") ? 0 : row.Field <int>("pono"); entity.posuf = row.IsNull("posuf") ? 0 : row.Field <int>("posuf"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.orderdt = row.Field <DateTime?>("orderdt"); entity.leadtime = row.IsNull("leadtime") ? 0 : row.Field <int>("leadtime"); entity.lnignoreltfl = row.Field <bool>("lnignoreltfl"); entity.orglnignoreltfl = row.Field <bool>("orglnignoreltfl"); entity.hdrignoreltfl = row.Field <bool>("hdrignoreltfl"); entity.orghdrignoreltfl = row.Field <bool>("orghdrignoreltfl"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.rushfl = row.Field <bool>("rushfl"); entity.qtyrcv = row.IsNull("qtyrcv") ? decimal.Zero : row.Field <decimal>("qtyrcv"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.sortby = row.IsNull("sortby") ? string.Empty : row.Field <string>("sortby"); entity.sortseq = row.IsNull("sortseq") ? 0 : row.Field <int>("sortseq"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromLoadleadtimehistresults(ref DataRow row, Loadleadtimehistresults entity) { row.SetField("receiptdt", entity.receiptdt); row.SetField("pono", entity.pono); row.SetField("posuf", entity.posuf); row.SetField("lineno", entity.lineno); row.SetField("notesfl", entity.notesfl); row.SetField("orderdt", entity.orderdt); row.SetField("leadtime", entity.leadtime); row.SetField("lnignoreltfl", entity.lnignoreltfl); row.SetField("orglnignoreltfl", entity.orglnignoreltfl); row.SetField("hdrignoreltfl", entity.hdrignoreltfl); row.SetField("orghdrignoreltfl", entity.orghdrignoreltfl); row.SetField("transtype", entity.transtype); row.SetField("rushfl", entity.rushfl); row.SetField("qtyrcv", entity.qtyrcv); row.SetField("unit", entity.unit); row.SetField("vendno", entity.vendno); row.SetField("sortby", entity.sortby); row.SetField("sortseq", entity.sortseq); row.SetField("userfield", entity.userfield); }