예제 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromCamsubject(ref DataRow row, Camsubject entity)
 {
     row.SetField("subjectroletype", entity.subjectroletype);
     row.SetField("subjectprimarykey", entity.subjectprimarykey);
     row.SetField("subjectsecondarykey", entity.subjectsecondarykey);
     row.SetField("showall", entity.showall);
     row.SetField("userfield", entity.userfield);
 }
예제 #2
0
        public static Camsubject BuildCamsubjectFromRow(DataRow row)
        {
            Camsubject entity = new Camsubject();

            entity.subjectroletype     = row.IsNull("subjectroletype") ? string.Empty : row.Field <string>("subjectroletype");
            entity.subjectprimarykey   = row.IsNull("subjectprimarykey") ? string.Empty : row.Field <string>("subjectprimarykey");
            entity.subjectsecondarykey = row.IsNull("subjectsecondarykey") ? string.Empty : row.Field <string>("subjectsecondarykey");
            entity.showall             = row.Field <bool>("showall");
            entity.userfield           = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }