/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOeirheaderfieldsinitresults(ref DataRow row, Oeirheaderfieldsinitresults entity) { row.SetField("orderno", entity.orderno); row.SetField("ordersuf", entity.ordersuf); row.SetField("ordernox", entity.ordernox); row.SetField("type", entity.type); row.SetField("stagecd", entity.stagecd); row.SetField("stagecdx", entity.stagecdx); row.SetField("name", entity.name); row.SetField("approvty", entity.approvty); row.SetField("approvintlty", entity.approvintlty); row.SetField("codfl", entity.codfl); row.SetField("codcollamt", entity.codcollamt); row.SetField("termstype", entity.termstype); row.SetField("shipviaty", entity.shipviaty); row.SetField("comment1", entity.comment1); row.SetField("comment2", entity.comment2); row.SetField("userfield", entity.userfield); }
public static Oeirheaderfieldsinitresults BuildOeirheaderfieldsinitresultsFromRow(DataRow row) { Oeirheaderfieldsinitresults entity = new Oeirheaderfieldsinitresults(); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.ordernox = row.IsNull("ordernox") ? string.Empty : row.Field <string>("ordernox"); entity.type = row.IsNull("type") ? string.Empty : row.Field <string>("type"); entity.stagecd = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd"); entity.stagecdx = row.IsNull("stagecdx") ? string.Empty : row.Field <string>("stagecdx"); entity.name = row.IsNull("name") ? string.Empty : row.Field <string>("name"); entity.approvty = row.IsNull("approvty") ? string.Empty : row.Field <string>("approvty"); entity.approvintlty = row.IsNull("approvintlty") ? string.Empty : row.Field <string>("approvintlty"); entity.codfl = row.Field <bool>("codfl"); entity.codcollamt = row.IsNull("codcollamt") ? decimal.Zero : row.Field <decimal>("codcollamt"); entity.termstype = row.IsNull("termstype") ? string.Empty : row.Field <string>("termstype"); entity.shipviaty = row.IsNull("shipviaty") ? string.Empty : row.Field <string>("shipviaty"); entity.comment1 = row.IsNull("comment1") ? string.Empty : row.Field <string>("comment1"); entity.comment2 = row.IsNull("comment2") ? string.Empty : row.Field <string>("comment2"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }