/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromGlembcriteria(ref DataRow row, Glembcriteria entity) { row.SetField("yr", entity.yr); row.SetField("Acct", entity.acct); row.SetField("fieldchanged", entity.fieldchanged); row.SetField("changeby", entity.changeby); row.SetField("changeamt", entity.changeamt); row.SetField("reason", entity.reason); row.SetField("userfield", entity.userfield); }
public static Glembcriteria BuildGlembcriteriaFromRow(DataRow row) { Glembcriteria entity = new Glembcriteria(); entity.yr = row.IsNull("yr") ? 0 : row.Field <int>("yr"); entity.acct = row.IsNull("Acct") ? string.Empty : row.Field <string>("Acct"); entity.fieldchanged = row.IsNull("fieldchanged") ? string.Empty : row.Field <string>("fieldchanged"); entity.changeby = row.IsNull("changeby") ? string.Empty : row.Field <string>("changeby"); entity.changeamt = row.IsNull("changeamt") ? decimal.Zero : row.Field <decimal>("changeamt"); entity.reason = row.IsNull("reason") ? string.Empty : row.Field <string>("reason"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }