/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPorrarvendcredit(ref DataRow row, Porrarvendcredit entity) { row.SetField("pdsvcrecno", entity.pdsvcrecno); row.SetField("contractno", entity.contractno); row.SetField("startdt", entity.startdt); row.SetField("enddt", entity.enddt); row.SetField("maxqty", entity.maxqty); row.SetField("actqty", entity.actqty); row.SetField("remamt", entity.remamt); row.SetField("origrem", entity.origrem); row.SetField("usenow", entity.usenow); row.SetField("changed", entity.changed); row.SetField("userfield", entity.userfield); }
public static Porrarvendcredit BuildPorrarvendcreditFromRow(DataRow row) { Porrarvendcredit entity = new Porrarvendcredit(); entity.pdsvcrecno = row.IsNull("pdsvcrecno") ? 0 : row.Field <int>("pdsvcrecno"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.startdt = row.Field <DateTime?>("startdt"); entity.enddt = row.Field <DateTime?>("enddt"); entity.maxqty = row.IsNull("maxqty") ? decimal.Zero : row.Field <decimal>("maxqty"); entity.actqty = row.IsNull("actqty") ? decimal.Zero : row.Field <decimal>("actqty"); entity.remamt = row.IsNull("remamt") ? decimal.Zero : row.Field <decimal>("remamt"); entity.origrem = row.IsNull("origrem") ? decimal.Zero : row.Field <decimal>("origrem"); entity.usenow = row.IsNull("usenow") ? decimal.Zero : row.Field <decimal>("usenow"); entity.changed = row.IsNull("changed") ? string.Empty : row.Field <string>("changed"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }