/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSplitpay(ref DataRow row, Splitpay entity) { row.SetField("paymentno", entity.paymentno); row.SetField("amount", entity.amount); row.SetField("origdisc", entity.origdisc); row.SetField("disputed", entity.disputed); row.SetField("duedate", entity.duedate); row.SetField("discountdate", entity.discountdate); row.SetField("userfield", entity.userfield); }
public static Splitpay BuildSplitpayFromRow(DataRow row) { Splitpay entity = new Splitpay(); entity.paymentno = row.IsNull("paymentno") ? 0 : row.Field <int>("paymentno"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.origdisc = row.IsNull("origdisc") ? decimal.Zero : row.Field <decimal>("origdisc"); entity.disputed = row.Field <bool>("disputed"); entity.duedate = row.Field <DateTime?>("duedate"); entity.discountdate = row.Field <DateTime?>("discountdate"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }