/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApeesplitpay(ref DataRow row, Apeesplitpay entity) { row.SetField("paymentno", entity.paymentno); row.SetField("amount", entity.amount); row.SetField("discount", entity.discount); row.SetField("disputed", entity.disputed); row.SetField("duedate", entity.duedate); row.SetField("discountdate", entity.discountdate); row.SetField("userfield", entity.userfield); }
public static Apeesplitpay BuildApeesplitpayFromRow(DataRow row) { Apeesplitpay entity = new Apeesplitpay(); entity.paymentno = row.IsNull("paymentno") ? 0 : row.Field <int>("paymentno"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.discount = row.IsNull("discount") ? decimal.Zero : row.Field <decimal>("discount"); 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); }