/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromArsdsave(ref DataRow row, Arsdsave entity) { row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("cardno", entity.cardno); row.SetField("seqno", entity.seqno); row.SetField("name", entity.name); row.SetField("maxamount", entity.maxamount); row.SetField("mediacd", entity.mediacd); row.SetField("cardtype", entity.cardtype); row.SetField("callfrom", entity.callfrom); row.SetField("userfield", entity.userfield); }
public static Arsdsave BuildArsdsaveFromRow(DataRow row) { Arsdsave entity = new Arsdsave(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.cardno = row.IsNull("cardno") ? string.Empty : row.Field <string>("cardno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.name = row.IsNull("name") ? string.Empty : row.Field <string>("name"); entity.maxamount = row.IsNull("maxamount") ? decimal.Zero : row.Field <decimal>("maxamount"); entity.mediacd = row.IsNull("mediacd") ? 0 : row.Field <int>("mediacd"); entity.cardtype = row.IsNull("cardtype") ? string.Empty : row.Field <string>("cardtype"); entity.callfrom = row.IsNull("callfrom") ? string.Empty : row.Field <string>("callfrom"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }