/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdstlookupresults(ref DataRow row, Pdstlookupresults entity) { row.SetField("codeiden", entity.codeiden); row.SetField("codeval", entity.codeval); row.SetField("descrip", entity.descrip); row.SetField("vendno", entity.vendno); row.SetField("rowid-pdst", entity.rowidPdst.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Pdstlookupresults BuildPdstlookupresultsFromRow(DataRow row) { Pdstlookupresults entity = new Pdstlookupresults(); entity.codeiden = row.IsNull("codeiden") ? string.Empty : row.Field <string>("codeiden"); entity.codeval = row.IsNull("codeval") ? string.Empty : row.Field <string>("codeval"); entity.descrip = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.rowidPdst = row.Field <byte[]>("rowid-pdst").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }